-
AuthorPosts
-
September 15, 2017 at 7:59 am #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
September 16, 2017 at 7:00 am #852818Hey derx,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
RikardSeptember 21, 2017 at 3:53 pm #854923Yes, please have have a look to: https://dieschobers.at and scrol down a bit,
thx gueSeptember 23, 2017 at 4:23 am #855679Hi,
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,
RikardSeptember 23, 2017 at 10:41 am #855761Yes Rikard this it what I would like zu get.
Any ideas for me?Best regards gue
September 24, 2017 at 3:03 pm #856046Hi 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,
VictoriaSeptember 24, 2017 at 4:09 pm #856070It 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
September 25, 2017 at 6:58 am #856346Hi,
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,
IsmaelSeptember 25, 2017 at 1:09 pm #856465We 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
September 26, 2017 at 3:40 pm #856977Hi 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 -
AuthorPosts
- You must be logged in to reply to this topic.