This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Accessing the index outside of the search form (e.g. for post loop)

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)

#47089
pbainespbaines
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>';

?>
  • This reply was modified 2 years, 3 months ago by pbaines.