Tag Info

New answers tagged


This code could work, I'm using the setup_postdata to create a post object similar to what the function the_post() does, so now you can use the functions you have in a Loop. $recent_posts = wp_get_recent_posts( array( 'numberposts' => 3, 'orderby' => 'post_date', 'order' => ...


The post_excerpt value is empty because you have no explicit excerpts for your posts. While the_excerpt() does generate an excerpt from the posts content if the post excerpt is empty, the function wp_get_recent_posts(), which is basically a wrapper for get_posts(), doesn't.


You want to edit the title, and not the content. Check this for filters you want to use. If you want to edit your title you should add_filter to it and modify it(the_title). Like so: add_filter('the_title', 'addBadge2Title'); function addBadge2Title($title) { $seconds = strtotime("now") - strtotime(get_the_date("Y/m/d")); $badge = ...

Top 50 recent answers are included