Jump to content


Photo

how to add breadcrumbs code to template


  • Please log in to reply
10 replies to this topic

#1 szool

szool

    Advocate

  • Members
  • PipPipPipPipPip
  • 279 posts

Posted 31 July 2011 - 03:35 AM

I am trying to install and configure the Yoast SEO plugin, breadcrumb feature. It says to install a snippet of code to my "theme's template". What file exactly do I need to add the code to? http://yoast.com/wor...ss/breadcrumbs/ My site link is www.citizenmediagroup.com Thanks!!

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 31 July 2011 - 04:15 PM

You need to add the code to the template where you want the breadcrumb navigation to show up (i.e. if you want it to show up in the header, add it to header.php)

#3 szool

szool

    Advocate

  • Members
  • PipPipPipPipPip
  • 279 posts

Posted 31 July 2011 - 04:35 PM

I want it to show up right underneath the navigation menu.....

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 31 July 2011 - 06:03 PM

On all pages or just the main blog page?

#5 szool

szool

    Advocate

  • Members
  • PipPipPipPipPip
  • 279 posts

Posted 31 July 2011 - 08:23 PM

on all pages.

#6 szool

szool

    Advocate

  • Members
  • PipPipPipPipPip
  • 279 posts

Posted 31 July 2011 - 09:07 PM

Actually.... I would like them to show up on all pages except the home page if possible... there really is no need for breadcrumbs on the home page.

#7 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 01 August 2011 - 03:53 PM

Did you try adding it to the header.php file yet?

#8 szool

szool

    Advocate

  • Members
  • PipPipPipPipPip
  • 279 posts

Posted 02 August 2011 - 01:23 AM

I did and it ended up between the main nav and the subnav. How would I get it under the subnav?

#9 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 02 August 2011 - 02:38 AM

Where in the header.php file did you paste it? Can you add your header code here and add [ code ] preceding it and [ /code ] after it (without the spaces)?

#10 szool

szool

    Advocate

  • Members
  • PipPipPipPipPip
  • 279 posts

Posted 03 August 2011 - 02:51 AM

the breadcrumb code is at the very bottom of the header:


 
	<?php
		do_action('pagelines_before_html');
		global $pagelines_ID;
	?>
	<!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'); ?>" />
	
	<!-- Meta Images -->
		<?php if(pagelines('favicon')):?><link rel="shortcut icon" href="<?php echo pagelines('favicon');?>" type="image/x-icon" /><?php endif;?>
		<?php if(pagelines('touchicon')):?><link rel="apple-touch-icon" href="<?php echo pagelines('touchicon');?>" /><?php endif;?>
	
	<!-- Title and External Script Integration -->
		<?php
			global $bbpress_forum;
			if($bbpress_forum ):?>
				<title><?php bb_title() ?></title>
				<?php bb_feed_head(); ?>
				<?php bb_head(); ?>
				<link rel="stylesheet" href="<?php bb_stylesheet_uri(); ?>" type="text/css" />
		<?php else:?>
			<title><?php if(is_front_page()) { echo SITENAME; } else { wp_title(''); } ?></title>
		<?php endif;?>
	
	
	<!-- Wordpress Stuff -->
		<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
		<?php if ( is_single() || is_page()) wp_enqueue_script( 'comment-reply' ); ?> <!-- This makes the comment box appear where the ???reply to this comment??™ link is -->
		<?php  wp_enqueue_script("jquery"); ?>
	
	<!-- Stylesheets -->
		<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
		<?php get_template_part ('library/dynamic_css'); ?>
	
		<!-- Modules w/ Javascript -->
		<?php if((is_page_template('page-carousel.php') || is_page_template('page-carousel-full.php')) && VPRO) get_template_part ('core/inits/init_carousel');?>
	
		<?php if((is_page_template('page-feature.php') || is_page_template('page-feature-page.php') || (is_home() && pagelines('featureblog'))) && VPRO) get_template_part ('core/inits/init_feature');?>
	
		<?php if(pagelines('enable_drop_down') && VPRO) get_template_part ('core/inits/init_dropdown');?>
	
	<?php get_template_part ('library/_ie_fixes'); ?>
	
	<!-- Font Replacement -->
	  	<?php if(VPRO) get_template_part('library/_font_replacement');?>
		<?php if (pagelines('headerscripts')) echo pagelines('headerscripts');?>
	
		<?php wp_head(); ?>
	
	</head>
	<body <?php body_class(); ?>>
		<?php if (pagelines('asynch_analytics')) echo pagelines('asynch_analytics');?>
		<div id="site" class="<?php e_pagelines('colorscheme', 'greybg', $post->ID);?>">
			<div id="wrapper">
	
					<div id="hcontain" class="content fix">
						<div id="header" class="fix">
							<div class="headline">
								<?php if(pagelines('custom_header')):?>
									<a class="home" href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name');?>"><img src="<?php echo pagelines('custom_header');?>" alt="<?php bloginfo('name');?>" /></a>
								<?php else:?>
								<h1 class="site-title"><a class="home" href="<?php echo get_option('home'); ?>/" title="<?php _e('Home',TDOMAIN);?>"><?php bloginfo('name');?></a></h1>
								<h6 class="site-description"><?php bloginfo('description');?></h6>
								<?php endif;?>
							</div>
							<div class="icons">
	
								<?php if(pagelines('rsslink')):?>
								<a target="_blank" href="<?php echo RSSURL;?>" class="rsslink"></a>
								<?php endif;?>
	
								<?php if(VPRO):?>
									<?php if(pagelines('twitterlink')):?>
									<a target="_blank" href="<?php echo pagelines('twitterlink');?>" class="twitterlink"></a>
									<?php endif;?>
									<?php if(pagelines('facebooklink')):?>
									<a target="_blank" href="<?php echo pagelines('facebooklink');?>" class="facebooklink"></a>
									<?php endif;?>
									<?php if(pagelines('linkedinlink')):?>
									<a target="_blank" href="<?php echo pagelines('linkedinlink');?>" class="linkedinlink"></a>
									<?php endif;?>
									<?php if(pagelines('youtubelink')):?>
									<a target="_blank" href="<?php echo pagelines('youtubelink');?>" class="youtubelink"></a>
									<?php endif;?>
									<?php if(pagelines('myspacelink')):?>
									<a target="_blank" href="<?php echo pagelines('myspacelink');?>" class="myspace"></a>
									<?php endif;?>
								<?php endif;?>
	
							</div>
						</div>
					</div>
	
					<div class="container fix <?php if(pagelines('sidebar_layout', $post->ID) == 'left') echo 'sidebar_left';?>">
						<div class="content">
							<div class="navcontainer">
								<div class="hl"></div>
								<div id="nav" class=" fix">
									<?php function nav_fallback(){?>
										<ul class="<?php if(pagelines('enable_drop_down')):?><?php echo 'dropdown';?><?php endif;?>">
											<?php wp_list_pages('sort_column=menu_order&depth=3&title_li='); ?>
										</ul>
									<?php	}
	
								 	if(function_exists( 'wp_nav_menu')):?>
										<?php wp_nav_menu( array('theme_location'=>'primary', 'menu_class'  => 'mnav dropdown fix', 'container' => null, 'container_class' => '', 'depth' => 3, 'fallback_cb'=>'nav_fallback' ) ); ?>
									<?php else:?>
										<?php nav_fallback();?>
									<?php endif;?>
	
									<?php if(!pagelines('hidesearch')):?>
										<?php get_template_part ( 'library/_searchform'); ?>
									<?php else:?>
										<style type="text/css">#nav ul, #nav .mnav{width:940px;}</style>
									<?php endif;?>
	
	
								</div><!-- /nav -->
	<?php if ( function_exists('yoast_breadcrumb') ) {
		yoast_breadcrumb('<p id="breadcrumbs">','</p>');
	} ?>
							</div>
						</div>
						<div class="clear"></div>


#11 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 08 August 2011 - 11:19 PM

You could put it at the bottom of _subnav.php