Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1312134

    Hi, is there any way to show the full content of posts via the Post Slider element? My client wants a slider for their team, with each slide showing a headshot on the left, a couple of paragraphs (with titles) on the right, and a button below the paragraphs — so I’m looking for a slider that lets me use the Advanced Layout Editor. Maybe there’s a snippet I could add to my child theme to let the Post Slider show the full content, instead of just excerpts? Thanks and let me know if you have any questions!

    #1312659

    Hey sky19er,

    Thank you for the inquiry.

    Have you tried using the Content Slider element? You can insert shortcodes and create your own markup in each slider. Unfortunately, there is no slider in the theme where you can use the advance layout builder to create the content of the slide.

    Best regards,
    Ismael

    #1312847

    Thanks, Ismael. I did try the Content Slider, but, for one, the shortcode wizard in there uses a limited list — there’s no option.for columns in there, and it doesn’t look like using the column shortcode works in that element. Plus, using shortcode makes it hard for the client to make updates themselves. And also, the arrows for that element are not so hot — I much prefer the arrows in the post slider. But if you don’t have (or want to create) a snippet I could add to my child theme to make the post slider show full posts, I totally understand — just let me know. I guess I’d probably go with a third party slider plugin, like Smart Slider, then. Thanks again, Ismael — I always appreciate for your help!

    #1313783

    Hi,

    Yes, the shortcode in the content slider is quite limited and adding shortcodes manually may not be what your client wanted. We could use the avf_post_slider_entry_excerpt filter to return the actual content of the post entry instead of the excerpt.

    function avf_post_slider_entry_excerpt_custom($excerpt, $prepare_excerpt, $permalink, $entry ) {
    	$excerpt = $entry->post_content;
    	return $excerpt;
    }
    add_filter('avf_post_slider_entry_excerpt', 'avf_post_slider_entry_excerpt_custom', 10, 4);
    

    This should display the full content of the posts in the post slider element, but it may require some css or style adjustments.

    Best regards,
    Ismael

    #1313825

    Nice! Now (and I’m sorry to keep pushing on this) is there a way to tweak that so it works with the Advanced Layout Editor in the posts? It seems to be showing all the shortcode when I use the Advanced Layout Editor in the post (see https://fpamed.com/home-team-slider-test/ ). Also, I can hide the featured images with css, but if there’s an easy way to hide those in the function, that’d be awesome. Thanks again, Ismael!

    #1314277

    Hi,

    is there a way to tweak that so it works with the Advanced Layout Editor in the posts?

    That is not possible, unfortunately. Rendering the shortcodes will break the post slider. The modification above will only work if the posts have been created using the default editor.

    Best regards,
    Ismael

    #1314284

    Fair enough — thanks again, Ismael!

    #1314522

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1314545

    Actually, Ismael, sorry, it looks like — even if I use the default editor — the shortcode in the default editor’s not working, so I can’t do the columns or add a button: https://fpamed.com/home-team-slider-test/ — Is there any way to get the Post Slider to process shortcode in the default editor?

    • This reply was modified 3 years, 4 months ago by sky19er.
    #1314991

    Hi,

    In the avf_post_slider_entry_excerpt filter above, try to wrap the $excerpt or the $entry->post_content in a do_shortcode function. This should render the shortcodes in the default editor properly

    // https://developer.wordpress.org/reference/functions/do_shortcode/

    Rendering of shortcodes are not allowed by default because there is a great chance that it will break the layout of the page if not done correctly.

    Best regards,
    Ismael

    #1315001

    Yes — that worked! return do_shortcode($excerpt); I think the only thing left is that It’s still outputting like an excerpt in that it doesn’t seem to register paragraphs — I can probably work around that with dividers and/or css, but if you know how to get it to register paragraphs that’d be perfect. Thanks again, Ismael.

    #1315187

    Hi,

    You might be able to use the wpautop function to automatically create paragraph tags, or to automatically convert line breaks to paragraph tags.

    // https://developer.wordpress.org/reference/functions/wpautop/

    Best regards,
    Ismael

    #1315228

    That worked! So here’s the complete function to pull the full content of posts into the post slider, process the shortcode, and add paragraph breaks:

    function avf_post_slider_entry_excerpt_custom($excerpt, $prepare_excerpt, $permalink, $entry ) {
    	 $excerpt = $entry->post_content;
    	return do_shortcode(wpautop($excerpt));
    }
    add_filter('avf_post_slider_entry_excerpt', 'avf_post_slider_entry_excerpt_custom', 10, 4);

    Thanks again, Ismael — I repeat: you’re the man!

    #1315971

    Hi,

    No problem. Glad we could be of help. Please feel free to open another thread should you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘post slider show full content’ is closed to new replies.