StyledThemes

Altering page names as they appear in breadcrumbs

Home Forums WordPress Themes – Premium Pure & Simple Altering page names as they appear in breadcrumbs

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17027
    Donna Green
    Participant

    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.

    #22384
    Sushil Adhikari
    Moderator

    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

    #22385
    Donna Green
    Participant

    Thanks Sushil – I’ll try that.
    Kind regards
    Donna

    #22386
    Sushil Adhikari
    Moderator

    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.

    #22387
    Donna Green
    Participant

    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

    #22388
    Sushil Adhikari
    Moderator

    Yes Donna green , this code should go to functions.php

    Thanks

    #22399
    Donna Green
    Participant

    Thank you Sushil – this has worked beautifully!!!!
    🙂

    #17028
    Sushil Adhikari
    Moderator

    Great 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.