WordPress.org

Ready to get started?Download WordPress

Forums

Add Specific text, pic, url above or bottom to specific categories post (4 posts)

  1. yogesh_gamer
    Member
    Posted 2 years ago #

    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.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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

  3. yogesh_gamer
    Member
    Posted 2 years ago #

    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. :(

  4. 70074512
    Member
    Posted 2 years ago #

    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(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic