Header live search issue

Posted in: Newspaper
Post count: 4

Hi everyone! I’d have a question. How can I set the header live search in order to show only posts and not pages? Unfortunately now my header live search shows also pages, but I don’t like very much this thing. How can I do? Thank you very much. Marco

Post count: 18283

Hi,

So I believe that you want to remove pages from search results, or return only post results. Maybe wrap that code in a condition like the example provided here
https://www.wpbeginner.com/wp-tutorials/how-to-exclude-pages-from-wordpress-search-results/
Then for you as admin the code will not apply and you can have all search results.

If you want to use any other search engine simply remove the search icons in the theme using tagDiv Composer and add your own.

Thank you !

Post count: 4

Thank you, I’ve pasted this code in the function.php of the theme and so I have removed pages from the search page, but only from the search page. I don’t know how to remove pages also from the header search live. As you can see in the attachment. How can I do? Thanks, Marco

Link: https://drive.google.com/file/d/1tRp5vuOIzzdRfapdrLZ88SSQco00QpGf/view?usp=sharing

Post count: 75

Thank you for asking this question, I have the same issue.

Post count: 18283

Hello !

Unfortunately for this you will need to edit the code of the live search which is not recommended. You can however to change the live search with a standard one.

Thank you !

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.