Remove duplicate meta descriptions from header
-
Hi,
I use the Academica theme for my site https://www.englishlc.com. I also have Yoast WordPress SEO installed.
My problem is that the Academica theme is automatically creating a meta description from the first paragraph of the page. This meta description is taking precedent over Yoast’s meta description I have created for each page. The theme also inserts the site title(English Language Centre)in every SERP for the site, meaning I can only use a short unique page title.
Here is the code from the header.php, and I’d welcome any advice on the lines I need to remove so that there the page title and meta description showing on the search results are from the Yoast settings only.
<?php global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="https://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="msvalidate.01" content="E9660FC4132856CCCDA450C30AE580A4" /> <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' | '; } ?><?php bloginfo('name'); if(is_home()) { echo ' | '; bloginfo('description'); } ?></title> <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <meta name="description" content="<?php the_excerpt_rss(); ?>" /> <?php csv_tags(); ?> <?php endwhile; endif; elseif(is_home()) : ?> <meta name="description" content="<?php bloginfo('description'); ?>" /> <?php endif; ?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style.css" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url');?>" /> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_enqueue_script('jquery'); ?> <?php wp_head(); ?> <script type='text/javascript'> jQuery(document).ready(function() { jQuery("#menuhead ul").css({display: "none"}); // Opera Fix jQuery("#menuhead li").hover(function(){ jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); },function(){ jQuery(this).find('ul:first').css({visibility: "hidden"}); }); }); </script> <style> </style> </head> <body> <div id="wrap"> <div id="wrap1"> <div id="mainNav"> <div class="wrap"> <?php wp_nav_menu( array('container' => '', 'container_class' => '', 'menu_class' => '', 'menu_id' => 'menuhead', 'sort_column' => 'menu_order', 'theme_location' => 'primary' ) ); ?> <div id="omw"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Nav Translator') ) : ?> ?<?php endif; ?> </div> </div><!-- end .wrap --> </div><!-- end #mainNav --> <div id="crumbs"> <div class="wrap"> <p><?php if(function_exists('bcn_display')) { echo"You are here: "; bcn_display(); } ?></p> </div><!-- end .wrap --> </div> <div id="header"> <div class="wrap"> <div id="logo"><a>"><?php if ($proud_misc_logo_path) { ?><img src="<?php echo "$proud_misc_logo_path";?>" alt="<?php bloginfo('name'); ?>" /><?php } else { ?><img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" /><?php } ?></a></div> <div id="search"> <form method="get" action="<?php echo get_option('home'); ?>"> <input type="text" name="s" id="setop" onblur="if (this.value == '') {this.value = 'search';}" onfocus="if (this.value == 'search') {this.value = '';}" value="search" /> <input type="submit" id="searchsubmittop" class="submit" value="search" /> </form> </div><!-- end #search --> <?php include(TEMPLATEPATH . '/inc_social.php'); // calling social block ?> <div class="clear">?</div> </div><!-- end .wrap --> </div><!-- end #header -->
[Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin]
- The topic ‘Remove duplicate meta descriptions from header’ is closed to new replies.