• Resolved Abu Maryam

    (@abu-maryam)


    Hello,

    I noticed that videos from post content are not shown in the Post Grid and Post Masonry.
    When YouTube link is used in a post then this video is not shown in the Post Grid and Post Masonry. Content is set to show the whole post content, not the excerpt.

    Images and other text content from posts are shown properly.

    Please check this issue.`

    Thanks in advance.
    Abu Maryam

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello @abu-maryam ,

    Can you please share a screencast that points out the steps to replicate the issue?

    Looking forward to hearing from you.

    Thread Starter Abu Maryam

    (@abu-maryam)

    Hello @swetakumari,

    You can see the result of the Post Grid and the Post Masonry here on this sample page.

    Some posts on this site contain embeded YouTube video links, but these videos are not shown in the Post Grid and the Post Masonry.

    When posts contain embeded video links from the site library, then these videos are shown properly (see example in link above).
    Hope this explains the the issue.

    Greetings,
    Abu Maryam

    Hello @abu-maryam ,

    Please use the following filter in the functions.php file of your child theme to resolve the problem:

    add_filter('uagb_single_post_excerpt_grid', function($excerpt, $id, $attr) { return custom_post_content(30); },10, 3 );
      
    function custom_post_content($limit) {
    
    	global $post;
    	$content = explode(' ', the_content(), $limit);
    	if (count($content)>=$limit) {
    	array_pop($content);
    	$content = implode(" ",$content);
    	} else {
    	$content = implode(" ",$content);
    	}	
    	$content = preg_replace('/\[.+\]/','', $content);
    	$content = apply_filters('the_content', $content); 
    	$content = str_replace(']]>', ']]>', $content);
    	return $content;
    
    }

    I hope that helps.

    Thread Starter Abu Maryam

    (@abu-maryam)

    Hello @swetakumari,

    first of all, sorry for this late reply and thanks for your effort and time!

    I have tried the code you suggested above and it′s not working as I expected.
    With this new code, the YouTube videos are now shown in the Post Grid.
    So that′s really good!

    Unfortunately, if a post does contain text, then this text is not shown in the Post Grid.
    With this new code, only the (YouTube) videos and images are shown in the Post Grid.

    Can you please give it another try in order to show the whole content (including text)?

    Thank you in advance!
    Abu Maryam

    Hello @abu-maryam ,

    We’re sorry for the inconvenience caused to you. Also, we are thankful for your patience and readiness to help us fix things that we come across.

    I’d like to let you know, I have reported this issue to our concerned developers. The issue is due to this CSS. They have added a task for it and will be fixed in our upcoming updates.
    ?
    Your patience and co-operation are highly appreciated.

    Meanwhile, please use the following CSS in the Customizer under the Additional CSS Tab to fix that issue:
    ?

    .uagb-post-grid .uagb-post__inner-wrap>p {
        display: block;
    }

    I hope that helps. Let me know how it goes.`

    Thread Starter Abu Maryam

    (@abu-maryam)

    Hello @swetakumari,

    we are almost there I think.
    Using the CSS you have provided, the post content (with HTML format) is fully shown now.
    So that’s really good!

    Unfortunately, what I noticed now is that in the Post Grid/Masonry the option to switch between ‘Show excerpt’ and ‘Show content’ is not working. Now only the full content is shown, regardless which option you select. This due the php code you gave me before.

    I think the Post Grid/Masonry blocks are really powerful blocks, but there are some improvements that need to made:
    – Show excerpt
    – Controling the length of the excerpt
    – Show full content (retaining HTML)
    – Controling the length of the content.

    If you could try to accomplish this in future versions then that would be really great.
    Thanks for your commitment!

    Greetings,
    Abu Maryam.

    Hello @abu-maryam ,

    I have already taken this up as a suggestion and added it to our to-do list so that our developers can consider it in one of our future updates.

    You can always get in touch with us through our website in case you wish to follow up or drop in any other suggestions.

    Thank you!

    Thread Starter Abu Maryam

    (@abu-maryam)

    Hello @swetakumari,

    This will be my last reply on this topic (especially for those who are interested in a workaround). This is my workaround and it works exactly as I wanted:

    The excerpt/content in the Post Grid/Masonry can be controlled by installing the plugin “Advanced Excerpt”. After install, the plugin must be refered to by using this code in the functions.php:

    For Post Grid:

    
    add_filter('uagb_single_post_excerpt_grid', function($excerpt, $id, $attr) { return the_advanced_excerpt() ; },10, 3 );
    

    For Post Masonry:

    
    add_filter('uagb_single_post_excerpt_masonry', function($excerpt, $id, $attr) { return the_advanced_excerpt() ; },10, 3 );
    

    To show the excerpt/content properly, this code must be added in the Additional CSS of the customizer:

    
    .uagb-post-grid .uagb-post__inner-wrap>p {
        display: block;
    }
    

    Your prefered options of the excerpt/content in the Post Grid/Masonry can be controlled in the settings of the plugin Advanced Excerpt. The length of the words/characters can be fully controlled (with retaining the HTML format).

    Anyway, thanks again!
    Abu Maryam

    Hello @abu-maryam ,

    Thank you for sharing the workaround with us!

    If you need anything else we can help you with, don’t hesitate to?open a new ticket.

    Have a nice day!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Video from posts not shown in Post Grid and Post Masonry’ is closed to new replies.