function breadcrumbs() { // Code if(!is_home()) { $output = '<nav class="breadcrumbs">'; $output .= '<a href="'.home_url('/').'">Home</a> <span class="divider">/</span> '; if (is_category() || is_single()) { $output .= '<a href="'.home_url('/insights/').'">Insights</a>'; if (is_single()) { $output .= ' <span class="divider">/</span> '; $output .= get_the_title(); } } elseif (is_page()) { $output .= get_the_title(); } $output .= '</nav>'; } return $output; } add_shortcode( 'breadcrumbs', 'breadcrumbs' );
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter