Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1344481
    michaelxxx
    Participant

    Hi,

    Can you please take a look at this page:
    https://one-million-places.com/tag/aida-karibik-kreuzfahrt

    Is it possible to set the width of
    <header class="x-header-landmark x-container max width">

    just as big as the width of
    <div class="x-main left" role="main">

    to move the sidebar up (see screenshot).

    #1344744
    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    @media (min-width: 980px){
        body.tag .x-header-landmark.x-container.max.width {
            width: 66%;
            float: left;
            margin-left: 5%;
        }
    
        body.tag .x-sidebar.right.q2w3-fixed-widget-container {
            margin-top: -380px;
        }
    }

    Hope it helps 🙂

    #1344815
    michaelxxx
    Participant

    Hi,

    thanks, but now the .x-header-landmark is to much left aligned.
    I can set margin-left to 10% or 15%, but this can not be the best solution because user have different screen sizes.

    Is there a better way to add a special tag template to x-child ethos?

    #1344821
    michaelxxx
    Participant

    and it would be great to have the same styling on category pages like:
    https://one-million-places.com/reiseberichte/australien-neuseeland/australien

    #1345260
    Friech
    Moderator

    Hi There,

    Update the given css code to this.

    @media (min-width: 980px){
    .x-header-landmark .h-landmark,
    .x-header-landmark .cat-desc {
    	width: 66%;
    	float: left;
    }
        body.tag .x-sidebar.right.q2w3-fixed-widget-container {
            margin-top: -380px;
        }
    }

    Hope it helps, Cheers!

    #1345300
    michaelxxx
    Participant

    No, I can´t do it with CSS, because every TAG page have different content in the header and so they have different heights.

    For example, when I use your CSS code in this TAG site it will not work:
    https://one-million-places.com/tag/tauchberichte

    This is why I asked you if it is possible to add a special tag template to x-child ethos?

    #1345719
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! Every tag and category has already a special css body selector. Generally, you will have a tag or category and you can use a css like;

    body.category element {
      // your styling here
    }
    
    body.tag element {
      // your styling here
    }

    If you want to target specific tag or category, you can use the specific tag/category slug or tag/category ID. You can have something like this:

    body.category-reiseberichte element,
    body.category-1 element {
      // your category styling here
    }
    
    body.tag-tauchberichte element
    body.tag-1221 element {
      // your tag styling here
    }

    It is more like tag-{slugname} or tag-{#} and category-{slugname} or category-{#} where the slugname is the slug of the tag/category and the number is the ID of the tag/category.

    Sitewide, you have have a minimum height of at least 180 pixels for example like this: http://prntscr.com/e0fbuo

    You can do that by simply having this code in the customizer, Appearance > Customizer > Custom CSS

    header.x-header-landmark.x-container.max.width {
        min-height: 180px;
        padding-bottom: 20px;
    }

    Hope this helps.

    #1345957
    michaelxxx
    Participant

    Hi,

    I know that solution with the tag/category ID.

    But I have more tahn 400 different TAG sites and they all have diffenrent heights.
    It can´t be the solution, that I now add 400 CSS codes to Custom CSS, or?

    That´s why I ask to modify the tag template in X child and include the .cat-desc into the main fraime.
    You know what I mean?

    #1345975
    Rue Nel
    Moderator

    Hello There,

    Thank you for the clarifications. To resolve this, you can do the following steps:
    1] Please create a new file in your local computer.
    2] Insert the following the code into that file:

    <?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>
            <p class="cat-desc"><?php echo category_description(); ?></p>
          </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>
            <p class="cat-desc"><?php echo tag_description(); ?></p>
          </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; ?>

    3] Save this file and named it as “_landmark-header.php”
    4] You can then upload this file in your child theme’s folder wp-content/themes/x-child/framework/views/ethos/

    Hope this helps.

    #1346003
    michaelxxx
    Participant

    Hi,

    there is no change on the site when I use your code.

    I already have an own “_landmark-header.php” file in my x child, so this part is done 🙂
    And I also found the code which includes the description in the header on TAG pages:

                <?php
                $meta  = x_get_taxonomy_meta();
                $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : single_tag_title( '', false );
                ?>
    	    <header class="x-header-landmark x-container max width">
                 <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
                 <div class="cat-desc"><?php echo category_description(); ?></div>
                 </header>

    How can I move that code into main frame <div class="x-container max width main">?

    #1346009
    michaelxxx
    Participant

    I think I found the solution. I added that code into wp-index.php

    #1346019
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! We are just glad that you have figured out a way to resolve the issue.
    We really appreciate for letting us know.

    Cheers.

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