• Resolved Ewan24

    (@ewan24)


    Hi there,

    I have the “All in one Seo” plugin installed and I have already tweaked my descriptions and meta keywords for my home page and other site pages

    http://ehamedia.co.uk/

    However since I have installed my new theme… when Im in firefox or Explorer and right click there is always 2 pages descriptions?… the second is my own description using the “all in one seo” plugin and the first is random exerp from my page text which the new theme obviously generates (unfortunately google is now taking this description)

    My question is how can I go into the header php and stop the built in page description which the theme automaticaly generates?

    any suggestions would be much appreciated 🙂

    Ewan

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try editing your theme’s header.php template file.

    Thread Starter Ewan24

    (@ewan24)

    ah ok ….thanks

    im not too sure what Im looking for as there are a few bits which say description.. do you reckon you could point me in the right direction?

    here is my header.php (the top part which begins and end with </head>)

    <head profile="http://gmpg.org/xfn/11">
    	<!-- page titles -->
    	<title>
    	<?php if ( is_home() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php bloginfo('description'); ?><?php } ?>
    	<?php if ( is_search() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Search Results<?php } ?>
    	<?php if ( is_author() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Author Archives<?php } ?>
    	<?php if ( is_single() ) { ?><?php wp_title(''); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
    	<?php if ( is_page() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php wp_title(''); ?><?php } ?>
    	<?php if ( is_category() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Archive&nbsp;|&nbsp;<?php single_cat_title(); ?><?php } ?>
    	<?php if ( is_month() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Archive&nbsp;|&nbsp;<?php the_time('F'); ?><?php } ?>
    	<?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Tag Archive&nbsp;|&nbsp;<?php  single_tag_title("", true); } } ?>
    	</title>
    
    	<!-- meta tags -->
    	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    	<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<meta name="description" content="<?php the_excerpt_rss(); ?>" />
    	<?php endwhile; endif; elseif(is_home()) : ?>
            <meta name="description" content="<?php bloginfo('description'); ?>" />
    	<?php endif; ?>
    
    	<!-- import required theme styles -->
    	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
    	<!-- rss, pingback url and favicon link -->
    	<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'); ?>" />
    	<link rel="shortcut icon" href="<?php echo get_option('home'); ?>/favicon.ico" type="image/x-icon" />
    
    	<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    
    	<?php wp_head(); ?>
    </head>

    it is this line:
    <meta name="description" content="<?php the_excerpt_rss(); ?>" />
    it is embedded conditionally on ‘single’ or ‘page’ pages.

    actually, if you want to leave the meta ‘description’ tag to your seo plugin, you could consider taking this whole code out:

    <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<meta name="description" content="<?php the_excerpt_rss(); ?>" />
    	<?php endwhile; endif; elseif(is_home()) : ?>
            <meta name="description" content="<?php bloginfo('description'); ?>" />
    	<?php endif; ?>
    Thread Starter Ewan24

    (@ewan24)

    cheers

    that has worked… now there is only one description per page and its the description from the all in one SEO

    Just out of interest …is there any problems with removing this bit of code ?

    thanks so much alchymyth 🙂

    Ewan

    if you get your meta description from another source, such as your seo plugin, there is absolutely no problem in removing the code.

    Thread Starter Ewan24

    (@ewan24)

    ah ok…thats good to know

    Thanks esmi and alchymyth you have been a great help 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘stop theme from generating auto page description ?’ is closed to new replies.