Adding a class in a template
I am not so handy with php, I am learning, but still I run into little things.
I have added a read more link in gallery_short:
Code:
<p class="leesmeer"><?php echo($this->more)? $this->more: $this->more; ?></p>
This is the output in html:
I would like to add a class to a href, so i want the output to be:
How can I achieve this? I have tried several thing in the gallery_short template, but without any luck.
Re: Adding a class in a template
Quote:
Originally Posted by lostrisq
I am not so handy with php, I am learning, but still I run into little things.
I have added a read more link in gallery_short:
Code:
<p class="leesmeer"><?php echo($this->more)? $this->more: $this->more; ?></p>
this code is "wrong" :) it always echo this->more, so it should be:
Code:
<p class="leesmeer"><?php echo $this->more; ?></p>
Quote:
Originally Posted by lostrisq
I would like to add a class to a href, so i want the output to be:
How can I achieve this? I have tried several thing in the gallery_short template, but without any luck.
why do you need to add a class to the anchor?
you can style it with a
Code:
.leesmeer a { ... }
you can access it through javascript with (using mootools)
Code:
$$('.leesmeer a')[0]
hope this helps in some way