Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to append some WP posts to the normal search function but when I run the wp_get_recent_posts function (with the append and the posts IDs in an array) I dont get the posts I wanted 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, seems that WP also filters the appended posts with the other arguments, is there any workaround?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.