WordPress.org

Support

Support » How-To and Troubleshooting » Add Specific text, pic, url above or bottom to specific categories post

Add Specific text, pic, url above or bottom to specific categories post

  • Dear Sir
    I would like to Add Specific text, pic, url above or bottom to specific categories post. And one thing also, this specific text, pic or anything should else should not show on homepage. Means to say, it should show when visitor open the post.

    I hope you understand. Sorry for poor English.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    edit single.php, and add a conditional statement where you want the ‘Specific text, pic, url’ to show;

    example:

    <?php if(in_category('specific')) : ?>
    Specific text, pic, url
    <?php endif; ?>

    http://codex.wordpress.org/Function_Reference/in_category

    thank u @alchymyth
    But can u tell me how to add a pic and url?
    i enter text and it works. but don’t know how to add a pic and url. 🙁

    To add a url:

    <a href="http://www.coolestech.com" title="Coolestech Blog!">Coolestech.com</a>

    to add an image:

    <img src="http://http://www.coolestech.com/header.jpg" alt="Coolestech Header"/>

    to add an image with a url:

    <a href="http://www.coolestech.com" title="Coolestech Blog!"><img src="http://http://www.coolestech.com/header.jpg" alt="Coolestech Header"/></a>

    You can also use these:
    Template directory:

    <?php bloginfo('template_directory'); ?>/images/image.jpg

    Post Title:

    <?php the_title(); ?>

    Post URL:

    <?php the_permalink(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Specific text, pic, url above or bottom to specific categories post’ is closed to new replies.