• i saw the conditional statement that says if single post, put the title of the post, if not, put site description. My question is, where do i put it?? I tried index.php and its not working…
    <meta name=”description” content=”<?php if ( is_single() ) {
    single_post_title(”, true);
    } else {
    bloginfo(‘name’); echo ” – “; bloginfo(‘description’);
    }
    ?>” />

Viewing 6 replies - 1 through 6 (of 6 total)
  • This statement should go in your header file just before the </head> tag.

    Thread Starter weiler14

    (@weiler14)

    that did not work, here is my hearder.php….
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” /> <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” /><link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” /><link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
    <title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?</title>
    <?php wp_head(); ?>

    Are you saying that it didn’t work as in you put that in and nothing happened or that the </head> is not in your header.php?

    If it’s the second, then just put the line after

    <title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> ? Blog Archive <?php } ?> <?php wp_title(); ?</title>

    Thread Starter weiler14

    (@weiler14)

    I just tried that and didnt work, its supposed to give the title of the post and put it on top right?

    I just tried that and didnt work, its supposed to give the title of the post and put it on top right?

    No. <title> is the title shown in the browser toolbar.

    Thread Starter weiler14

    (@weiler14)

    yes i know, its not doing it

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Description and Title question’ is closed to new replies.