Archived topic
disable search?
10 replies · Started by sdanbu on September 11, 2017
When URLS are incorrect, a search option appears that lets the user search the whole site.
GP has very handy ways to disable and enable features.
I would like to disable search on some websites.
Is there a way to use simple css or something to simply toggle search function on or off?
Not sure what you mean? You can just disable search in the customizer?
Oh I don't mean search in navigation.
When visitors go to an invalid url, they get a page (that looks like a biog post) that says "search the site..." and has a search field.
I'm talking about disabling that one
Like disabling that page? Then where would it link to when user enter invalid URL?
I think I need to change the 404.php page
I would probably delete the code:
<?php echo apply_filters( 'generate_404_text', __( 'It looks like nothing was found at this location. Maybe try searching?', 'generatepress' ) ); ?>
</p>
<?php get_search_form(); ?>
<!-- .entry-content -->
<?php do_action( 'generate_after_content'); ?>
<!-- .inside-article -->
<?php do_action('generate_after_main_content'); ?>
</main><!-- #main -->
<!-- #primary -->
But how else do I customize it? it shows a list of blog posts...
I think i would remove the code:
do_action('generate_sidebars');
But then how would I add a picture to the header of it?
do I add code: <?php do_action( 'generate_before_content' ); ?>
<header class="entry-header">
<?php do_action( 'generate_before_entry_title' ); ?>
<?php the_title( sprintf( '<h2 class="entry-title" itemprop="headline">', esc_url( get_permalink() ) ), '</h2>' ); ?>
<?php do_action( 'generate_after_entry_title' ); ?>
</header><!-- .entry-header -->
<?php do_action( 'generate_after_entry_header' ); ?>