• 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

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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>')); ?>

    Thread Starter geezerd

    (@geezerd)

    Nope, still doesn’t show the image.

    Are you sure that you’ve uploaded the image to the correct folder?

    Thread Starter geezerd

    (@geezerd)

    positive

    page url?

    Thread Starter geezerd

    (@geezerd)

    Thread Starter geezerd

    (@geezerd)

    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?

    Thread Starter geezerd

    (@geezerd)

    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.

    https://www.seanborggoesla.com/author/sean/page/6/ is the site.

    Thread Starter geezerd

    (@geezerd)

    &nbsp; is what I had to put inside <div class="group"> </div>
    Should read: <div class="group"> &nbsp; </div>
    Strange that did not work at all without the &nbsp; in there, anyone know why?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘My more link image code needs cleaning up.’ is closed to new replies.