Home › Forums › WordPress Themes – Premium › Pure & Simple › Altering page names as they appear in breadcrumbs
Hi, hoping someone can please help me!
I would like to change the way page names appear in the breadcrumb trail, but I’m not sure if it’s possible?
For example, if I had a page that had a fairly long name, say “Edinburgh Portrait Photography – Donna Green”, can I keep the actual page name as exactly that but have the breadcrumb for it show up as just “portraits”?
Or does the breadcrumb always have to reflect the exact name of the page?
Thank you so much for any advice.
Hi Donna Green,
Sorry to say you that this queries comes on plugin territory, so we request you to consult to respective plugin author , they may assist you with proper help
Thanks
Thanks Sushil – I’ll try that.
Kind regards
Donna
Hi there,
Please use this example for reference.: This only applicable for navigation pages only:
Here we are using page slug “about ” for an example. @see https://developer.wordpress.org/reference/functions/is_page/
function replace_page_nav_function () {
if (is_page ("about")) { ?>
jQuery(document).ready(function() {
jQuery("span[property='itemListElement'] > [property='name']").text("Portrait");
})
<?php }
}
add_action ('wp_head', 'replace_page_nav_function');
Note: If you are technically sound on WordPress , Then only proceed for this, or take help from developers.
Thank you for this Sushil … I wouldn’t say I’m “technically sound” but I do have SOME idea, I guess!
This code would go in functions.php, yes?
Many thanks
Donna
Yes Donna green , this code should go to functions.php
Thanks
Thank you Sushil – this has worked beautifully!!!!
🙂
Great 🙂
With our premium themes, we offer access to site documentation, video tutorials and timely support. Even if you have just started on WordPress, our support staff have the patience to help you create appealing sites gracefully.
Company
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.To find out more, including how to control cookies, see here: Privacy Policy
© Copyright © 2023 Styled Themes. All Right Reserved.