I want to append some posts to the wp_get_recent_posts function, so they are always retrieved with the normal results, the problem is that I dont get the posts I want to append in the results, am I doing something wrong?

$include = array(1, 2);
$args = array(
        'showposts' => 10, 
        'tag_id' => '123',
        'post_status' => 'publish',
        'exclude' => $current_id,
        'orderby' => 'post_date',
        'append' => $include,
    );
    $entries = wp_get_recent_posts($args, 'ARRAY_A');

If I remove the tag_id argument then the posts I want to append are included in the results but I need to filter the normal results by tag ID, seems that WP also filters the appended posts with the other arguments, is there any workaround?

Read more here: wp_get_recent_posts not working correctly with appended posts


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: