-
Author
-
August 26, 2016 at 15:37 #133970
akal
ParticipantHi,
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
August 26, 2016 at 18:51 #134004Radu
ModeratorHi,
the condition if single will goes like this
COPY CODEfunction 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 solutionAugust 26, 2016 at 19:31 #134020akal
ParticipantHi 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 CODEfunction 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
August 26, 2016 at 19:34 #134023akal
Participantthose lines I mean
COPY CODEfunction kleo_breadcrumb( $args = array() ) { if(!is_single()) { return WPSEO_Breadcrumbs::breadcrumb('<div class="kleo_framework breadcrumb">', $after, '</div>'); } }
August 29, 2016 at 16:12 #134171Radu
ModeratorHi,
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 -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.