WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Title not working on homepage but is working everywhere else (4 posts)

  1. rc1320
    Member
    Posted 2 years ago #

    For some reason the title is not being updated on the homepage only.

    website: http://drhappysmiles.com/

    As you can see the homepage lacks a page title although it is getting the Yoast-SEO meta description. All other pages and posts are working.

    Here is the header code:

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    
    <title><?php wp_title(''); ?></title>
    <link rel="shortcut icon" href="<?php echo get_bloginfo("template_url")  ?>/images/favicon.ico">
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    
    <script type="text/javascript">
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    </script>
    
    <?php
    	/* We add some JavaScript to pages with the comment form
    	 * to support sites with threaded comments (when in use).
    	 */
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    
    	/* Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
    	 */
    	wp_head();
    ?>
    <link rel="stylesheet" href="<?php echo get_bloginfo("template_url")  ?>/slider.css" type="text/css" media="screen" />
    
    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-18539623-1']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>
    
    </head>
    
    <body <?php body_class(); ?> onLoad="MM_preloadImages('<?php echo get_bloginfo("template_url")  ?>/images/navi_1hover.png','<?php echo get_bloginfo("template_url")  ?>/images/navi_2hover.png','<?php echo get_bloginfo("template_url")  ?>/images/navi_3hover.png','<?php echo get_bloginfo("template_url")  ?>/images/navi_4hover.png','<?php echo get_bloginfo("template_url")  ?>/images/navi_5hover.png','<?php echo get_bloginfo("template_url")  ?>/images/navi_6hover.png','<?php echo get_bloginfo("template_url")  ?>/images/readmore_bttn_hover.png','<?php echo get_bloginfo("template_url")  ?>/images/lastbutton.png','<?php echo get_bloginfo("template_url")  ?>/images/FACEBOOK HOVER.png','<?php echo get_bloginfo("template_url")  ?>/images/in hOVER.png','<?php echo get_bloginfo("template_url")  ?>/images/rss HOVER.png','<?php echo get_bloginfo("template_url")  ?>/images/TWITTER HOVER.png')">
    
    <!--wrapper-->
    <div id="wrapper">
    
    <!--header-->
    <div id="header">
    
    <div class="header_center">
    
    <div class="header_left">
    <a style="border:none;" href="<?php echo home_url( '/' ); ?>"><img style="border:none;" src="<?php echo get_bloginfo("template_url")  ?>/images/puyallup-dentist-logo.png" alt="Dr Happy Smiles Puyallup Dentist" width="450" height="104" /></a>
    </div>
    <div class="header_right">
    <div class="header_right_top" style="padding-left:280px;"> 
    
    <a target="_blank" href="http://www.facebook.com/drhappysmiles" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image25','','<?php echo get_bloginfo("template_url")  ?>/images/FACEBOOK HOVER.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/FACEBOOK NORMAL.png" alt="Read More" name="Image25" width="45" height="43" border="0" id="Image25" /></a>
    
    <a target="_blank" href="http://www.linkedin.com/in/kwalia" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image26','','<?php echo get_bloginfo("template_url")  ?>/images/in hOVER.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/in.png" alt="Read More" name="Image26" width="45" height="43" border="0" id="Image26" /></a>
    
    <a target="_blank" href="http://drhappysmiles.com/feed/" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image27','','<?php echo get_bloginfo("template_url")  ?>/images/rss HOVER.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/rss.png" alt="Read More" name="Image27" width="45" height="43" border="0" id="Image27" /></a>
    
    <a target="_blank" href="http://twitter.com/#!/drhappysmiles" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image28','','<?php echo get_bloginfo("template_url")  ?>/images/TWITTER HOVER.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/TWITTER NORMAL.png" alt="Read More" name="Image28" width="45" height="43" border="0" id="Image28" /></a>
    
    </div>
    <!--header_right_top-->
    <div class="header_right_bottom">
    <div style="font-size:40px;"><strong>253-845-3000</strong></div>
    <div style="margin-top:-10px"><a href="mailto:southhill@drhappysmiles.com">southhill@drhappysmiles.com</a></div></div>
    <!--header_right_bottom-->
    </div>
    </div>
    </div>
    <!--header-->
    <?php $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>
    <!--center content-->
    <div id="center_content">
    
    <div class="leaves_bg">
    <div class="contentarea_top">
    </div>
    
    <div class="contentarea">
    <div class="contenttop_bg">
    </div>
    <!--top-->
    <div class="contentcenter_bg">
    <div class="contentcenter_workarea">
    <div class="top_menu2">
    <div class="navigation_bg">
    <div class="navigation_center">
    
    <!--navigation_bttnz strt-->
      <div class="<?php if($url=='http://drhappysmiles.com/'){?>navi_bttn1_active<?php } else { ?>navi_bttn1<?php } ?>">
      <a href="<?php echo home_url( '/' ); ?>">&nbsp;</a>
      </div>
      <div class="<?php if($url=='http://drhappysmiles.com/our-dentists/'){?>navi_bttn2_active<?php } else { ?>navi_bttn2<?php } ?>">
      <a href="<?php echo get_permalink(11);?>">&nbsp;</a>
      </div>
      <div class="<?php  if($url=='http://drhappysmiles.com/our-services/'){?>navi_bttn3_active<?php } else { ?>navi_bttn3<?php } ?>">
      <a href="<?php echo get_permalink(19);?>">&nbsp;</a>
      </div>
      <div class="<?php  if($url=='http://drhappysmiles.com/our-blog/'){?>navi_bttn4_active<?php } else { ?>navi_bttn4<?php } ?>">
      <a href="<?php echo get_permalink(16);?>">&nbsp;</a>
      </div>
      <div class="<?php  if($url=='http://drhappysmiles.com/make-an-appointment/'){?>navi_bttn5_active<?php } else { ?>navi_bttn5<?php } ?>">
      <a href="<?php echo get_permalink(14);?>">&nbsp;</a>
      </div>
      <div class="<?php  if($url=='http://drhappysmiles.com/contact/'){?>navi_bttn6_active<?php } else { ?>navi_bttn6<?php } ?>">
      <a href="<?php echo get_permalink(4);?>">&nbsp;</a>
      </div>
    <!--navigation_bttnz end-->
    
    <?php /*?><!--bttn1-->
      <a href="<?php echo home_url( '/' ); ?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image14','','<?php echo get_bloginfo("template_url")  ?>/images/navi_1hover.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/navi_1.png" alt="Home" name="Image14" width="73" height="35" border="0" id="Image14" /></a>
      <!--bttn2-->
      <a href="<?php echo get_permalink(11);?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image15','','<?php echo get_bloginfo("template_url")  ?>/images/navi_2hover.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/navi_2.png" name="Image15" width="129" height="35" border="0" id="Image15" /></a>
    <!--bttn3-->
    <a href="<?php echo get_permalink(19);?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','<?php echo get_bloginfo("template_url")  ?>/images/navi_3hover.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/navi_3.png" name="Image16" width="128" height="35" border="0" id="Image16" /></a>
    <!--bttn4-->
    <a href="<?php echo get_permalink(16);?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image17','','<?php echo get_bloginfo("template_url")  ?>/images/navi_4hover.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/navi_4.png" alt="Our Blog" name="Image17" width="103" height="35" border="0" id="Image17" /></a>
    <!--bttn5-->
    <a href="<?php echo get_permalink(14);?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image18','','<?php echo get_bloginfo("template_url")  ?>/images/navi_5hover.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/navi_5.png" name="Image18" width="191" height="35" border="0" id="Image18" /></a>
    <!--bttn6-->
    <a href="<?php echo get_permalink(4);?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image19','','<?php echo get_bloginfo("template_url")  ?>/images/navi_6hover.png',1)"><img src="<?php echo get_bloginfo("template_url")  ?>/images/navi_6.png" alt="Contact Us" name="Image19" width="118" height="35" border="0" id="Image19" /></a><?php */?></div>
    
    </div>
    
    </div>
    <div class="slider2">
    <!--<img src="<?php echo get_bloginfo("template_url")  ?>/images/slider_img.png" width="1000" height="433" />
    -->
    <?php 
    
    if($url=='http://drhappysmiles.com/') { ?>
    <div id="slider" class="nivoSlider" style="height:275px;">
    
     <?php
    $id=31;
    $child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$id."    AND post_type = 'page' AND post_status = 'publish' ORDER BY menu_order", 'OBJECT');
    //print_r($child_pages)  ?>
    		<?php foreach($child_pages as $slider)
    			{
    			  $feat_image = wp_get_attachment_url( get_post_thumbnail_id($slider->ID) );
    			 ?>
    			<img src="<?php echo $feat_image;?>" alt="" />
            <?php } ?>
    
                    <!--<img src="<?php //echo get_bloginfo("template_url")  ?>/images/slider_img1.png" alt="" />
                    <img src="<?php //echo get_bloginfo("template_url")  ?>/images/slider_img2.png" alt="" />
                    <img src="<?php //echo get_bloginfo("template_url")  ?>/images/slider_img3.png" alt="" />
                    <img src="<?php //echo get_bloginfo("template_url")  ?>/images/slider_img4.png" alt=""/>
                    <img src="<?php //echo get_bloginfo("template_url")  ?>/images/slider_img5.png" alt=""/>
                    <img src="<?php //echo get_bloginfo("template_url")  ?>/images/slider_img6.png" alt=""/>-->
                </div>
    
     <script type="text/javascript" src="<?php echo get_bloginfo("template_url")  ?>/scripts/jquery-1.4.3.min.js"></script>
        <script type="text/javascript" src="<?php echo get_bloginfo("template_url")  ?>/scripts/jquery.nivo.slider.pack.js"></script>
        <script type="text/javascript">
        $(window).load(function() {
            $('#slider').nivoSlider();
        });
        </script>
    <?php }  ?>
    <?php if($url!="http://drhappysmiles.com/") { ?>
    <?php if(is_page(11)) { ?>
    	<img src="<?php echo get_bloginfo("template_url")  ?>/images/dentist_banner_img.jpg" alt="Our Dentists - Dr. Happy Smiles in Puyallup WA"/>
    <?php }  else if(is_page(19)) { ?>
    	<img src="<?php echo get_bloginfo("template_url")  ?>/images/puyallup-dentist-services.jpg" alt="Puyallup Dental Services"/>
    <?php }  else if(is_page(16)) { ?>
    	<img src="<?php echo get_bloginfo("template_url")  ?>/images/blog_banner_img.jpg" alt="Dr. Happy Smiles Blog"/>
    <?php }  else if(is_page(14)) { ?>
    	<img src="<?php echo get_bloginfo("template_url")  ?>/images/appointment_banner_img.jpg" alt="Book an Appointment"/>
    <?php }  else if(is_page(4)) { ?>
    	<img src="<?php echo get_bloginfo("template_url")  ?>/images/contact_banner_img.jpg" alt="Contact Us Today"/>
    <?php }
    else { ?>
    <img src="<?php echo get_bloginfo("template_url")  ?>/images/blog_banner_img.png" alt=""/>
    <?php } ?>
    <?php } ?>
    </div>
    <!--slider-->

    Here is the top portion of the template used on the homepage: https://skitch.com/dotcar/gwcen/happyhome

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. mcdonna
    Member
    Posted 2 years ago #

    I had the same problem after updating to WP 3.3 and WP SEO 1.1.2. The home page title suddenly reverted to the page URL.

    I was able to fix it by editing the home page itself. The snippet preview showed the correct title, based on the title template, but it wasn't being displayed. So I entered the same title into the "SEO Title" field. You can also accomplish the same thing by clicking on the Generate SEO Title button.

    Updated the page and it works again.

  3. rc1320
    Member
    Posted 2 years ago #

    Unfortunately your issue doesn't sound all that similar to mine. I played around with it for probably 5 hours and finally found a hack of a solution. For me I had to go back to the "stock" twenty ten title call in the header and hack away from there. For what ever reason if I put the simple header call that the plugin tells you to use it would not work.

  4. mcdonna
    Member
    Posted 2 years ago #

    ouch! sorry to hear that ... very frustrating

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic