Tagged: x
-
AuthorPosts
-
March 5, 2017 at 11:19 pm #1395700
kenasParticipantHi, how to show category description on all categories ?
March 6, 2017 at 12:54 am #1395794
kenasParticipantalso need to add shortcodes as well
March 6, 2017 at 1:09 am #1395810
ChristopherModeratorHi there,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Copy _index.php from framework/views/global and put it in the same path inside child theme, replace existing code with following :
<?php // ============================================================================= // VIEWS/GLOBAL/_INDEX.PHP // ----------------------------------------------------------------------------- // Includes the index output. // ============================================================================= $stack = x_get_stack(); if ( is_home() ) : $style = x_get_option( 'x_blog_style' ); $cols = x_get_option( 'x_blog_masonry_columns' ); $condition = is_home() && $style == 'masonry'; elseif ( is_archive() ) : $style = x_get_option( 'x_archive_style' ); $cols = x_get_option( 'x_archive_masonry_columns' ); $condition = is_archive() && $style == 'masonry'; elseif ( is_search() ) : $condition = false; endif; ?> <?php if ( $condition ) : ?> <div class="category_description"> <?php echo category_description(); ?> </div> <?php x_get_view( 'global', '_script', 'isotope-index' ); ?> <div id="x-iso-container" class="x-iso-container x-iso-container-posts cols-<?php echo $cols; ?>"> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php if ( $stack != 'ethos' ) : ?> <?php x_get_view( $stack, 'content', get_post_format() ); ?> <?php else : ?> <?php x_ethos_entry_cover( 'main-content' ); ?> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <?php x_get_view( 'global', '_content-none' ); ?> <?php endif; ?> </div> <?php else : ?> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php x_get_view( $stack, 'content', get_post_format() ); ?> <?php endwhile; ?> <?php else : ?> <?php x_get_view( 'global', '_content-none' ); ?> <?php endif; ?> <?php endif; ?> <?php pagenavi(); ?>also need to add shortcodes as well
Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Hope it helps.
March 6, 2017 at 1:35 am #1395833
kenasParticipantI set up a child theme.. but your provided code, did not work for me.
I think it´s for ethos while i am using iconIn the other hand, i tried this other solution you provided here :
https://community.theme.co/forums/topic/show-category-descriptions-in-icon-stack/and the code
add_action('x_before_view_global__index', 'icon_archive_title'); function icon_archive_title () { if( is_category() ) : ?> <?php $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : single_cat_title("", false); ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title ?></span></h1> <?php echo category_description(); ?> </header> <?php endif; }Does work in functions.php showing the category description as needed but shortcodes still not working.
March 6, 2017 at 1:52 am #1395859
kenasParticipantShould i stick to the functions.php method or choose try to figure out why is not working the _index.php in global ?
I also managed to include the shortcode adding in functions.php the following
add_filter( 'term_description', 'do_shortcode' );So it finally looks something like this :
https://goo.gl/e9WfFcI would still like to center the description and the title, is this possible ?
March 6, 2017 at 2:12 am #1395881
ChristopherModeratorHi there,
Your methods is correct and category description displays fine.
Please add following code in Customize -> Custom -> Global CSS :
h1.h-landmark, header.x-header-landmark.x-container.max.width p { text-align: center; }Hope it helps.
March 6, 2017 at 2:25 am #1395894
kenasParticipantThanks for your help
March 6, 2017 at 2:29 am #1395896
LelyModeratorYou’re welcome!
Cheers.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1395700 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
