Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You could use CSS to display none the search widget area, hiding it from view but still rendering it to search engines.

    Thread Starter CTidnam

    (@ctidnam)

    Thanks very much – I will give this a go.

    A better option than “display:none;” would be to check your themes sidebar.php file for the search code, from the source code, it doesn’t look like it is a widget.

    If you only want to hide the search on the news page, find the code for the search form, then wrap it in an if/else statement.
    something like this…

    <?php
    // If is news page, don't do anything
    if ( is_page('news') ) {
     }
     // Otherwise show the form
         else { ?>
    
    <form method="get" id="searchform" action="https://tmp.firststeptrust.org.uk/">
    	<div id="search-text">
    		<input type="text" value="" name="s" id="s" autocomplete="off" />
    	</div>
    	<input type="submit" id="searchsubmit" value="" />
    	<br class="clear">
    </form>
    
    <?php } ?>
    
    Thread Starter CTidnam

    (@ctidnam)

    Thanks Tom – we’ll try this as well. The odd thing is that it does appear as a widget and Dashboard allows you to disable it. Maybe this widget refers to something else.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can't remove search feature from News page’ is closed to new replies.