Tagged: x
-
AuthorPosts
-
June 29, 2016 at 4:53 pm #1065601
alexdigitalParticipanthi,
Great theme!
Is there a way to show the category descriptions when using Icon?
let me know,
Thanks in advance.
-Alex
June 29, 2016 at 9:35 pm #1066043
Prasant RaiModeratorHello Alex,
Thanks for writing in!
Please walk-through following thread to add category descriptions and let us know how it goes:
https://community.theme.co/forums/topic/adding-category-description-functionality/
Thanks.
July 4, 2016 at 4:49 pm #1072026
alexdigitalParticipantThanks.
But will that work with the Icon stack?
-Alex
July 4, 2016 at 5:44 pm #1072059
DarshanaModeratorHi there,
For icon stack, please follow the instructions below.
First, copy the file _content-post-header.php which is located under “x/framework/views/icon/” into your child theme’s respective location “x-child/framework/views/icon”.
Then Edit the file and replace it with the following code.
<?php // ============================================================================= // VIEWS/ICON/_CONTENT-POST-HEADER.PHP // ----------------------------------------------------------------------------- // Standard <header> output for various posts. // ============================================================================= ?> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h2 class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a> </h2> <div class="center-text"><?php echo category_description(); ?></div> <?php endif; ?> <?php x_icon_entry_meta(); ?> <?php if ( get_post_format() == 'quote' ) : ?> <p class="entry-title-sub"><?php echo get_post_meta( get_the_ID(), '_x_quote_quote', true ); ?></p> <?php endif; ?> </header>Save the changes and then you can load a category URL to test.
Hope that helps.
September 29, 2016 at 12:44 pm #1196057
Matt FParticipantHi,
I also want to show my category description on my category pages using Icon. I used the above solution, however the category description shows up under every blog post title, and not at the top of the main category page. So for example, if I have six posts under the “video” category, then the category description shows six times – one time under each blog post title.
How would we make it so that the category title and description show, just once, when using Icon?
Thanks!
September 29, 2016 at 2:06 pm #1196189
Nabeel AModeratorHi Matt,
Thanks for writing in! Can you please provide the URL of your site so we can take a closer look?
Thanks!
September 29, 2016 at 4:06 pm #1196358
Matt FParticipantThis reply has been marked as private.September 29, 2016 at 10:39 pm #1196836
RadModeratorHi there,
There is no category description on all stacks, and icon stack has no landmark where usually the title appears. And it’s intentional design for that specific stack.
Instead, please add this code to your child theme’s functions.php
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; }Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1065601 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
