Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1151266
    mindihirsch
    Participant

    I would like to add content (text and photo) at the top of some of the category pages. Is there CSS coding I could add? I am not able to access the path as recommended when this question has been asked before.

    Here’s an example of one of my category pages: http://www.2foodtrippers.com/category/food-guides/

    I have added text and a photo in WordPress in “Edit Category”, but I don’t know how to get it to show on the actual site.

    Thanks!

    #1151285
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    You mean to display the description that you added at Admin > Posts > Categories? Yes, that’s possible.

    Please add this code to your child theme’s functions.php

    add_action('x_before_view_global__script-isotope-index', 'display_category_description');
    function display_category_description () { if( is_category() ) :?>
    <div class="category-description"><?php echo category_description(); ?></div>
    <?php endif; }

    Hope this helps.

    #1154746
    mindihirsch
    Participant

    I just added the code but it doesn’t seem to work. The description is not showing above the posts. Any other ideas?

    Thanks!

    #1154813
    Christopher
    Moderator

    Hi there,

    Copy _landmark-header.php from framework/views/ethos and put it in the same path inside child theme, replace existing code with following :

    <?php
    
    // =============================================================================
    // VIEWS/ETHOS/_LANDMARK-HEADER.PHP
    // -----------------------------------------------------------------------------
    // Handles content output of large headers for key pages such as the blog or
    // search results.
    // =============================================================================
    
    $disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
    
    ?>
    
    <?php if ( ! x_is_blank( 1 ) && ! x_is_blank( 2 ) && ! x_is_blank( 4 ) && ! x_is_blank( 5 ) ) : ?>
      <?php if ( is_page() && $disable_page_title == 'on' ) : ?>
      <?php else : ?>
    
        <?php if ( x_is_shop() || x_is_product() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php echo x_get_option( 'x_ethos_shop_title' ); ?></span></h1>
          </header>
    
        <?php elseif ( x_is_bbpress() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>
          </header>
    
        <?php elseif ( x_is_buddypress() ) : ?>
          <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
    
            <header class="x-header-landmark x-container max width">
              <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
            </header>
    
          <?php endif; ?>
        <?php elseif ( is_page() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>
          </header>
    
        <?php elseif ( x_is_portfolio_item() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
          </header>
    
        <?php elseif ( is_search() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
          </header>
    
        <?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() ) : ?>
    
          <?php
    
          $meta  = x_get_taxonomy_meta();
          $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' );
    
          ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
            <div class="category-description"><?php echo category_description(); ?></div>
          </header>
    
        <?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?>
    
          <?php
    
          $meta  = x_get_taxonomy_meta();
          $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' );
    
          ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
          </header>
    
        <?php elseif ( is_404() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
          </header>
    
        <?php elseif ( is_year() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
          </header>
    
        <?php elseif ( is_month() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
          </header>
    
        <?php elseif ( is_day() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
          </header>
    
        <?php elseif ( x_is_portfolio() ) : ?>
    
          <header class="x-header-landmark x-container max width">
            <h1 class="h-landmark"><span><?php echo x_get_option( 'x_portfolio_title' ); ?></span></h1>
          </header>
    
        <?php endif; ?>
    
      <?php endif; ?>
    <?php endif; ?>

    Hope it helps.

    #1156493
    mindihirsch
    Participant

    Hmm, I replaced the previous code with this code. It still isn’t working. Am I missing a step?

    Thanks!

    #1156518
    Rad
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    What you did should trigger an error, that above code can’t replace the first once since it’s functions.php’s code. And that last one is template code.

    Thanks!

    #1158695
    mindihirsch
    Participant

    Will do. What are FTP credentials?

    #1158726
    Rahul
    Moderator

    Hey,

    Kindly send us the login credentials of your host. When we ask for FTP details we are asking for a way to log into your server so that we can access the application files for a support request, or upload the files for an install request.

    Thank You.

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