• I have a dynamic sidebar running in WP 2.8.5. and I want to get rid of the header on the Search widget.

    It’s easy to do this for a static sidebar, and it’s easy to get rid of headers for ALL widgets in the sidebar.

    I assume I would need to do this in the PHP of the search widget itself, but I can’t figure out where the default search widget code is located amongst the various WordPress files.

    My test blog is here: https://metapedia.metapede.com/

    Again, I just want to get rid of the “SEARCH” header above the form, but I want to keep the headers for the other widgets I have running.

Viewing 13 replies - 1 through 13 (of 13 total)
  • i don`t see no header abobe the search form. Are you talking about the SEARCH word above the actual form?

    Thread Starter metapede

    (@metapede)

    A little more info:

    I’ve gone and deleted the header HTML (the <h2>Search</h2> line) from the search form in sidebar.php, but this did not affect the search widget on my site. As you can see, the search form still has the <h2> header above it.

    Oddly, this header is different than the others in the sidebar. The others are wrapped in a simple h2 tag. The search header has a class attribute of “sidebartitle” inside the h2 tag.

    Thread Starter metapede

    (@metapede)

    @kiano.ro – Yes. I’m talking about the actual word “SEARCH” above the form. I can’t figure out how to get rid of it.

    @metapede – you have two ways:

    1.) Open your admin panel -> appearance -> widgets -> and see there if the search form is added there in your sidebar. If it is added this way, see if it has the title added and delete it. Use no title. Save it.

    2.) Open your admin panel -> appearance -> editor -> index.php (main index template) and search for this line and remove the “Search” word from h2

    <h2 class=”sidebartitle”> Search </h2> <form method=”get” id=”searchform” action=”https://metapedia.metapede.com/”&gt;

    Thread Starter metapede

    (@metapede)

    @kiano.ro

    Within the admin panel, the search widget has no settings. There is no setting for including, excluding or customizing the title of the search widget. The widget just says “There are no options for this widget.”

    Also, the search form is not part of my main index template. The main index template just calls the sidebar (sidebar.php). The search widget is in my sidebar, but the search form code is not there either. The sidebar just calls the widgets from somewhere else.

    There is a file called searchform.php, but this just includes the search function, not the appearance of the form.

    In my wordpress file system, I can find the widgets I installed myself, and there is a file in the wp-includes directory called “default-widgets” but I don’t know what to edit in there (or even if that’s the right place to look).

    admin panel -> appearance -> editor -> do you have there a .php called sidebar.php?

    Thread Starter metapede

    (@metapede)

    @kiano.ro – Yes. I mentioned above that I removed the <h2>Search</h2> code in the sidebar.php file.

    However, that file defines the default sidebar, not the dynamic sidebar. I have a dynamic sidebar, and I added the Search widget from the admin panel. appearance -> widgets. I can’t figure out how to remove the “Search” title from this widget without removing it from all my widgets.

    Oh, know i understand. The search form is added by you? Ah, i see. But it is strange the fact that in your appearance -> widgets you don`t have any options for search form. Drag&drop it out and drag&drop it back and see if you get any option. Normally the search form added throw widgets has to have a title option where you can add title.

    Thread Starter metapede

    (@metapede)

    Yes, I seem to remember the widgets having a title option, but it’s not there in my version (2.8.5.). Very strange.

    I really cannot help you then. All the normal posibilities are gone… Maybe you cannot take out that headline if you don`t have any title options.

    Try to find the search form in your wordpress folder (NOT IN YOUR THEMES FOLDER) throw your ftp client.

    Thread Starter metapede

    (@metapede)

    @kiano.ro – Thanks for trying. Have a good weekend.

    try adding this line at the end of the style.css:
    #sidebar h2.sidebartitle {display:none;}

    worked in firefox with the developer addon ??

    Thread Starter metapede

    (@metapede)

    @alchymyth – Of course! The solution was hanging out there in front of me the whole time, and I didn’t think of it. Of course! That widget title has a class attribute and the other widgets don’t, so… d’oh. Thanks for opening my eyes ??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to remove header from one widget?’ is closed to new replies.