WordPress.org

Ready to get started?Download WordPress

Forums

Title PHP statement (4 posts)

  1. jwpettit
    Member
    Posted 9 years ago #

    I'm having trouble understanding the Title PHP statement:
    <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?>

    I would like to insert:
    bloginfo('description')
    after the name statement ONLY when you are on the main site index.
    I know that i need an "if (is_page(index.php)) else ...." (or something like that), but not sure how to incorporate that.
    Any help? Thanks.

  2. softius
    Member
    Posted 9 years ago #

    The code is: <?php if ( is_home() ) bloginfo('description'); ?>

  3. jwpettit
    Member
    Posted 9 years ago #

    I worked on this for 30 mins, write this post, and boom...i get it. Here it is:
    '<?php bloginfo('name'); ?> <?php if ( is_home() )
    { ?>» <?php bloginfo('description'); ?><?php } ?>
    <?php if ( is_single() )
    { ?> » Blog Archive <?php } ?>
    <?php wp_title(); ?>'

  4. jwpettit
    Member
    Posted 9 years ago #

    thanks softius!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags