Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1065601
    alexdigital
    Participant

    hi,

    Great theme!

    Is there a way to show the category descriptions when using Icon?

    let me know,

    Thanks in advance.

    -Alex

    #1066043
    Prasant Rai
    Moderator

    Hello 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.

    #1072026
    alexdigital
    Participant

    Thanks.

    But will that work with the Icon stack?

    -Alex

    #1072059
    Darshana
    Moderator

    Hi 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.

    #1196057
    Matt F
    Participant

    Hi,

    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!

    #1196189
    Nabeel A
    Moderator

    Hi Matt,

    Thanks for writing in! Can you please provide the URL of your site so we can take a closer look?

    Thanks!

    #1196358
    Matt F
    Participant
    This reply has been marked as private.
    #1196836
    Rad
    Moderator

    Hi 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!

  • <script> jQuery(function($){ $("#no-reply-1065601 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>