Site logo

Archived topic

Disable Search completely

18 replies · Started by Davood on February 13, 2021

Viewing posts 1–15 of 19

Hi, I am redeveloping a site that uses an advanced search plugin. I will be using a child theme for the CSS and some other custom code unrelated to search. However, we believe the advanced search plugin is not working due to Generate Press having search.php and searchform.php in the theme.

After a lot of digging through google all I can find is how to remove the search widget. Is there a way to completely disable the custom functions/hooks that Generate Press replaces the default wp_query with?

Thank you in advance.

Hi there,

GP uses the default WP search function... it doesn't change its behaviour and the templates it uses are fairly standard.

What is the plugin you're trying to use ?

The plugins we are using do not matter.. this is a theme issue. I had this problem with multiple search plugins that do the same type of thing when using GP. I know this because I've had the problem with multiple themes that have these files and have not had the problem with any themes that do not have these files in our child theme.

To clarify slightly further...
When we are using a theme that does not put the search files in their theme such as a custom theme that I built where I did not include them the search plugins I am referring to all work as advertised as along as they are being used one at a tile. However, with GP the code in the two search files is over taking the plugins.

The fact that this happens makes sense but I need to be able to have those files get ignored somehow and they code within them is calling GP functions not WP functions so that is why I asking here how to disable these files so that they get ignored.

It's not possible to remove those files from the theme without actually removing them from the parent theme.

However, these are standard WordPress templates. The query is not being changed at all - the files are purely cosmetic to provide the necessary HTML markup to match the rest of the theme.

It sounds like the plugin(s) you're using need to be tweaked to account for these files, as they are standard in most WordPress themes.

You can overwrite these files in your child theme if you need to change the markup. Again - the actual query isn't being changed by GeneratePress. However, even if it was, you can always adjust the query using the pre_get_posts action in WordPress.

I am sorry but I have reviewed the code in the files and the files very clearly call Generate Press functions... Yes when I dig deeper and find the functions that are being called in the code they are using default WP code but it is the Generate Press functions that I need to be disabling. Once again I am looking for a way to disable it in our CHILD THEME using a hook or function.

I have been using GP for about a year and a half now and I know that this can be done in any other theme that has their own functions which call the WP search query. Please do not tell me it can not be done in our child theme because I know that is not true... I also know based on closely reviewing all of the code in the search.php and searchform.php files that there are custom Generate Press functions being used.

I have tried to disable the default WP search query function using some custom code in our child theme (with Generate Press as the parent theme) and it is not disabling... when I disable it nothing happens.

Where it comes to the plugin part of my earlier posts we are only going to use one plugin but for testing purposes we tested multiple to see if it was a theme issue or a plugin issue and the bottom line as I've said is that it is a theme issue because of custom functions that the two files are calling.

Can you be more specific about which GP functions you're trying to disable?

Sorry for the delay in my reply. After my testing late in the day yesterday which involved a disable search plugin available on wp.org I was able to get any of the advanced search plugins I was testing to work correctly. However, I also spoke to my client and it looks like we will likely be going to use a custom programmed short code that calls the default wp search query (similar to the custom calls being made in search.php of GP) inside of our Child Theme to do what he wants.

I'm not able to respond privately to your private message. I am the lead developer, but I'm still human. If I don't know the solution to a question, I need to ask more questions until the solution becomes clear. In this case, you mentioned it was a GP function that was causing the issue, so I asked which function it was so I could potentially help disable it.

If you end up re-visiting this, feel free to share the problem function with me and I'll be happy to provide a solution if it exists.

Thanks!

I will, that is why I want to keep this open.

I do realize you are human. What I think you did not realize I was saying in the public and private part of my last message is that as the lead developer you should know what functions the two files I am talking about are using that are GP specific functions. That said, I did also look back at them yesterday after talking to the client and decided that we will proceed as I explained earlier today.

I am still debugging some custom code which I added to our child themes functions.php relating to the issue we were having and I believe the problems we are running into at this point are related to the wp_query code we are adding to functions.php so we can use a custom shortcode to receive the outcome we are looking for our visitors to experience.

That said, I want to keep debugging this and doing the redesign before we mark this thread as resolved. I just wanted to share a short update so you knew that I still was not sure if we need the GP functions disabled or not.

After a ton of digging and research we have finally figured out that both the plugins and our custom written code which was saved in the functions.php of our child theme was being triggered by a failed plugin update (unrelated to the search plugins) and some server-side caching issues.

Thank you for your ongoing top-notch support!

Glad you got it sorted :)

Hi, Quick question. I am putting it in this thread which is resolved because I use threads I started as a way to keep track of things I did on while working a particular project that relate to each other.

So I was looking into some things about doing lazy load and found this thread: https://generatepress.com/forums/topic/adding-class-to-disable-lazyload-on-featured-image...
If I add the class to do this will it only be used for images on the page that are in a wp_query which are using a short code? If not, is there a way to modify the class so that it will only do it for the images that are part of that short code?

This is just a curiosity question, thanks in advance for your help.

Hi there,

I'm not too sure what you mean. Are you wanting to add the skip-lazy class to the core featured images? Or are you wanting to add it to a shortcode built to display featured images?

This archived topic is closed to new replies.