Forum Replies Created
-
AuthorPosts
-
pbaines
ParticipantThanks Earnest,
We’ll give the index table synonyms a trial and look into the predictive results too. I think initially when we looked at the predictive results it was gathering from Google, which sometimes wasn’t that relevant. Maybe we’ll switch it up to the search statistcs and trial that.
We did run into some issues with the keyword search and utilising the index table previously. We found that the keyword search was more accurate with it turned off. Does this sound right? Perhaps it needs more time to build?
Thanks,
Peter
February 28, 2024 at 5:17 pm in reply to: Accessing the index outside of the search form (e.g. for post loop) #47123pbaines
ParticipantMany thanks Ernest.
Last question (I promise!)
We have 2 sliders on many pages, and it seems that having 2 ASP_Query foreach loops on one page seem to be causing some strange issues.
For example, the template that we are calling in the second foreach loop is changing the lookup directory and giving us an error.
It’s looking for ‘/wp-content/themes/ispn/slider/single-slider-item.php’ (The other sub-site theme) when within the previous foreach loop, the template we are including is looking for ‘/wp-content/themes/ispn-library/slider/single-slider-item.php’. It’s using the same include line, so these should be the same. Its also breaking some elementor templates below, by looking for templates within the other subsite, instead of the current site. (Screenshot attached)
My thoughts are that perhaps this ASP_query needs to be reset somehow, before calling it again? Does that sound right?
I think we’re nearly there!
Thanks,
Peter
February 27, 2024 at 3:50 pm in reply to: Accessing the index outside of the search form (e.g. for post loop) #47098pbaines
ParticipantHi Earnest,
Sorry, one more quick question on this thread!
I have another slider, and I need to sort it numerically by views. Each page/post should have post meta for views, with the key ‘post_views_count’ and a numerical value.
I’ve tried using the following, but keep returning no results. Is there anything else I need to add here?
‘post_primary_order’ => ‘post_views_count DESC’,
‘post_primary_order_metatype’ => ‘numeric’,
‘_post_primary_order_metakey’ => ‘post_views_count’,Many thanks,
Peter
February 26, 2024 at 6:34 pm in reply to: Accessing the index outside of the search form (e.g. for post loop) #47091pbaines
ParticipantHi Earnest,
Sorry, me again!
I’ve figured it out – I was missing the search ID from the ASP_Query function!
Many thanks for your help.
Peter
February 26, 2024 at 6:19 pm in reply to: Accessing the index outside of the search form (e.g. for post loop) #47089pbaines
ParticipantThanks 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>'; ?>pbaines
ParticipantYou cannot access this content.
-
AuthorPosts