• Resolved massacre

    (@massacre)


    Hello!

    I have two search fields on 404 error page. I’ve check another blog, based on this theme and it’s the same. Any ideas how to edit to code in order to have only one field?

    Here is the code for no-results.php

    <?php
    /**
     * @package Serene
     * @since Serene 1.0
     */
    ?>
    
    <div class="entry no-results-found">
    	<h1><?php esc_html_e( 'Hmm. Weird! Nothing found. Maybe serch again?', 'Serene' ); ?></h1>
    
    <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
    
    	<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'Serene' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
    
    <?php elseif ( is_search() ) : ?>
    
    	<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'Serene' ); ?></p>
    	<?php get_search_form(); ?> 
    
    <?php else : ?>
    
    <!--	<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'Serene' ); ?></p>
    	<?php get_search_form(); ?> -->
    
    <?php endif; ?>
    </div>
Viewing 5 replies - 1 through 5 (of 5 total)
  • You have already placed HTML comments tag <!-- --> around it so it shouldn’t display in the browser. Can you share your website’s URL.

    I found the problem by using this theme in a local installation.

    The 2nd search box you are seeing is the one displayed by the <a href="http://codex.wordpress.org/Function_Reference/get_sidebar">get_sidebar()</a> function.

    When this function is called without any parameters it searches for the sidebar.php file but this theme doesn’t have one so from the codex

    If the theme contains no sidebar.php file then the sidebar from the default theme wp-includes/theme-compat/sidebar.php will be included.

    The solution here is to create an empty file named sidebar.php in

    /wp-content/themes/serene/sidebar.php

    this causes wordpress to display your widgets.

    Thread Starter massacre

    (@massacre)

    Thank you very much, jesin!

    You’re welcome, if the solution works can you mark this thread as resolved so that others having the same issue will find it useful.

    Thread Starter massacre

    (@massacre)

    Yes, of course! I forgot about it, thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘404 error page’ is closed to new replies.