Tagged: x
-
AuthorPosts
-
May 26, 2016 at 7:42 am #1010969
LyserParticipantHello,
I have 3 questions1) i’ve found this code in the forum for display the category in the breadcrumbs but the “>” is missing between the category and the post, how can it be fixed ? (can be seen here)
here is the codefunction x_breadcrumbs() { if ( x_get_option( 'x_breadcrumb_display', '1' ) ) { GLOBAL $post; $is_ltr = ! is_rtl(); $stack = x_get_stack(); $delimiter = x_get_breadcrumb_delimiter(); $home_text = x_get_breadcrumb_home_text(); $home_link = home_url(); $current_before = x_get_breadcrumb_current_before(); $current_after = x_get_breadcrumb_current_after(); $page_title = get_the_title(); $blog_title = get_the_title( get_option( 'page_for_posts', true ) ); if ( ! is_404() ) { $post_parent = $post->post_parent; } else { $post_parent = ''; } if ( X_WOOCOMMERCE_IS_ACTIVE ) { $shop_url = x_get_shop_link(); $shop_title = x_get_option( 'x_' . $stack . '_shop_title', __( 'The Shop', '__x__' ) ); $shop_link = '<a href="'. $shop_url .'">' . $shop_title . '</a>'; } echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter; if ( is_home() ) { echo $current_before . $blog_title . $current_after; } elseif ( is_category() ) { $the_cat = get_category( get_query_var( 'cat' ), false ); if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter ); echo $current_before . single_cat_title( '', false ) . $current_after; } elseif ( x_is_product_category() ) { if ( $is_ltr ) { echo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after; } else { echo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link; } } elseif ( x_is_product_tag() ) { if ( $is_ltr ) { echo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after; } else { echo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link; } } elseif ( is_search() ) { echo $current_before . __( 'Search Results for ', '__x__' ) . '“' . get_search_query() . '”' . $current_after; } elseif ( is_singular( 'post' ) ) { //get categories// $post_categories = wp_get_post_categories( $post->ID ); $cats_string = ''; if(!empty($post_categories)){ foreach($post_categories as $c){ $cat = get_category( $c ); $cats_string .= '<a href="'.get_category_link( $cat ).'">' . $cat->name . '</a>' . $current_after . ' '; } } //end / get categories// if ( get_option( 'page_for_posts' ) == is_front_page() ) { echo $cats_string . $current_before . $page_title . $current_after; } else { if ( $is_ltr ) { echo '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>' . $delimiter . $cats_string . $delimiter . $current_before . $page_title . $current_after; } else { echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>'; } } } elseif ( x_is_portfolio() ) { echo $current_before . get_the_title() . $current_after; } elseif ( x_is_portfolio_item() ) { $link = x_get_parent_portfolio_link(); $title = x_get_parent_portfolio_title(); if ( $is_ltr ) { echo '<a href="' . $link . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after; } else { echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . $link . '">' . $title . '</a>'; } } elseif ( x_is_product() ) { if ( $is_ltr ) { echo $shop_link . $delimiter . $current_before . $page_title . $current_after; } else { echo $current_before . $page_title . $current_after . $delimiter . $shop_link; } } elseif ( x_is_buddypress() ) { if ( bp_is_group() ) { echo '<a href="' . bp_get_groups_directory_permalink() . '">' . x_get_option( 'x_buddypress_groups_title', __( 'Groups', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after; } elseif ( bp_is_user() ) { echo '<a href="' . bp_get_members_directory_permalink() . '">' . x_get_option( 'x_buddypress_members_title', __( 'Members', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after; } else { echo $current_before . x_buddypress_get_the_title() . $current_after; } } elseif ( x_is_bbpress() ) { remove_filter( 'bbp_no_breadcrumb', '__return_true' ); if ( bbp_is_forum_archive() ) { echo $current_before . bbp_get_forum_archive_title() . $current_after; } else { echo bbp_get_breadcrumb(); } add_filter( 'bbp_no_breadcrumb', '__return_true' ); } elseif ( is_page() && ! $post_parent ) { echo $current_before . $page_title . $current_after; } elseif ( is_page() && $post_parent ) { $parent_id = $post_parent; $breadcrumbs = array(); if ( is_rtl() ) { echo $current_before . $page_title . $current_after . $delimiter; } while ( $parent_id ) { $page = get_page( $parent_id ); $breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>'; $parent_id = $page->post_parent; } if ( $is_ltr ) { $breadcrumbs = array_reverse( $breadcrumbs ); } for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) { echo $breadcrumbs[$i]; if ( $i != count( $breadcrumbs ) -1 ) echo $delimiter; } if ( $is_ltr ) { echo $delimiter . $current_before . $page_title . $current_after; } } elseif ( is_tag() ) { echo $current_before . single_tag_title( '', false ) . $current_after; } elseif ( is_author() ) { GLOBAL $author; $userdata = get_userdata( $author ); echo $current_before . __( 'Posts by ', '__x__' ) . '“' . $userdata->display_name . $current_after . '”'; } elseif ( is_404() ) { echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after; } elseif ( is_archive() ) { if ( x_is_shop() ) { echo $current_before . $shop_title . $current_after; } else { echo $current_before . __( 'Archives ', '__x__' ) . $current_after; } } echo '</div>'; } }2) I’ve used the custom headline but the lines doesn’t appear on each side of the word, do you know why ? (you can see that with the “les derniers scenarios” and the “les derniers films” here)
3) Is there a solution for displaying the social icon just next to the header menu and not on the top header ?
Thx =)
May 26, 2016 at 2:52 pm #1011671
RadModeratorHi there,
Thanks for writing in.
1. Please try the code provided here https://community.theme.co/forums/topic/categories-breadcrumbs-issue/#post-134515, and few adjustment from here https://community.theme.co/forums/topic/category-names-doesnt-show-up-in-breadcrumbs/#post-1004575
2. Hmm, they appear inline on my end. Would you mind providing a screenshot of what we should expect?
3. It would need customization, menu items structure is different from social links structure. Just moving it will break it. Adding menu items with social icons and links is much more easier than moving it.
Thanks!
May 28, 2016 at 3:54 am #1014175
LyserParticipant1) thx
2) that’s really strange, i’ve tried desactivate all addon to see but still no custom headlines appearing


3) thx
May 28, 2016 at 4:12 am #1014188
Nabeel AModeratorHi again,
Have you enabled the accent attribute of your custom headline? Please refer to the following link http://theme.co/x/demo/integrity/1/shortcodes/custom-headline/
Enabling it should fix the issue, let us know how this goes!
May 28, 2016 at 5:37 am #1014248
LyserParticipantthx !
they are barely visible, how to change color and opacity ?May 28, 2016 at 5:41 am #1014251
LyserParticipantok found that code who works
.h-custom-headline.accent span:before, .h-custom-headline.accent span:after { border-top: 1px solid #999999; border-bottom: 1px solid #999999; }thx =)
May 28, 2016 at 6:37 am #1014284
ChristopherModeratorGlad to see that you were able to fix it.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1010969 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
