Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • #408838

    I have used in a page the display-mode masonry for the blog. I want to add a “read more” button. So I added this code to functions.php:

    https://kriesi.at/support/topic/read-more-element-within-masonry-blog-not-working/#post-403284

    But the excerpt is on every blog-item the same…

    #409658

    Hi joeberlin!

    Thank you for using Enfold.

    Replace it with this:

    add_filter('avf_masonry_loop_prepare','avia_change_default_link', 10, 2);
    function avia_change_default_link($loop, $entries)
    {		
    	foreach($entries->posts as $key => $entry)
        {
            if($entry->post_type == "post") {
                $more 	 		 =   "<br /><span class='masonry-more-link-arrow'>".__('Read more','avia_framework')."</span>";
    			$loop[$key]['content'] = avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '') . $more;  
            }
        }
        return $loop;
    }

    Cheers!
    Ismael

    #409750

    Thank you for the reply. The excerpt is now correct, but there is no “Read more” link…

    #410335

    Hey!

    Looks like the filter isn’t working. Please edit config-templatebuilder > aviashortcodes > masonry_entries.php. Look for this code:

    if(empty($this->loop[$key]['content']))
    				{
    					$this->loop[$key]['content'] 	= avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '');
    				}

    Replace it with:

    if(empty($this->loop[$key]['content']))
    				{
    					$this->loop[$key]['content'] 	= avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '') . "<br /><span class='masonry-more-link-arrow'>".__('Read more','avia_framework')."</span>";
    				}

    Cheers!
    Ismael

    #410424

    Thank you! This works!

    #410837

    Hey!

    Glad we could help :)

    Regards,
    Rikard

    #563932

    Hey, this is not working anymore, I cant find:

    if(empty($this->loop[$key][‘content’]))
    {
    $this->loop[$key][‘content’] = avia_backend_truncate($entry->post_content, apply_filters( ‘avf_masonry_excerpt_length’ , 60) , apply_filters( ‘avf_masonry_excerpt_delimiter’ , ” “), “…”, true, ”);
    }

    On masonry_entries.php

    Please I need to add a read more on mansory blog.

    regards

    • This reply was modified 8 years, 10 months ago by DanielBu.
    #564365

    Hi,

    Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply. You might want to create a new thread since the original poster will be able to see your details otherwise.

    Best regards,
    Rikard

    #564794

    Here you can find them

    #565185

    Hi Rikard,
    Is not working at all, becouse it shows the read more, but the excert is the same in all post, I tried that before.
    I need this working.

    Thanks a lot!
    Regards

    #566425

    Hi!

    You need to modify the helper-masonry.php instead of the masonry_entries.php file. Look for this code around line 416:

    $this->loop[$key]['content'] 	= avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '');
    

    Regards,
    Ismael

    #592042

    Now (Enfold Version 3.4.7) you have change at config-templatebuilder > aviashortcodes > helper-masonry.php

    This (line 416):

    $this->loop[$key]['content'] = avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '');

    To this:

    $this->loop[$key]['content'] = avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '') . "<br /><span class='masonry-more-link-arrow'>".__('Read more','avia_framework')."</span>";

    #594231

    Hi!


    @joeberlin
    : Thanks for sharing. ;)

    Cheers!
    Ismael

    #808972

    Hi Enfold Team,

    I tried the code above in the helper-masonry.php but nothing change, the “read” more” does not appear…

    Is it me or there is another solution ?

    Thanks,

    Clément

    #809950

    Hi Blue_Bear,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look? Is the code still there? Did you get any errors?

    Best regards,
    Victoria

    #810270

    Yes of course !

    #810611

    Hi Clément,

    You need to create the same folder structure and put the file /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php in there, make changes in it and see what happens :)

    Best regards,
    Victoria

    #810994

    Hi Victoria,

    I’m sorry but I don’t understand what you mean… “create the same folder structure” you mean in my child theme >config-templatebuilder/avia-shortcodes/av-helper-masonry.php ?

    Makes changes so you mean to put the code above ?
    $this->loop[$key]['content'] = avia_backend_truncate($entry->post_content, apply_filters( 'avf_masonry_excerpt_length' , 60) , apply_filters( 'avf_masonry_excerpt_delimiter' , " "), "…", true, '') . "<br /><span class='masonry-more-link-arrow'>".__('Read more','avia_framework')."</span>";

    Thanks,
    Clement

    #812070

    Hi Clement,

    Yes, this is what I meant, did you manage to do it?

    Best regards,
    Victoria

    #812094

    Hi Victoria,

    I’ve just did it and nothing happen. I even try to add the code of #410335 post in my functions.php but still nothing.

    Maybe I did something wrong ??

    Thanks,
    Clement

    #812713

    Hi Clément,

    I don’t see this file in your child theme, only styles.css and functions.php. How can I check the code on your side?

    Best regards,
    Victoria

    #813007

    Hi victoria,

    I give you an acces to my ftp in the private section.

    Thanks,
    Clement

    #813683

    Hi,

    Please move the modification then add this code in the functions.php file.

    // masonry read more
    function ava_custom_script_mod(){
    ?>
    <script>
    (function($){
    	function a() {
    			$('<div class="av-masonry-read-more">Read More</div>').insertAfter('.av-inner-masonry-content-pos');     
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_custom_script_mod');
    

    Best regards,
    Ismael

    #813774

    It’s just perfect thanks you very much !!!!!

    You can close the topic.

    Best regards,
    Clement

    #814011

    Great! We’re happy to help.

    Please let us know if you need help with anything else.

    Thank you for using Enfold.

    Cheers!
    Sarah

Viewing 25 posts - 1 through 25 (of 25 total)
  • The topic ‘"Read more" at Masonry Blog’ is closed to new replies.