Custom Search

How to add breadcrumb in Wordpress theme Mystique 3.1

Publicat de Mr. Miaghy on 10:28


In our earlier article, we showed a way for users to Display Commenter’s Information in Mystique 3.0. In this article, we will share with you a way by which you can add Breadcrumbs to Mystique Theme. We recommend you to add Breadcrumb to your Mystique Theme. It is a very good addition to the design because of usability and it also provides SEO benefits because it links to the path hence increasing bot activity in page indexing. Breadcrumbs provide a way to easily navigate through site, from post, to category, to the next post, or from child page, to parent page etc.
How to add Breadcrumb in WordPress Theme   Mystique 3.1
First you need to download the Breadcrumb plugin and activate it.
Note: Activate Mystique Child Theme (Mystique-Extend), and copy single.php from parent Mystique Theme folder to child Mystique Theme folder.
Under WordPress Dashboard -> Appearance -> Editor. Open Single.php
Search for
1
2
3
<?php $app->action('before_post'); ?>
 
            <!-- post -->
then add following code after above lines:
1
2
3
4
5
<div class="post-links clear-block" style="font-size: 14px; line-height: 18px;">
        <?php if ( function_exists('yoast_breadcrumb') ) {
           yoast_breadcrumb('<p id="breadcrumbs">','</p>');
        } ?>
</div>
After adding above code you will see Breadcrumb on your post, if you want to display it on other pages then follow same way, or ask me in comments.
One more thing, previous and next post link are useful when links are after the post instead of above post title, so look for code
1
2
3
4
5
6
<?php if($app->options('single_links')): ?>
            <div class="post-links clear-block">
              <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
              <div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
            </div>
<?php endif; ?>
Cut the code and paste after following line:
1
<?php $app->action('after_primary'); ?>
If you want to modify appearance of previous and next post link then read this post: How to Modify Mystique 3.0 WordPress Theme.
You should share this with your friends.

0 comentarii:

Trimiteți un comentariu

Custom Search