 
	
		Tagged: excerpt, grid, post slider, shortcode
- 
		AuthorPosts
- 
		
			
				
November 6, 2013 at 5:45 pm #185276Hello, I am in final stages of completing our website and must say, that this theme and the theme support is awesome. I never regretted spending my money on enfold theme. But there is still one last thing I need to find out. I really need the ability to handle shortcodes in post sliders / grid layouts (within the excerpt). Each excerpt should e.g. start with an icon, but the excerpt just outputs the shortcode term for the icon. I tried the advanced excerpt plugin, which helps me display shortcodes inside the excerpts of blog elements, but is no help with any grid element. I did some research, but couldn´t find a solution. The topic that came closest to my question was this https://kriesi.at/support/topic/dropcap-2-and-post-sliders/ – but the provided code didn´t work for me. I appriciate any help. Thanks! November 7, 2013 at 1:12 am #185407Hey StuWeTueHo! Edit config-templatebuilder > avia-shortcodes > postslider.php, find this code: $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , 60) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " "), "…", true, '');Replace it with: $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : do_shortcode(avia_backend_truncate($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , 300) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " "), "…", false, ''));This will increase the excerpt length. You should increase the “300” value for longer shortcodes. Best regards, 
 IsmaelNovember 7, 2013 at 11:46 am #185550Thanks for your reply Ismael, The code provided did fine, but somehow it only works with automatic generated excerpt. If I use the custom excerpt field at the bottom of each page / post, it still shows the shortcode term. But it is essential for me to work with custom excerpts. The strange thing: when I use a blog shortcode, everything works fine. This only happens with grid layouts. Any suggestion for that? Thanks! November 7, 2013 at 12:11 pm #185556I uploaded an example image for both manual and automatic excerpts. Dropcaps and icons get displayed perfectly, except with the combination of grid layout and manual excerpt …  - 
		This reply was modified 11 years, 12 months ago by StuWeTueHo. 
 November 9, 2013 at 8:55 am #186424Hi! Please try following code instead $prepare_excerpt = !empty($entry->post_excerpt) ? do_shortcode($entry->post_excerpt) : do_shortcode(avia_backend_truncate($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , 300) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " "), "…", false, ''));It should work with custom excerpts too. Best regards, 
 Peter
- 
		This reply was modified 11 years, 12 months ago by 
- 
		AuthorPosts
- The topic ‘Display shortcodes in postslider / grid elements’ is closed to new replies.
