Tutorial by Examples

add_shortcode is wp keyword. // recent-posts is going to be our shortcode. add_shortcode('recent-posts', 'recent_posts_function'); // This function is taking action when recent post shortcode is called. function recent_posts_function() { query_posts(array('orderby' => 'date', 'order' =&...
This functions takes parameter for how many recent posts you want to display. Ex : you want to display only five recent posts. Just passed the arguments with posts="5" (you can pass any number of recent posts that you want to display). Function fetch only five recent posts from database....

Page 1 of 1