WordPress.org

Support

Support » Themes and Templates » How to add an icon/graphic to the end of each post content

How to add an icon/graphic to the end of each post content

  • I’d like to add a little icon/graphic at the end of the text of every post.

    I can add a icon/graphic below each post by amending single.php like so:

    <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
    <img src="<?php bloginfo('template_directory'); ?>/images/bf.gif" />

    However, I want the graphic to be inline with the text within the post, not outside. For example, at present it looks like this:

    …end of the post.
    <graphic here>

    And I want it to be like this:

    …end of the post. <graphic here>

    Anyone know what I need to do to solve this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • this might work if used instead of your code:

    <?php $text = get_the_content().' <img src="'.get_bloginfo('template_directory').'/images/bg.gif" />';
    echo apply_filters('the_content',$text); ?>

    You’re beautiful. Anyone ever tell you that? 😉 Worked a charm. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add an icon/graphic to the end of each post content’ is closed to new replies.
Skip to toolbar