Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search page issue
- This topic has 7 replies, 2 voices, and was last updated 10 months ago by
Ernest Marcinko.
-
AuthorPosts
-
August 5, 2025 at 12:17 pm #55155
alan_uew5
ParticipantHi. Hoping you can help. I have (although this is turned off for now) it set up to search a custom post type (act) and custom post taxonomy (event_category). This works well when viewing those results from the panel that appears after search however when I go to the search results page the styling is incorrect for the taxonomy due to the way the search.php page is set up.
Basically I need the styling of the taxonomy result to be different to that of the custom post type and for a few elements to change. Any ideas how I could achieve this?
Thanks in advance, Alan
August 5, 2025 at 9:15 pm #55158Ernest Marcinko
KeymasterHi,
The search results page in wordpress is specifically built to only display post type results. The plugin tries to “hack” those other results by sending fake posts with a modified url and titles as a placeholder.
You have two options:
1. To not display those results there using a custom code snippet. If it is okay to ignore them on the result page, then I can provide a small custom code snippet to exclude them when the results are directed to the search results page. Let me know if you need that.
2. To use the theme functions to modify the search.php file to fetch the fields from the live search (such as the images) on the results page. This requires custom coding though, so I only recommend doing that if you are comfortable with theme editing. These may or may not work, highly depends on how the search results page is built so I can’t guarantee anything.
August 6, 2025 at 8:26 am #55164alan_uew5
ParticipantYou cannot access this content.
August 6, 2025 at 9:13 am #55165Ernest Marcinko
KeymasterNot sure, it can be a theme thing. It might be optimal to exlcude them from the results page overall to avoid any conflicts generally:
add_filter( 'asp_query_args', function ( $args ) { if ( !$args['_ajax_search'] ) { $args['search_type'] = array('cpt'); } return $args; } );Try adding this code via the Code Snippets (or similar) plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
August 6, 2025 at 9:33 am #55167alan_uew5
ParticipantYou cannot access this content.
August 6, 2025 at 10:45 am #55169Ernest Marcinko
KeymasterLooks good to me!
The number of results on the plugin’s end is controlled under the Search Sources -> Limits panel: https://i.imgur.com/8O5MCFn.png
That should do the trick 🙂August 6, 2025 at 11:54 am #55170alan_uew5
ParticipantPerfect. Really appreciated your quick replies and help with this.
August 6, 2025 at 12:40 pm #55171Ernest Marcinko
KeymasterYou are very welcome 🙂 I will keep this topic open for a few days in case something comes up.
If you like the plugin and have not rated already, feel free to leave a rating on the wordpress plugin repository, it’s greatly appreciated.
-
AuthorPosts
- You must be logged in to reply to this topic.