-
AuthorPosts
-
January 22, 2023 at 3:08 am #1394408
Good day,
I hope you are well.
I have created portfolio pieces for each of the books on this website. https://hb.dev32.engage24.com/
I would like all of the portfolio items to display at the same height. Here are the pages you can see the different books.
https://hb.dev32.engage24.com/books-for-teenages/ – This page is particularly bad because the titles are really long.
Also can’t quite understand why there is a larger space on the right-hand side of the gallery?
Many thanks,
CamillaJanuary 22, 2023 at 3:08 am #1394670Hey engage24,
Thanks for your patience and the link to your site, to make all of the titles in the portfolio grids the same height I added this code to the end of your child theme functions.php file in Appearance ▸ Editor:function equal_height_portfolio_grid_titles() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $('#av-sc-portfolio-1 .grid-sort-container').each(function(){ var $columns = $('.grid-entry-title',this); var maxHeight = Math.max.apply(Math, $columns.map(function(){ return $(this).height(); }).get()); $columns.height(maxHeight); }); })(jQuery); }); </script> <?php } add_action('wp_footer', 'equal_height_portfolio_grid_titles');
and this css in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field to center the titles:
.grid-entry-title { align-items: center; display: flex; justify-content: center; }
This is the result:
Please clear your browser cache and check.Best regards,
MikeJanuary 26, 2023 at 6:01 am #1395297Hi Mike,
Thank you so much, that worked perfectly!
I just noticed that the book “What’s the catch” is slightly off. Please can you check it out – https://hb.dev32.engage24.com/books-for-teenages/
Many thanks,
CamillaJanuary 26, 2023 at 6:35 pm #1395436Hi,
Glad to hear this helped, the image for “What’s the catch” is smaller than all of the others, please try correcting the image size by uploading a new correct image, it would be better than adding another script to adjust all of the images when only one is different.Best regards,
MikeJanuary 27, 2023 at 3:38 am #1395491Hi Mike,
Oh yes, that makes sense thank you!
Keep well.
Kind regards,
CamillaJanuary 27, 2023 at 6:04 am #1395514Hi Camilla,
I’m glad that Mike could help you :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Make portfolio grid the same height’ is closed to new replies.