Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #852408

    We have a minor issue with the grid view of the latest posts on the frontpage. The layout is almost perfect. Unfortunately, the theme does not use an inner wrapper DIV for the excerpt text. Instead, the text and the readmore link are wrapped together in the .slide-entry-excerpt DIV. This lead to a not quite perfect horizontal alignment due to different word lenghts (6 to 7 lines per textblock are needed). Since the structure is constructed in a function and not a template, it’s not easy to fix this (update-safe!). It would be much better to use an inner wrapper for the excerpt text, so that we could use a min-height for the block. Can you provide a solution?

    gd

    #852818

    Hey derx,

    Could you post a link to the site in question so that we can take a closer look please?

    Best regards,
    Rikard

    #854923

    Yes, please have have a look to: https://dieschobers.at and scrol down a bit,
    thx gue

    #855679

    Hi,

    Thanks for that, so you are looking for the excerpt with button to be the same height all the time, I’m assuming? If not then please try to explain a bit further or post a screenshot highlighting your intentions.

    Best regards,
    Rikard

    #855761

    Yes Rikard this it what I would like zu get.
    Any ideas for me?

    Best regards gue

    #856046

    Hi derx,

    It is very hard to achieve, even if you do it for one screen size, the words wrap differently and on different screen sizes there can be various lines, not the same amount all the time.

    Best regards,
    Victoria

    #856070

    It is very hard to achieve without a proper DIV structure. We could easily improve the layout for common resolution. This would not be perfect but at least a significant improvement. Anyway, it’s more often than not a good idea to use wrapper DIVs for text blocks. DIVs don’t harm if you don’t exaggerate. We wouldn’t ask for support if we could change the template. Unfortunately, the structure of this element is built in a function which would be overwritten when updating the theme. Could you provide a better solution?

    Best regards gue

    #856346

    Hi,

    Please add this script in the functions.php file.

    // custom script
    add_action( 'wp_footer', 'ava_custom_script' );
    function ava_custom_script() {
    ?>
    <script type="text/javascript">
    (function($) {
      function a() {
        // Get an array of all element heights
        var elementHeights = $('.slide-entry-excerpt').map(function() {
          return $(this).height();
        }).get();
    
        // Math.max takes a variable number of arguments
        // <code>apply</code> is equivalent to passing each height as an argument
        var maxHeight = Math.max.apply(null, elementHeights);
    
        // Set each height to the max height
        $('.slide-entry-excerpt').height(maxHeight);
      }
    
      $(window).resize(function() {
          setTimeout( a(), 1500 );
      });
    })(jQuery);
    </script>
    <?php
    }

    And then add the following css codes in the Quick CSS Field.

    .avia-content-slider .slide-entry-excerpt {
        overflow: hidden;
        text-overflow: ellipsis;
        padding-bottom: 100px;
    }
    
    .html_elegant-blog .avia-content-slider .read-more-link {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    The code will get the height of the tallest excerpt container and then apply it to the rest.

    Based on: https://stackoverflow.com/questions/6781031/use-jquery-css-to-find-the-tallest-of-all-elements

    Don’t forget to remove the browser cache or hard refresh before checking the page.

    Best regards,
    Ismael

    #856465

    We placed the Code – made the Cache empty – but – still not working – my programmer colleague means is just a small thing. Pleas have a look, thank you lgg

    #856977

    Hi derx,

    This is a content slider, you can look into its file /themes/enfold/config-templatebuilder/avia-shortcodes/contentslider.php and make changes, add the extra div that you need and try to play with css.

    Best regards,
    Victoria

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.