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

Reply To: Search Results

#19599
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Andy,

It is unfortunately neccessary to set an ‘invalid’ post ID, as otherwise wordpress would automatically treat them as post types, leading to major errors and malfunctions. I am not sure if it is possible to pass on the original ID to the results page, as objects are usually re-queried there.

I made a possible modification to the main functions file, so that it will try to pass on the original ID as a different object property. To apply this change:

1. Please open up the wp-content/plugins/ajax-search-pro/includes/functions/functions.php file on your server
2. Change it’s contents to this.
3. Save the file

Now, in your custom code, the ‘asp_id‘ property should hold the original object ID. So if the $post variable is the post object, then $post->asp_id should be the original ID.

Please note, that this may not work at all, as there is a very highy chance, that WordPress simply re-queries the post objects after the plugin passes it to it, and this information is lost then.