Now go to “appearance” “editor” and open the “style sheet” file (style.css). And paste this code almost to the very bottom and update the file.
.breadcrumb (
font:bolder 12px “Trebuchet MS”, Verdana, Arial;
padding-bottom: 10px;
}
.breadcrumb a(
color: #1B7499;
}
.breadcrumb a:hover (
color: #EF0E0E;
}
Before moving directly to the review of modules, I’ll say a few words about how and why this solution is applied:
- Firstly, it is useful from a usability point of view - navigation will orient people on the site and clarify its structure.
- Secondly, this feature also works for optimization, because is essentially another option, and also increases the number of clicks and dwell time (+ may appear in the results).
However, such functionality is effective in every web project. If you have a simple 10-20 page business card with no nested hierarchy, then there is no point in adding breadcrumbs to WP. The element will provide absolutely no benefit, but will only take up free space on the screen. In the case of corporate portals with multi-level categories/sections, it’s a completely different matter. Plus it looks great too.
Theoretically, this block may not be displayed on all pages. For example, you have a blog, which initially provides several traditional paths through the site: tags and categories, archives of dates, authors, as well as specific posts. I would leave navigation in sections and notes, while in labels and dates the value of such information is minimal, because it simply duplicates the title. If the installed WordPress breadcrumb plugins do not allow you to do this directly, use . In addition, it is advisable to design the element as unobtrusively as possible through layout and styles.
![](https://i1.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread2.jpg)
It’s stupid when immediately under the chain “Home” - “Category” - “Post Title” you see the same title + an indication of the current category. By the way, such a display of categories is often found in standard WP templates, so after integrating the appropriate solution, it is advisable to correct this nuance.
Plugins and Breadcrumbs in WordPress
Modules for this task can be easily found by the English name of the Breadcrumbs function - in the WordPress repository or through search engines. There are plenty of different implementation options, but most of them have not been updated for several years.
![](https://i2.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread3-560x380.jpg)
Perhaps the authors are tired of competing with the permanent leaders Breadcrumb NavXT with 600 thousand. downloads and SEO by Yoast. In addition, it is quite difficult to come up with something extra original in this matter, because it is as simple as possible and you can even implement breadcrumbs in WordPress without a plugin. Be that as it may, I have selected 4 of the most interesting solutions:
![](https://i0.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread41-560x250.jpg)
The main task of the module, in principle, has nothing to do with our topic today, but it cannot be ignored. One of the additional features of the Yoast SEO plugin is breadcrumbs. That is, you do not have to install a new module, but simply activate the appropriate option. In my work I use this option.
![](https://i1.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread42-560x250.jpg)
is the most popular breadcrumb plugin in WordPress with over 600 thousand downloads. Updated regularly and contains many features to easily customize your navigation display. It also includes a built-in widget, support for bbPress, BuddyPress, localization, the ability for developers to use filters/hooks, and much more.
Breadcrumb
![](https://i1.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread43-560x250.jpg)
In principle, it is difficult to find solutions that would be more interesting than the previous two, although there are good attempts. For example, the Breadcrumb module for WordPress has support for shortcodes, plus the chain of links itself has an original design (see the Live Demo link!). It is not clear whether the designs are supported in the free version. You can also customize the separator type and add text at the beginning of the element. According to the developers, the script is as simple and lightweight as possible.
![](https://i1.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread44-560x250.jpg)
Another option that has, plus or minus, a decent number of downloads, despite the fact that it was updated about a year ago. The authors promise flexible customization of breadcrumbs in WordPress: built-in hooks, display options and style support (there is a CSS Sample in the description). The module seemed like a pretty good and simple solution with good grades.
Breadcrumbs in Yoast SEO
I will not describe in detail all the intricacies of the work, you can read about it in, I will focus exclusively on creating an element with crumbs. The integration process consists of two parts - installation in the admin panel + editing the template.
After activation, a whole new SEO section will appear where you need to select the “Advanced” option. Next, move the switch in the item with the strange name “Enable Crumb” to the “On” position:
![](https://i0.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread51-560x489.jpg)
In principle, there are not so many different options here. You define the separator symbol, home title, prefix, text for archives and 404 pages. Just below, select the taxonomy option displayed in the post (category is the most logical).
Then go to the template file where you are going to display the navigation block and add the lines:
The most popular places to insert code are in posts (single.php) and pages (page.php) before displaying the header. Sometimes it can be placed at the end of the header layout (header.php). The code above has a conditional statement and checks for the presence of the plugin, and then displays the result. With this design, you can easily disable breadcrumbs in the settings. By the way, this code was added initially to many professional themes, because The module is very popular.
Another advantage of Yoast SEO is that breadcrumbs can be set in additional parameters of blog posts:
![](https://i0.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread52-560x377.jpg)
That is, you have a chance to manually determine any WP post header value through the admin panel. This is useful for long article titles + allows you to get rid of duplicate information.
Breadcrumb NavXT Plugin for WordPress
Also, when creating breadcrumbs for WordPress, the Breadcrumb NavXT planin is used. The module has good functionality, which I partially mentioned above, plus it contains many interesting options. Almost every user can understand it and easily change the necessary settings of the navigation element.
Via the admin panel or download from the official repository. Important! For Breadcrumb NavXT version 5.2 you will need PHP5.3, earlier releases require PHP5.2. Then you activate it, and the corresponding section will appear in WP.
![](https://i0.wp.com/wordpressinside.ru/wp-content/uploads/wordpressinside/newbread61-560x477.jpg)
There are 4 parameter tabs here:
- In “Basic” you can select the type of separator, remove the link to the main page and configure the display of the current page. The string format is specified through templates.
- “Posts” - contains options for posts.
- “Taxonomies” - are responsible for tags/categories.
- “Other” - formats of author pages, archives, 404 errors.
I advise you to go through each tab and look at all the features. The display format allows you to make any changes to this navigation - add your own text/symbols, change styles, etc.
After specifying the Breadcrumbs parameters in the WordPress plugin, you need to set the output of information in the template - open the corresponding layout file (usually header.php) and place the lines in the right place:
Similar to working with Yoast SEO, the choice of where to place the code depends on the installed theme. If you intend to display a block in the header, then use header.php. Considering that this file is common to all pages of the layout, you will see a chain of links on each of them. You can also show an element only in selected sections - in this case, paste the code into single.php, page.php, archive.php, etc. Overall, Breadcrumb NavXT is a good tool.
Breadcrumbs in WordPress without a plugin
It is possible to implement the Breadcrumbs function in WordPress without plugins. However, before moving on to describing the different options, I will express my subjective opinion on why this is not the best idea:
- Integration will certainly be challenging for novice users.
- Editing parameters directly in the code is not particularly clear - setting display templates through the admin panel is much more convenient than editing directly.
- Modules have more features - take at least localization, Schema.org support, widgets.
- Not all codes found on the web are current, correct and regularly updated, while at least Yoast SEO and Breadcrumb NavXT in WordPress work stably.
To be honest, I don’t think that creating breadcrumbs in WordPress without a plugin will give you a serious performance boost. Yes, if you are a cool web developer, creating a project for yourself, then you can get by with “clean code”; in all other cases, a ready-made module is much simpler.
One of the most compact and plus or minus current solutions. The first thing you do is add a new custom function get_breadcrumb() to your functions.php file:
/** * Generate breadcrumbs * @author CodexWorld * @authorURL www.codexworld.com */ function get_breadcrumb() ( echo "Home" ; if (is_category() || is_single() ) ( echo " » " ; the_category(" . " ) ; if (is_single() ) ( echo " » " ; the_title() ; ) ) elseif (is_page() ) ( echo " » " ; echo the_title() ; ) elseif (is_search() ) ( echo " » Search Results for... " ; echo "" " ; echo the_search_query() ; echo """
;
}
}
|
/** * Generate breadcrumbs * @author CodexWorld * @authorURL www.codexworld.com */ function get_breadcrumb() ( echo "Home"; if (is_category() || is_single()) ( echo " " "; the_category(" . "); if (is_single()) ( echo " » "; the_title(); ) ) elseif (is_page()) ( echo " » "; echo the_title(); ) elseif (is_search()) ( echo " » Search Results for... "; echo "" "; echo the_search_query(); echo """;
}
}
Then, in the post display layout single.php or any other, call it:
breadcrumb ( padding : 8px 15px ; margin-bottom : 20px ; list-style : none ; background-color : #f5f5f5 ; border-radius : 4px ; ) .breadcrumb a ( color : #428bca ; text-decoration : none ; ) |
breadcrumb ( padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; ) .breadcrumb a ( color: #428bca; text-decoration: none; )
As a result you will get something like:
If this is enough for you, then why not. I can also recommend the option from Dimox, which tried to take into account all the shortcomings of existing snippets. There is much more source code there, it is quite possible to create a full-fledged module from it :)
How to Remove Breadcrumbs in WordPress
In principle, this task is the reverse of the process of installing an element. Therefore, before disabling it, you need to understand exactly how everything is implemented in your specific case. The algorithm is approximately the following:
- Let's see if there is a breadcrumb plugin for a WordPress site. If yes, then try to hide the display of the chain of links in the settings and/or deactivate it.
- If the developer performed the integration correctly, then deleting the module will not lead to errors. Otherwise, we look for the navigation output code in the template files (WinGrep can help). These could be, for example, the functions yoast_breadcrumb(), bcn_display(), bread_crumb(), etc. Getting rid of extra lines.
- Let's check the display of the project pages in the browser again.
In principle, disabling or removing breadcrumbs in WordPress is not so difficult, the main thing is to understand how they were added. Edit the code carefully so as not to delete anything important (you can comment out the lines first).
Total. In the article, I discussed in detail how to make breadcrumbs in WordPress; the information on setting it up should be enough for you. Before installation, I advise you to think about whether you really need this unit. As for implementation, I personally don’t see the point of implementing a site path element in WordPress without a plugin, given that your web project will probably have Yoast SEO. As for other modules, they are useful only in the case of some original functionality. Breadcrumb NavXT seems pretty good, but I'm all for Yoast's solution.
If you have any questions about working with Breadcrumbs breadcrumbs and WordPress plugins for them, write below, and we’ll sort it out.
P.S. Guard. Nowadays, it is necessary to use modern pipeline systems - gas pipes presented by the Eurotrubplast Trade House meet all quality standards.
Hi all!. Today in this article I would like to tell you how you can improve the usability of your website using the Yoast SEO plugin, which I will talk about in detail in one of my next articles.
Surely many have already heard about this plugin and know that it is necessary for writing SEO-optimized articles. But few people realize what else WordPress Yoast SEO breadcrumbs can do.
First, let me explain what “breadcrumbs” are and why they are needed.
So, “Breadcrumbs” are additional page-by-page navigation that displays in which category or section the article is located. A visitor, having gone to some page of your blog, must understand which section he is in and whether he is looking for the information he needs in the right category. This navigation can be summarized as follows:
![](https://i1.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/zamena-kartinki.jpg)
On our website it looks like this:
![](https://i2.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/hlebnyie-kroshki-nash-sayt.jpg)
In addition, the presence of this navigation helps robots more clearly understand the site structure and index your blog faster. And this is very important for online projects.
"Why?" - you ask, we decided to use this plugin. The answer here will be simple. There are a large number of similar services on the Internet that will help with the withdrawal of “crumbs”, but at the same time they will additionally load the site, which certainly will not make it any better. And since we still use Yoast SEO to optimize posts, it would be a sin not to take advantage of its capabilities and not make convenient usability with its help.
Setting up breadcrumb output with the Yoast SEO plugin
I won’t write here how to install this Yoast SEO. If you don’t know how to do this, then read this article of mine “”. In it I tell in detail and show in what ways you can install the necessary plugins for work.
![](https://i1.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/Nastroyki-plagina-SEO.jpg)
In the window that opens, check the “Enable breadcrumbs” checkbox.
![](https://i2.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/Vklyuchenie-navigatsii.jpg)
To our joy, the settings will open all in Russian, and they are intuitive. In the video that will appear in this article soon, I will show more clearly what will happen when you change some items in this menu. In the meantime, you can easily experiment and try changing the settings yourself. It’s impossible to do anything terrible here, since these are just visual adjustments to our “crumbs”.
After enabling the breadcrumbs, the next step is to insert the activation code for this feature into your theme template. To find out what code needs to be inserted, follow the link that comes after the settings of our chain.
![](https://i0.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/Perehod-po-ssyilke.jpg)
After we get to the official website of this plugin, we copy the required code and paste it into the place in our theme where we plan for them to be displayed.
![](https://i1.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/Kod-dlya-vstavki-v-shablon.jpg)
I cannot recommend a universal place to insert this code, since it depends on the theme you are using. You may need to write it either in the file single.php, or in page.php, and in some cases in header.php.
In our case, we inserted the code almost at the very beginning of the single.php file, which is located at www/wp-content/themes/your theme/.
Note: Please note that it is better to insert the code through an FTP client. We use Filezilla, the work of which has been written about in detail. Be sure to read our instructions to avoid many beginner mistakes.
Moreover, please also note that the code we have is slightly different from the one recommended to us by the developers. Namely, we wrapped the breadcrumbs function in a div tag. This is done so that you can set your own individual display style.
To do this, in the style.css file we write the styles that we require. In them we can set the color, background, font size, underlining, that is, lead to a look that would completely suit our taste or be combined with the overall style of the page. In our case it looks like this:
At this point, setting up the plugin is almost complete, but in this version, after the headings are displayed, the title of the article will also be displayed. This may lead to over-spamming. I think you will agree with me that this is unnecessary, since the title of the article is already clearly visible to the user and there is no need to duplicate it again.
![](https://i1.wp.com/blog-bridge.ru/wp-content/uploads/2015/12/obrazets-perespamlennosti.jpg)
To avoid this, you need to additionally insert a small code into the functions.php file.
Function adjust_single_breadcrumb($link_output) ( if(strpos($link_output, "breadcrumb_last") !== false) ( $link_output = ""; ) return $link_output; ) add_filter("wpseo_breadcrumb_single_link", "adjust_single_breadcrumb");
Now all our settings are completed. If you did everything correctly, then you will get something similar to what you see on our blog.
If you have any questions, write in the comments!
Bye-bye everyone!
Anton Kalmykov was with you
Breadcrumbs are a multi-level navigation system that tells users where on the site they are currently located in relation to the main page. In this article we will show you how to display WordPress breadcrumbs:
What are breadcrumbs and what are they for?
Breadcrumbs is a term used to describe a hierarchical navigation menu presented as a chain of links. It is often used as an additional navigation menu.
Breadcrumbs are different from the default WordPress navigation menu system.
The purpose of breadcrumbs is to help users navigate the site. They help to understand where the user is now. It also helps search engines determine the hierarchy of links to web pages.
Search engines such as Google have begun to display site breadcrumbs in search results. This increases the site's visibility in search results and improves conversion rates:
![](https://i2.wp.com/internet-technologies.ru/wp-content/uploads/articles/201602/breadcrumbs-seo-261125.png)
Adding breadcrumbs using Breadcrumb NavXT Plugin
This is a flexible and easy to use WordPress breadcrumb plugin. It has more diverse features than you can imagine. The first thing you need to do is install and activate the Breadcrumb NavXT plugin. After activating it, you need to go to the plugin settings page: Settings - Breadcrumb NavXT:
![](https://i2.wp.com/internet-technologies.ru/wp-content/uploads/articles/201602/breadcrumbnavxt-settings-261126.png)
For most sites, the default settings will be fine. But if necessary, you can make changes to the settings.
The settings page is divided into several sections. On the General tab, you can define how the plugin will behave on the site.
Here you can change the link template. These templates use Schema.org parameters in the link tag.
In the “Post types” section, you can set “breadcrumbs” for posts, pages, and any custom post types. You can choose to display the record hierarchy. By default the plugin will use the hierarchy " Site title > Category > Post title».
You can replace navigation elements with tags, dates, or post parents. The Taxonomies and Authors tabs have similar templates for menu links. Don't forget to click on the " Save changes».
Displaying Breadcrumb NavXT on your site
To use this WordPress breadcrumbs plugin, you must edit the theme files. You need to add the following code to the theme's header.php file in the place where the breadcrumbs will be displayed:
Go to the site and open a post or page. You will see that you already have breadcrumbs displayed.
Adding Breadcrumbs with Yoast SEO Plugin
Install and activate Yoast SEO Plugin. After activating the plugin you need to go to the page SEO > Advanced and check the box for the option " Enable breadcrumbs»:
![](https://i2.wp.com/internet-technologies.ru/wp-content/uploads/articles/201602/yoastbreadcrumb-1-261131.png)
After this, several options will become available with which you can change the display option for breadcrumbs. The default settings should be fine for most sites, but can be easily changed if necessary.
Once you are finished, click on the " Save changes».
Generating Breadcrumbs Using the Yoast SEO Plugin
Some themes already support Yoast breadcrumbs. Go to the site and open any page or post to see if it displays WordPress breadcrumbs. If not, then you need to add a small piece of code to the active theme.
Paste this code into your theme's header.php at the end of the file:
That's all, now you can go to your website, breadcrumbs will already be displayed there.
We hope this article helped you.
Translation of the article " How to Display Breadcrumb Navigation Links in WordPress"was prepared by the friendly project team.
Good bad