Support » Plugin: Page Meta » Trouble getting Meta Descriptions Working

  • Resolved unconsultancy


    I have edited my header.php as shown below and the Meta Title appears to be working but can someone please let me know the correct code to get the Meta Description working properly?



    <title><?php if (function_exists('meta_title')) { meta_title(); } else { wp_title(); } ?></title>
    <meta name="description" content="<?php bloginfo('description'); ?>" />

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Steve



    I can’t remember which version it was, but I modified the plugin to hook into the the wp_title() call, so if you’re using this function call in your theme it should ‘just work’:

    <title><?php wp_title(); ?></title>

    The meta description and keywords fields are output automatically by hooking into the wp_head() function call, which should be called just before your closing head tag:

    <?php wp_head(); ?>

    – Steve

    I have a problem with the page titles: option is activated for posts and pages…

    but it doesn’t appear in my theme… When I change the theme, it’s working…

    Then here is a copy of my header.php can you tell me what’s wrong inside for your plugin please? Thanks !

    /* 	DISCUSSION Theme's Header
    	Copyright: 2012, D5 Creation,
    	Based on the Simplest D5 Framework for WordPress
    	Since DISCUSSION 1.0
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width" />
    <title><?php wp_title() ?></title>
    <link rel="profile" href="" />
    <?php wp_enqueue_style('discussion-style', get_stylesheet_uri(), false, '1.2.01');?>
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    wp_head(); ?>
    <body <?php body_class(); ?> >
      <div id="container">
    	  <div id ="header">
          <h2 ?></h2>
          <div id ="header-content">
    		</div><!-- header-content -->
          <!-- Site Main Menu Goes Here -->
            <nav id="discussion-main-menu">
    		<?php if ( has_nav_menu( 'main-menu' ) ) : wp_nav_menu( array('menu' => 'Main Menu' )); else : ?>
              <?php wp_page_menu(); ?>
            <?php endif; ?>
            <div id="thambslide">
      		$thumbnails = get_posts('numberposts=20');
      		foreach ($thumbnails as $thumbnail) {
        	if ( has_post_thumbnail($thumbnail->ID)) {
          	echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
          	echo '<li>' . get_the_post_thumbnail($thumbnail->ID, 'thumbnail'). '</li>';
          	echo '</a>';
        	} }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trouble getting Meta Descriptions Working’ is closed to new replies.