djelder
Member
Posted 2 months ago #
I am running a site on http://www.buseyzone.com and I think I broke the code somehow and now sure where? If you look at this page, its re-posting stuff from the description at the top of the page and I'm not sure why? Any thoughts or things to guide me to what I broke? Thanks!
http://www.buseyzone.com/love-intimacy-part-two/
You meta description is broken. You shouldn't put HTML in there, but essentially the cause of your problem is the " character in that HTML that you haven't escaped, i.e. \".
Bottom line, check your header.php
djelder
Member
Posted 2 months ago #
Here's the code from header.php I couldn't figure out where the broken code was in there. Let me know if you have any ideas and thank you.
<?php
/**
* @package VideoFlick
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<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; ?>
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> ยป Blog Archive <?php } ?> <?php wp_title(); ?></title>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style<?php echo get_option('videoflick_site_style')=='light' ? '-light' : ''; ?>.css" 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'); ?>" />
<link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />
<script src="<?php bloginfo('template_url'); ?>/scripts/jquery.min.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/scripts/jquery.fade.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/scripts/jquery.superfish.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/scripts/jquery.hoverintent.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function(){
jQuery('ul.sf-menu').superfish();
});
</script>
<?php wp_head(); ?>
</head>
<body>
<div id="wrapper">
<div id="headwrap">
<div id="tagline">
<p><?php echo '' . get_bloginfo ('description'); ?></p>
</div>
<div id="menu">
<ul class="sf-menu">
<li <?php if (is_home()) { echo 'class="current_page_item"'; } ?>><a>/" title="Home">Home</a>
<li><a href="#" title="Categories">Categories</a>
<ul>
<?php wp_list_categories('title_li='); ?>
</ul>
</li>
<?php wp_list_pages('title_li='); ?>
<li><a>" title="Subscribe">Subscribe</a></li>
<?php wp_register('
<li>','</li>
'); ?>
</div> <!-- menu -->
<?php if ( !get_option('videoflick_logo_txt') ) : ?>
<!-- if standard logo -->
<div id="logo">
<a>/" title="Home" ><img src="<?php echo ($custom_logo = get_option('videoflick_logo_img'))!='' ? $custom_logo : get_bloginfo('template_url') . "/images/logo.png"; ?>" alt="<?php bloginfo('name'); ?>" /></a>
</div>
<?php else : ?>
<!-- if text logo -->
<div id="textlogo">
<h1><a>/" title="Home" ><?php bloginfo('name'); ?></a></h1>
</div>
<?php endif; ?>
<?php if ( ($header_ad = get_option('videoflick_header_ad')) != "" ) : ?>
<div id="topad">
<?php echo $header_ad; ?>
</div>
<?php endif; ?>
</div> <!-- headwrap -->
I bet the_excerpt_rss(); is causing the problem in
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
Probably some character in the feed.
djelder
Member
Posted 2 months ago #
Should I remove that line? Or change it or another line of code to something else?
Thanks Andrei!
You can change the_excerpt_rss(); to bloginfo('description'); until you figure out what's wrong with it.
Delete the line. You already have a <meta name="description" line a little further down.
djelder
Member
Posted 2 months ago #
Thank you, that solved the problem! Appreciate the help.
That meta line bellow is only going to be added to HTML if the page is a homepage (see elseif(is_home()) on the line above). So, I don't think it's a good idea to just remove the first meta line.
What he could do is replace
<?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; ?>
with just
<meta name="description" content="<?php bloginfo('description'); ?>" />