WordPress category loop offset possible?

The ‘offset’ parameter does what you want. I’ve written this hack, it should help you…

<?php
    //The third parameter corresponds to action priority,
    //set it to change the order of execution in case of a conflict
    add_action('pre_get_posts', 'the_modified_loop', 10);

    function the_modified_loop($query){
        //Remove 'is_admin' if you want the code to run for the backend category archive page
        if(!is_admin() && $query->is_category()){
            $query->set('offset', 3);
        }
    }
?>

Let me know if it worked!

Leave a Comment