Tagged: breadcrumb, header
-
AuthorPosts
-
January 10, 2014 at 8:28 am #207859
For SEO purposes I named my blog with a longer name/title. The side effect to this is that my breadcrumb is long and the page title in the header next to the breadcrumb is long. I read your other post on this issue (https://kriesi.at/support/topic/changing-blog-name-only-in-breadcrumbs-of-enfold/), and I changed class-breadcrumb.php to
/* If $show_home is set and we're not on the front page of the site, link to the home page. */ if ( !is_front_page() && $show_home ) $trail[] = '<a href="' . home_url() . '" title="Blog" rel="home" class="trail-begin">' . $show_home . '</a>';
And nothing changes. If possible, chaning this in functions PHP would be awesome- I just need to manually change the blog heading and breadcrumb name to “Blog” instead of what I have as the page title.
Thanks for all of the help you guys are amazing.
January 10, 2014 at 6:11 pm #208091That changed the home text to blog.
You can see an example here: https://www.virginiaseo.org/blog/seo-email-scam-artist-hurt-your-reputation/
The breadcrumb should read:
You are here: Home / Blog / SEO Tips / Post Title
Right now it is reading: Blog / Full Blog Title / SEO Tips / Post Title
January 12, 2014 at 12:17 pm #208631Hey!
You can try following code – insert it into the functions.php file.
if(!function_exists('avia_modify_blog_breadcrumb')) { function avia_modify_blog_breadcrumb($trail) { foreach($trail as $key => $data) { $search = 'SEO Tools to Equip Your Business – Blog'; if(strpos($data, $search) !== false) { $data = str_replace($search, "Blog", $data); $trail[$key] = $data; } } return $trail; } add_filter('avia_breadcrumbs_trail','avia_modify_blog_breadcrumb'); }
Regards,
PeterJanuary 13, 2014 at 12:48 am #208741I see what you are trying to do, but it unfortunately does not work. I have put the code in and nothing is changed.
January 13, 2014 at 9:50 am #208856Hey!
I’m trying to find a solution here and I’m so glad Dude provided one. Dude’s code works on my end. Please replace this line with the exact Blog title that you have:
$search = 'SEO Tools to Equip Your Business – Blog';
I have a page named “Blog” then I replace the breadcrumb trail to “Awesome Blog”. This is the result:
Best regards,
IsmaelJanuary 15, 2014 at 7:30 pm #210220Here is my code:
// Change Breadcrumb if(!function_exists('avia_modify_blog_breadcrumb')) { function avia_modify_blog_breadcrumb($trail) { foreach($trail as $key => $data) { $search = 'SEO Tools to Equip Your Business – Blog'; if(strpos($data, $search) !== false) { $data = str_replace($search, "Blog", $data); $trail[$key] = $data; } } return $trail; } add_filter('avia_breadcrumbs_trail','avia_modify_blog_breadcrumb'); }
And here is my unchanged blog title. Not sure what is going on here…
http://cl.ly/image/1g3z2s1k3V1L
I of course dumped all my cache and stuff. I dont know if it matter but the class of my span is trail-end, while the PHP looks like it calls for trail.
January 18, 2014 at 8:15 am #211523Hi!
Where in your functions.php file did you add the new filter? If its at the top, put it at the bottom and if at the bottom put it at the top.
Best regards,
DevinJanuary 18, 2014 at 6:54 pm #211630I moved it from the bottom to the top. No dice, no change.
Any more ideas? I don’t mind a core hack if that is what is needed to make this work.
January 18, 2014 at 11:52 pm #211776Hi!
Do you have a cache plugin? Please flush the settings after you added the code above, see if that works. If not, please post the login details here. Set it as a private reply.
Best regards,
IsmaelJanuary 19, 2014 at 8:52 am #211878This reply has been marked as private.January 20, 2014 at 11:01 am #212167Hey!
It works now – I had to replace the dash ( – ) with & #8211;
Regards,
PeterJanuary 20, 2014 at 4:49 pm #212316Awesome thank you very much!!!!
I have one more question. I have changed the blog a bit- it was set in theme options to a page, and this would not allow me to add content to it over the blog roll. So per your instructions on another post, I turned off the log page in theme options and instead set it up using the advanced editor, which let me also add a title.
This has made the breadcrumb act funny. Perhaps you can explain what I need to do to fix it.
Blog is root/blog
Permalinks are set to custom /blog/
Blog pages are coming up as root/blog/post which is what I want.One the blog page, the breadcrumb is set back to what it was before your hack from above. I am thinking this is because I changed the page from is_index to a single page. So, how can I now change this breadcrumb to also say Blog instead of the page title?
Second, when I go to posts, the blog page is not in the breadcrumb. So instead of the breadcrumb being You Are Here: Home / Blog / Post it is reading You Are Here: Home / Post
Is this something I can work with? I also read somewhere in here about having to fix my permalinks for some reason?
- This reply was modified 10 years, 10 months ago by Imburr. Reason: Further Questions
-
AuthorPosts
- The topic ‘Rename Blog Title and Breadcrumb’ is closed to new replies.