Skip to main content

Create custom Breadcrumbs in WORDPRESS


Create custom Breadcrumbs in WORDPRESS



open your single.php and paste this code


<?php
$cats = get_the_category();
$cat_name = $cats[0]->slug;
if($cat_name=="blog")
{
?>
 <h5><a href="<?php echo site_url(); ?>">home</a>/<a href="<?php echo site_url(); ?>/blog">blog</a>/<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
<?php } elseif($cat_name=="pressrelease") { ?>
<h5><a href="<?php echo site_url(); ?>">home</a>/<a href="<?php echo site_url(); ?>/press-release/">Press Release</a>/<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
<?php } ?>


*How to create custom breadcrumbs in wordpress
*How to add navigation on custom page in wordpress
*How to add Navigation menu to blog in wordpress

Comments

Post a Comment