Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Accessing the index outside of the search form (e.g. for post loop) › Reply To: Accessing the index outside of the search form (e.g. for post loop)
February 26, 2024 at 6:19 pm
#47089
Participant
Thanks Ernest,
I’ve been checking out the docs, and have created a quick test, which I’ve posted below. Unfortunately, it looks like I’m still only receiving results from the current blog though, not the other blogs in the multisite. Is there anything I need to add to the args to include the multisite results? I’ve tried both the regular engine and the index engine as options.
<?php
$args = array(
'post_type' => array('article', 'link', 'meeting', 'presentation', 'video', 'page'),
'engine' => 'index',
'post_primary_order' => 'post_date ASC',
);
$asp_query = new ASP_Query($args);
echo '<ul>';
foreach ( $asp_query->posts as $result ) {
// do your thing
echo '<li><a href="' . $result->asp_guid . '">' . $result->post_title . '</a></li>';
}
echo '</ul>';
?>