Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1053834
    bedingfield
    Participant

    Hi there,

    Is there an easy way, once on the ‘tag archive’ page to show what ‘tag’ posts you are viewing?

    So at the top left of my page I have ‘Tag Archive’, I would like it to show ‘Tag Archive: Races’ for example. Or something similar.

    http://elyrunners.club/tag/race-report/

    Also, would you mind telling mw what PHP page controls this page as I would like to replicate the style of my blog page…

    http://elyrunners.club/2016/03/20/turing-trail-relay-ely-cambs/

    Thank you.

    #1054070
    Thai
    Moderator

    Hi 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.
    Then navigate to your child theme’s /framework/views/renew directory create a file named _landmark-header.php and paste the code below:

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_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 );
    $breadcrumbs        = x_get_option( 'x_breadcrumb_display' );
    
    ?>
    
    <?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 : ?>
    
        <header class="x-header-landmark">
          <div class="x-container max width">
            <div class="x-landmark-breadcrumbs-wrap">
              <div class="x-landmark">
    
              <?php if ( x_is_shop() || x_is_product() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1>
    
              <?php elseif ( x_is_bbpress() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>
    
              <?php elseif ( x_is_buddypress() ) : ?>
                <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_page() ) : ?>
    
                <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>
    
              <?php elseif ( is_home() || is_single() ) : ?>
                <?php if ( x_is_portfolio_item() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>
    
                <?php else : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_search() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
    
              <?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__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    
              <?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?>
    
                <?php
    
                $meta  = x_get_taxonomy_meta();
                $title = single_tag_title( __( 'Tag Archive: ', '__x__' ) , false);
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
    
              <?php elseif ( is_404() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_year() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_month() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_day() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
    
              <?php elseif ( x_is_portfolio() ) : ?>
    
                <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
    
              <?php endif; ?>
    
              </div>
    
              <?php if ( $breadcrumbs == '1' ) : ?>
                <?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?>
                  <div class="x-breadcrumbs-wrap">
                    <?php x_breadcrumbs(); ?>
                  </div>
                <?php endif; ?>
              <?php endif; ?>
    
              <?php if ( x_is_portfolio() ) : ?>
                <div class="x-breadcrumbs-wrap">
                  <?php x_portfolio_filters(); ?>
                </div>
              <?php endif; ?>
    
            </div>
          </div>
        </header>
    
      <?php endif; ?>
    <?php endif; ?>

    Also, would you mind telling mw what PHP page controls this page as I would like to replicate the style of my blog page…

    Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    #1055809
    bedingfield
    Participant

    Hi there,

    Thank you for this.

    I am trying to replicate this page layout (I designed this myself) for my ‘tag’ and ‘search’ results page – http://elyrunners.club/thames-path-100/

    So I just need to know what pages in the X view folder are used for the tag, category and search results please.

    Thank you

    #1055990
    Rue Nel
    Moderator

    Hello There,

    In X, it simply uses the x/framework/views/{your-stack}/wp-index.php for the tag, category and search results page. Do you want to display full content in your tag and search results page? If this is the case, since you have your child theme active and ready, please follow the following steps below:
    1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
    2] Insert the following code into that new file

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_CONTENT.PHP
    // -----------------------------------------------------------------------------
    // Display of the_excerpt() or the_content() for various entries.
    // =============================================================================
    
    $stack                     = x_get_stack();
    $is_full_post_content_blog = is_home() && x_get_option( 'x_blog_enable_full_post_content' ) == '1';
    
    ?>
    
    <?php
    
    if ( is_tag() || is_search() || is_singular() || $is_full_post_content_blog ) :
      x_get_view( 'global', '_content', 'the-content' );
      if ( $stack == 'renew' ) :
        x_get_view( 'renew', '_content', 'post-footer' );
      endif;
    else :
      x_get_view( 'global', '_content', 'the-excerpt' );
    endif;
    
    ?>

    3] Save the file named as _content.php
    4] Upload this file to your server in the child theme’s folder
    wp-content/themes/x-child/framework/views/global/

    Hope this helps.

    #1058509
    bedingfield
    Participant

    Hi there,

    Essentially, what I am trying to achieve is that the earth, tag, cat results show in the same style page layout as my single blog page layout.

    http://elyrunners.club/thames-path-100/

    By this I mean a 70% entered width.

    This is my code for blog single post…

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/TEMPLATE-BLANK-1.PHP (Container | Header, Footer)
    // -----------------------------------------------------------------------------
    // A blank page for creating unique layouts.
    // =============================================================================
    
    ?>
    
    <?php get_header(); ?>
    
       <div class="x-container max width offset">
       <div class="x-main full" role="main">
       <div class="blog-width" role="main">
    
          <?php while ( have_posts() ) : the_post(); ?>
            <?php x_get_view( 'renew', 'content', get_post_format() ); ?>
            <?php x_get_view( 'global', '_comments-template' ); ?>
          <?php endwhile; ?>
          
      </div>
      </div>
      </div>
    
    <?php get_footer(); ?>

    How do I get wp-index to view like above?

    Thank you.

    #1058858
    Rue Nel
    Moderator

    Hello There,

    To resolve this issue and have a 70% entry width, please find this css block in your customizer,

    .single-post .blog-width {
        margin: 0 auto;
        width: 70%;
    }

    You need to update it and replace it with this code instead:

    .single-post .blog-width,
    .archive.tag .hentry {
        margin: 0 auto;
        width: 70%;
    }

    Please let us know if this works out for you.

    #1059018
    bedingfield
    Participant

    Hi there, and thank you.

    If I wanted to adjust spacing and size of meta in ‘tag’ results, what CSS controls them?

    I would like a little more space between title, date and tags.

    Also, I would like to have a dividing line with space between resulting post results. I think currently, they are too close.

    http://elyrunners.club/tag/ultra-race/

    Thank you.

    #1059027
    Christopher
    Moderator

    Hi there,

    Please add this :

    p.p-meta {
        margin-bottom: 10px;
    }

    Find this code :

    header.entry-header a[rel=tag] {
        font-size: 12px;
        padding-top: 6px;
        padding-right: 10px;
        padding-bottom: 6px;
        padding-left: 10px;
        display: inline-block;
        background-color: #13475e;
        background-image: none;
        background-repeat: repeat;
        background-attachment: scroll;
        background-position: 0% 0%;
        background-clip: border-box;
        background-origin: padding-box;
        background-size: auto auto;
        border-top-width: 0px;
        border-right-width: 0px;
        border-bottom-width: 0px;
        border-left-width: 0px;
        border-radius: 4px;
        color: white;
        text-transform: uppercase;
    }

    And update it to :

    header.entry-header a[rel=tag] {
        font-size: 12px;
        padding-top: 6px;
        padding-right: 10px;
        padding-bottom: 6px;
        padding-left: 10px;
        display: inline-block;
        background-color: #13475e;
        background-image: none;
        background-repeat: repeat;
        background-attachment: scroll;
        background-position: 0% 0%;
        background-clip: border-box;
        background-origin: padding-box;
        background-size: auto auto;
        border-top-width: 0px;
        border-right-width: 0px;
        border-bottom-width: 0px;
        border-left-width: 0px;
        border-radius: 4px;
        color: white;
        text-transform: uppercase;
        margin-bottom: 10px;
    }

    Hope it helps.

    #1059149
    bedingfield
    Participant

    Thanks,

    I would want that CSS specific to search/tag/category results only. How would I do this please?

    #1059150
    Friech
    Moderator

    Hi There,

    If that is the case, please update the code to:

    .archive header.entry-header a[rel=tag],
    .search header.entry-header a[rel=tag] {
        font-size: 12px;
        padding-top: 6px;
        padding-right: 10px;
        padding-bottom: 6px;
        padding-left: 10px;
        display: inline-block;
        background-color: #13475e;
        background-image: none;
        background-repeat: repeat;
        background-attachment: scroll;
        background-position: 0% 0%;
        background-clip: border-box;
        background-origin: padding-box;
        background-size: auto auto;
        border-top-width: 0px;
        border-right-width: 0px;
        border-bottom-width: 0px;
        border-left-width: 0px;
        border-radius: 4px;
        color: white;
        text-transform: uppercase;
        margin-bottom: 10px;
    }

    Hope it helps, Cheers!

    #1059502
    bedingfield
    Participant

    Great, thank you.

    I would like to have a dividing line with space between resulting post results (end of excerpt & beginning of next post result) I think currently, they are too close.

    Can this be done?

    Thank you

    #1059742
    Rue Nel
    Moderator

    Hello Again,

    Thanks for the updates! To have a dividing line with space between resulting post results, please add the following css code in the customizer, Appearance > Customize > Custom > CSS

    .archive.tag .hentry{
        padding-bottom: 30px;
        margin-bottom: 30px;
        border-bottom: solid 1px red;
    }

    Feel free to change the color of the border and adjust the margin/padding for the spaces around the dividing line.

    #1059838
    bedingfield
    Participant

    Brilliant. Thank you so much.

    One more page related question… Where it says ‘Tag Archive’, is there a way to let viewer know what archive they are viewing? For example, Tag Archive: Race Reports.

    Also, what I have done with my tag archive, I would like to replicate for my search results. What CSS controls search results please?

    Thank you for your time.

    #1059853
    Christopher
    Moderator

    Hi there,

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

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_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 );
    $breadcrumbs        = x_get_option( 'x_breadcrumb_display' );
    
    ?>
    
    <?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 : ?>
    
        <header class="x-header-landmark">
          <div class="x-container max width">
            <div class="x-landmark-breadcrumbs-wrap">
              <div class="x-landmark">
    
              <?php if ( x_is_shop() || x_is_product() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1>
    
              <?php elseif ( x_is_bbpress() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>
    
              <?php elseif ( x_is_buddypress() ) : ?>
                <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_page() ) : ?>
    
                <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>
    
              <?php elseif ( is_home() || is_single() ) : ?>
                <?php if ( x_is_portfolio_item() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>
    
                <?php else : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_search() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
    
              <?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__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    
              <?php elseif ( x_is_portfolio_tag() || x_is_product_tag() ) : ?>
    
                <?php
    
                $meta  = x_get_taxonomy_meta();
                $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
    
              <?php elseif ( is_tag()) : ?>
                <h1 class="h-landmark"><?php echo single_tag_title(); ?></h1> 
    
              <?php elseif ( is_404() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_year() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_month() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_day() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
    
              <?php elseif ( x_is_portfolio() ) : ?>
    
                <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
    
              <?php endif; ?>
    
              </div>
    
              <?php if ( $breadcrumbs == '1' ) : ?>
                <?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?>
                  <div class="x-breadcrumbs-wrap">
                    <?php x_breadcrumbs(); ?>
                  </div>
                <?php endif; ?>
              <?php endif; ?>
    
              <?php if ( x_is_portfolio() ) : ?>
                <div class="x-breadcrumbs-wrap">
                  <?php x_portfolio_filters(); ?>
                </div>
              <?php endif; ?>
    
            </div>
          </div>
        </header>
    
      <?php endif; ?>
    <?php endif; ?>

    Find this code :

    .archive.tag .hentry {
        padding-bottom: 30px;
        margin-bottom: 30px;
        border-bottom: solid 1px #eeeeee;
    }

    And update it to :

    .archive.tag .hentry,.search-results .hentry {
        padding-bottom: 30px;
        margin-bottom: 30px;
        border-bottom: solid 1px #eeeeee;
    }

    Add this :

    .search-results .x-main{
    width:100%;
    }
    .search-results .x-sidebar{
    display:none;
    }

    Hope it helps.

    #1059928
    bedingfield
    Participant

    Perfect. Thank you. Ideally, I would like it to say ‘Tag Archive For …’

    Can this be done?

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