How can I insert Breadcrumbs, Sharing Buttons & Ratings in my theme?

Visible breadcrumbs (navigation paths) and social sharing buttons are important for your visitors, to navigate and share easier your website. And usability is a very important factor for your WordPress SEO.

Breadcrumbs

Either you paste our breadcrumb widget in one of the sections, your theme offers, like the header- or footer-area. Or you use our WordPress- or PHP-shortcode to paste it directly in your header.php- or footer.php-file (the file names depend on your theme), The WP shortcode [dpc_breadcrumbs] is for usage within your WordPress editor. The following PHP code is for direct usage in the php files of your theme:

<?php echo function_exists('dpc_breadcrumbs') ? dpc_breadcrumbs() : ''; ?>

If you don’t feel comfortable ask the theme developer, a php expert or us.

Sharing Buttons

The same is for the social sharing buttons. The WP shortcode [dpc_sharing] is for usage within your WordPress editor. The following PHP code is for direct usage in the php files of your theme:

<?php echo function_exists('dpc_sharing') ? dpc_sharing() : ''; ?>

Often, sharing buttons are inserted besides the posts titles. Also this files can vary depend on your theme, but often they are called:

  • loop.php – for posts in blog views
  • single.php – for single post views

The best way to find the perfect position is try and error. We recommend you to paste the code after your headline 1 or 2 (after the </h1>- and </h2> code). You may also post your code after your contents or anywhere else in your website.

Sample

If you want the sharing buttons being displayed after the content of a blog post, the code should look something like this:

<?php get_the_content() ?> 

Star Ratings

You can also show the reached star ratings by widget, WordPress or PHP shortcode. The data for the ratings can be added manually by the rating button, which you can activate for your editor. Else you can combine WordPress comments with our rating system, which is recommended at least for bloggers and online shop owners (it also makes sense for service providers). Within the WordPress editor you can position rating stars best with this WP shortcode:[dpc_rating]. In PHP files you should use the following PHP code:

<?php echo function_exists('dpc_rating') ? dpc_rating() : ''; ?>

Back to the WordPress SEO Plugin Tutorial.