- This topic has 14 replies, 6 voices, and was last updated 4 years, 4 months ago by
Leo.
-
AuthorPosts
-
March 15, 2021 at 2:49 pm #1696529
Rob
A while ago I successfully added breadcrumbs to my GP theme and I was happy with the way they appeared.
However, about 6 weeks ago the title of the blog posts started appearing in the breadcrumbs, as shown below:
https://robpowellbizblog.com/wp-content/uploads/2021/03/remove_breadcrumbs.jpgThis is annoying as it duplicates the existing article title (it could also be viewed by search engines as an attempt to spam the search results).
My question is: how do I edit the breadcrumb code so that the title of the article does not form part of the breadcumb?
Thanks for your help,
Rob
March 15, 2021 at 3:33 pm #1696555Elvin
StaffCustomer SupportHi there,
Aside from the current question, the breadcrumbs actually duplicate twice as shown here:
https://share.getcloudapp.com/DOu2Ob4gOne added on the supposed div where the title should’ve been added and one within the Thrive Editor.
Can you tell us how the Breadcrumbs is inserted? So we have an idea of how the breadcrumb is structured/generated.
Let us know.
March 15, 2021 at 4:09 pm #1696584Rob
Thanks for the reply.
That second duplication was the result of me testing a shortcode, which I’ve now removed:
https://robpowellbizblog.com/quizzes-for-lead-generation/I can’t remember exactly where I added the code for the breadcrumbs. Is there an ‘inspector tool’ where you can hover the mouse over the element and it will tell you where the code snippet is (i.e what the WP file is that contains the code)? If so, that is what I would need in order to work out where the code is.
This is the GP element that I am using as the ‘hook’:
https://robpowellbizblog.com/wp-content/uploads/2021/03/GP_Elements.jpgThanks for your help,
RobMarch 15, 2021 at 4:28 pm #1696595Elvin
StaffCustomer SupportI can’t remember exactly where I added the code for the breadcrumbs. Is there an ‘inspector tool’ where you can hover the mouse over the element and it will tell you where the code snippet is (i.e what the WP file is that contains the code)? If so, that is what I would need in order to work out where the code is.
While we can inspect the page and find clues, there are occurrences when the element gives too little to be able to actually identify which code it’s coming from. (no classes, no HTML comments)
But here’s a quick fix to your concern.
We can actually just hide the title on the breadcrumbs from displaying through CSS.
Try this:
strong.breadcrumb_last { display: none; }
March 15, 2021 at 4:33 pm #1696598Rob
I added that CSS and it has fixed the problem with the duplicated title in the breadcrumb:
https://robpowellbizblog.com/wp-content/uploads/2021/03/breadcrumb_problem_fixed.jpgMany thanks 🙂
March 15, 2021 at 4:38 pm #1696600Elvin
StaffCustomer SupportNice one. Glad you got it sorted.
March 15, 2021 at 4:39 pm #1696601Rob
Thanks, all resolved now 🙂
April 26, 2021 at 7:40 am #1749711Charles
I pasted this into my simple css plugin which I thought would activate it but it did not remove the title from my Yoast breadcrumbs.
Thanks.
strong.breadcrumb_last {
display: none;
}April 26, 2021 at 7:42 am #1749713Charles
I’ve seen this as a proposed solution to removing the title as well but I don’t think it’s CSS so I don’t know if it’s safe to use it.
/* Put in myfunctions.php
* Remove the last breadcrumb, the post title, from the Yoast SEO breadcrumbs
* Previous breadcrumb will remain linked
* Credit: David @ https://generatepress.com/forums/topic/how-to-hide-the-title-part-in-the-breadcrumb-im-using-yoast-seo/#post-614239
* Last Tested: Apr 11 2020 using Yoast SEO 13.4.1 on WordPress 5.4
*/add_filter(‘wpseo_breadcrumb_single_link’, ‘remove_breadcrumb_title’ );
function remove_breadcrumb_title( $link_output) {
if(strpos( $link_output, ‘breadcrumb_last’ ) !== false ) {
$link_output = ”;
}
return $link_output;
}April 26, 2021 at 7:57 am #1749728David
StaffCustomer SupportHi Charles,
That second snippet is PHP – this article explains how to add the code to your site:
https://docs.generatepress.com/article/adding-php/
TLDR: If you’re using a Child Theme then add the code to the Child Themes functions.php file – if you’re not using a Child Theme then install the Code Snippets plugin, add a new Snippet and paste the code in and save it.
April 26, 2021 at 9:47 am #1749841Charles
Neither seem to remove the title from my crumbs.
April 26, 2021 at 10:22 am #1749888Leo
StaffCustomer SupportThat’s a YoastSEO filter so you will need to check with their support on why it’s not working.
April 26, 2021 at 10:49 am #1749922Leo
StaffCustomer SupportI can’t really comment on what’s the best option as it’s more about personal preference.
Please make sure to reply to the forum topic here and start a new topic if you need further help with this.
Thanks!
May 9, 2021 at 5:27 am #1771087Cristina
Worked for me when I removed .strong leaving the css code to:
.breadcrumb_last {
display: none;
}May 9, 2021 at 9:24 am #1771483Leo
StaffCustomer SupportThanks for sharing!
-
AuthorPosts
- You must be logged in to reply to this topic.