WordPress.org

Ready to get started?Download WordPress

Forums

Can't remove search feature from News page (5 posts)

  1. CTidnam
    Member
    Posted 1 year ago #

    I cannot get rid of the search feature on our news page: http://tmp.firststeptrust.org.uk/news/

    I disabled the search widget but that didn't work. Then I deleted the search widget but it still appears.

    Can anyone suggest how I can solve this problem?

    Thanks

    Catherine

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

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

  3. CTidnam
    Member
    Posted 1 year ago #

    Thanks very much - I will give this a go.

  4. Tom Combs
    Member
    Posted 1 year ago #

    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="http://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 } ?>
    
  5. CTidnam
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic