[Plugin: List category posts] Code enhancement: post thumbnail & shortcodes in excerpt
-
Hello, first thank you for this simple and powerful plugin, it is just what I was looking for. Te lo has currao.
Then I wanted to post two lines of code I implemented in my custom template, which I think would be handy if put in the original code for the next update:
Add the new Featured Image option in WP3 or “post thumbnail“
//Show thumbnail? if(has_post_thumbnail($single->ID)){ $lcp_output .= '<a href="' . get_permalink($single->ID) . '">' . get_the_post_thumbnail($single->ID, array('100','100')) . '</a>'; }
Parse shorcodes in the excerpt
//Show excerpt? if($atts['excerpt']=='yes' && !($atts['content']=='yes' && $single->post_content) ){ $lcpcontent = apply_filters('the_content', lcp_excerpt($single)); // added to parse shortcodes $lcpcontent = str_replace(']]>', ']]>', $lcpcontent); // added to parse shortcodes $lcp_output .= $lcpcontent; }
I don’t know if it’s the best way to implement those things but they work for me. I hope it’s useful.
Thanks again and continue with the good work.
Saludos
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘[Plugin: List category posts] Code enhancement: post thumbnail & shortcodes in excerpt’ is closed to new replies.