Tagged: excerpt, Shortcodes
-
AuthorPosts
-
April 14, 2014 at 1:02 pm #251015
Hi, my name is Egon, i love your theme ENFOLD, it is really very easy to use and works very fine.
I only have one question: I would like to show an shortcode in the excerpt of the theme. But if i put the shordcode “[wpc_countdown targetdate=”2014-05-08-10-15-59″]” into it i will not work. It only shows up the text.
I’ve tried to place the “add_filter(‘get_the_excerpt’,’do_shortcode’);” filter to the functions.php, but als soon as i saved it the page does not longer show, the browser stais white.
How can i manage to get it run?
Thank you in advanced for your reply, yours Egon.
April 14, 2014 at 2:53 pm #251089This reply has been marked as private.April 14, 2014 at 3:04 pm #251096Hey!
Thank you for using the theme!
Please edit the post then look for Screen Options. Enable the excerpt metabox. Use it to specify the excerpt of the post along with the shortcode. I hope that it works.
Regards,
IsmaelApril 14, 2014 at 3:14 pm #251103This reply has been marked as private.April 14, 2014 at 3:14 pm #251104Hey!
My bad! I didn’t notice that you’re using the blog grid style. Please edit config-templatebuilder > avia-shortcodes > postslider.php. Find this code on line 311:
$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 this:
$prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : do_shortcode($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , 60) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " "));
That should enable the shortcodes on blog grid excerpts.
Regards,
IsmaelApril 14, 2014 at 3:17 pm #251106This reply has been marked as private.April 14, 2014 at 3:23 pm #251110This reply has been marked as private.April 14, 2014 at 4:11 pm #251167Hi!
I’m sorry but it is working on my end. Maybe, you didn’t paste the code correctly. Can you please post the code on line 311 here?
Regards,
IsmaelApril 14, 2014 at 4:17 pm #251171This reply has been marked as private.April 14, 2014 at 4:19 pm #251174This reply has been marked as private.April 14, 2014 at 4:21 pm #251176This reply has been marked as private.April 14, 2014 at 4:26 pm #251179This reply has been marked as private.April 14, 2014 at 4:29 pm #251181This reply has been marked as private.April 15, 2014 at 7:33 am #251463Hi!
Thank you for the update.
Please ignore the suggestion about the Screen Options > Excerpt metabox then do the changes above on line 311. Place the shortcode on the text editor. This is what I have on my end when I use the icon shortcode:
Since you’re using a third party plugin’s shortcode, please contact the plugin author. Thanks!
Cheers!
IsmaelApril 16, 2014 at 9:38 am #251996This reply has been marked as private.April 17, 2014 at 3:25 am #252400Hi!
1. Have you tried setting a manual excerpt?
2. You can set that in the Header options at the right when editing the Page:
Best regards,
JosueApril 17, 2014 at 9:30 am #252527This reply has been marked as private.April 17, 2014 at 12:32 pm #252630This reply has been marked as private.April 21, 2014 at 5:40 pm #253943Hey!
Excerpts in WordPress do not support shortcodes so you need to enable it on that specific selection as Ismael indicated above and as you mentioned you had working. You’ll need to go back and re-enable them on that file each time you update the theme.
Cheers!
DevinApril 22, 2014 at 10:27 am #254258This reply has been marked as private.April 22, 2014 at 4:02 pm #254421Hi!
Sorry for the confusion.
Please edit the same line on postslider.php that we suggested above. Replace the code with this:
$prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : do_shortcode(avia_backend_truncate($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , 150) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " ") , "…", false, ''));
This should allow the shortcode but since it is also calculating the shortcode as excerpt, you might want to increase the avia_backend_truncate string limit from the default 60 to 150 or more.
Cheers!
IsmaelApril 23, 2014 at 4:49 pm #255059Thank You very very much, you guys are incredible.
Everything worked out fine now,
perfekt theme, perfect support. I will buy again!!!
Sencerely yours Egon
-
AuthorPosts
- The topic ‘Shortcode does not work in excerpt’ is closed to new replies.