Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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 screenshot

    Every 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.
    #1310525

    Hey 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,
    Mike

    #1310693

    Hi MIke,
    thanks but this isnT working.
    Is there probably another option to add a “read more” link/button below each news?

    #1311003

    Hi,

    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,
    Ismael

    #1311514

    @Ismael: no this isn’t working.
    Buttons are still hidden when going back by browser.

    #1311733

    Hi,

    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,
    Ismael

    #1311750

    Fantastic, this works excellent.
    Thank you

    #1311784

    Hi,
    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add button to the Masonry post’ is closed to new replies.