-
AuthorPosts
-
July 14, 2021 at 10:15 am #1310085
Hi guys,
i have used this script to add a “Read more” button below the the preview text. Works fine, button is visible BUT when i go into the news and use the back function of the browser, the buttons are cut of as seen here screenshotEvery CSS that i insert like margin-bottom or padding-bottom works BUT not of going back to back like described.
Only one works: min-height but if a preview text is shorter than others i will get a visual hole in block order.Any idea?
- This topic was modified 3 years, 4 months ago by xeovision.
July 17, 2021 at 8:39 pm #1310525Hey Sebastian,
Thank you for your patience please try adding a code block element to your page and add this script inside:<script> (function($){ var int = window.setInterval(function(){ $(window).trigger('resize'); }, 200); $(window).load(function () { setTimeout(function() { clearInterval(int); }, 500); }); })(jQuery); </script>
I tested this by injecting it via the browser and it seemed to help, but I couldn’t add it to the page because of some security policy.
The masonry elements get their size via javascript thus the animation, typically in similar cases we would try to set the minimum size but your grid is not uniform. If this script doesn’t work there might be another that can force a reload on load and probably reset the page, but there may be a page “flash” which would be annoying.Best regards,
MikeJuly 19, 2021 at 9:08 am #1310693Hi MIke,
thanks but this isnT working.
Is there probably another option to add a “read more” link/button below each news?July 21, 2021 at 4:56 am #1311003Hi,
Thank you for the update.
We could use the following filter to add a “read more” text inside the masonry items’ content container, instead of the previous script.
add_filter("avf_masonry_entry_content", function($content) { $content .= "<span>Read more</span>"; return $content; }, 10, 1);
Best regards,
IsmaelJuly 22, 2021 at 4:20 pm #1311514@Ismael: no this isn’t working.
Buttons are still hidden when going back by browser.July 23, 2021 at 7:05 am #1311733Hi,
Thank you for the info.
We have added the avf_masonry_entry_content filter in the functions.php file and remove the previous script. Please remove the browser cache before testing the page again.
Best regards,
IsmaelJuly 23, 2021 at 8:25 am #1311750Fantastic, this works excellent.
Thank youJuly 23, 2021 at 10:44 am #1311784Hi,
Glad Ismael could help with this filter instead of the jQuery script:add_filter("avf_masonry_entry_content", function($content) { $content .= "<span>Read more</span>"; return $content; }, 10, 1);
If you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike -
AuthorPosts
- The topic ‘Add button to the Masonry post’ is closed to new replies.