This topic has 4 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #133970
     akal
    Participant

    Hi,

    by the past I asked about change the breadcrumbs title content. I would like my user see a different content between page title and breadcrumb title.

    You gave me a fonction that works. See example here: http://pcc.gatcom.fr/evenements/

    But this fonction causing issues on single posts (categories disapear from breadcrumbs): http://pcc.gatcom.fr/actualites/divers/jogging-courir-pres-de-paris/

    Here is your fonction :

    //change kleo breacrumbs using custom page title

    function kleo_breadcrumb( $args = array() )

    {
    return WPSEO_Breadcrumbs::breadcrumb( ‘<div class=”kleo_framework breadcrumb”>’, $after, ‘</div>’ );
    }

    Question : is it possible to add a conditionnal like ” if !is_single () ” to your code in order to exclude single posts from that behavior ?

    I don’t have skill on php to do that by my own…

    Hope I’m clear enought

    Kind regards

    Akal

    #134004
     Radu
    Moderator

    Hi,

    the condition if single will goes like this

    COPY CODE
    
    function kleo_breadcrumb( $args = array() ) {
        if(is_single()) {
            return WPSEO_Breadcrumbs::breadcrumb('<div class="kleo_framework breadcrumb">', $after, '</div>');
        }
    }
    

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #134020
     akal
    Participant

    Hi thank you very much for your fast reply.

    With thoses lines you provide, the breadcrumbs for page disappears and the breadcrumbs for post is still the same (without categories)

    I was wondering something that exclude only single post (so I will not use the “kleo custom title), something like (!is_single) :

    COPY CODE
    function kleo_breadcrumb( $args = array() ) {
        if(!is_single()) {
            return WPSEO_Breadcrumbs::breadcrumb('', $after, '');
        }
    }

    but if I do that, the breadcrumbs for single post totally disappears…

    any ideas ?

    Cheers

    Akal

    #134023
     akal
    Participant

    those lines I mean

    COPY CODE
    function kleo_breadcrumb( $args = array() ) {
        if(!is_single()) {
            return WPSEO_Breadcrumbs::breadcrumb('<div class="kleo_framework breadcrumb">', $after, '</div>');
        }
    }
    #134171
     Radu
    Moderator

    Hi,

    Use the css method instead

    COPY CODE
    
    
    .single-post .kleo_framework.breadcrumb span[rel="v:child"] a {display:none !important;}
    
    
    

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?