• 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 don’t get the posts I wanted to append in the results. I’m not sure what I’m doing wrong.

    If I remove the tag_id argument then the posts I want to append are included in the results. It seems that WP also filters the appended posts with the other arguments, is there any workaround?

    $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’);

    Any help would be greatly appreciated – I’ve asked about this elsewhere but no one’s been able to figure it out. Thank you! ??

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Can't get append argument to work in the wp_get_recent_posts function’ is closed to new replies.