geezerd
Member
Posted 3 years ago #
I'm using an image instead of text for my more link.
I went here and tried what they said, which didn't work:
<?php the_content('Read more...<img src="' . bloginfo('template_directory'). '/images/leaf.gif" alt="read more" title="Read more..." />'); ?>
This works, but needs the full path from the root:
<?php the_content(__('<p class="more-line"><img src="/natestest/wp-content/themes/journalist/images/morelink.png" alt="read more" title="Read the rest of this article..." /></p>')); ?>
Apparently, template_directory is depreciated?
What do I use to point to the themes images folder?
Thanks
template_directory is not deprecated. Try:
<?php the_content(__('<p class="more-line"><img src="' . bloginfo('template_directory') . '/images/morelink.png" alt="read more" title="Read the rest of this article..." /></p>')); ?>
geezerd
Member
Posted 3 years ago #
Nope, still doesn't show the image.
Are you sure that you've uploaded the image to the correct folder?
geezerd
Member
Posted 3 years ago #
geezerd
Member
Posted 3 years ago #
geezerd
Member
Posted 3 years ago #
Anyone know what I should use here?
Thanks
Could you try dropping in the code I gave above? I'd like to be able to see what happens. Is this a child theme by any chance?
geezerd
Member
Posted 3 years ago #
I gave up on it, and just made the image a background. It was nesting a paragraph inside another paragraph the way I had it, anyway.
CSS: .more-link {display:block; float:right; width:79px; height:32px; background: url(images/morelink.png) center center no-repeat;}
HTML: `<?php the_content(' '); ?>
<div class="group"> </div>` ("group is coded for clear:both using group:after. And if I didn't put the in there, it didn't show up in the source code for some reason...? Dunno why.)
And then I made the link block taller than the background image and centered the image so it would never smoosh against anything else.
http://www.seanborggoesla.com/author/sean/page/6/ is the site.
geezerd
Member
Posted 3 years ago #
is what I had to put inside <div class="group"> </div>
Should read: <div class="group"> </div>
Strange that did not work at all without the in there, anyone know why?