Skip 5 latest post while paging?

You can specify either paged for simple pagination, or offset if you want to do something special. Calculating the offset yourself is easy: just multiply the current page number (minus two) with the number of posts per page, and add your start offset: $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $posts_per_page = get_option( ‘posts_per_page’ ), … Read more

How / where is the wp_query object created for RSS feeds?

These files are not loaded directly, but similar to regular template files, only after the WP class is initialized. This class does the main query, which already can include the comments if the correct query variables are set. The execution flow is a follows, starting in the main index.php: require(‘./wp-blog-header.php’); require_once( dirname(__FILE__) . ‘/wp-load.php’ ); … Read more

the_post() in RSS feed

OK. So I think I figured this one out myself. I’ll document it here for the sake of those who may fall into the same trap. I’ve been using a template file to structure my feed. In my functions.php file, this is what the relevant portions of code looked like before: add_feed(‘weekly_deals’, ‘weekly_deals_create_feed’); function weekly_deals_create_feed(){ … Read more