Ah yes I found the issue.
Its the way you are doing the filter.
First of all let me say, when you use a WP filter, you usually get an input variable, which needs to be modified (filtered) and its then returned.
Doing $args = array()
, means you replace the input object rather than modify it, for example this would be better:
$args['property'] = "value"
Anyway, what it meant was, you were replacing the pagination variable, which had already been conveniently calculated for you 😉
So, all you would need to do is (notice I left paged
off):
$args['post_type'] = 'tarefa';
$args['posts_per_page'] = 5;
$args['order'] = 'DESC';
$args['author'] = $feed_rc;
$args['meta_query'] = $feed_cd;
In fact, now you are using the existing $args
, you will find S&F builds a lot of the rest, just because of the settings you have chosen… so this could probably be reduced to:
$args['author'] = $feed_rc;
$args['meta_query'] = $feed_cd;
If you change the order of results in S&F settings this should be retained, as well as posts per page setting and post type 🙂
Let me know how you get on!