Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #165283

    I’m using the Enfold them, and have sidebars on all my pages other then my front page, which is a custom home page. I have the search widget in the sidebar, which generates a nice large search box on all the pages other than the front page, for which I don’t want to put a sidebar. But I can’t seem to get the same search box to show up on the front page.

    As a test, I’ve been able to put this search box on an ordinary page, pasting the widget code into a text box on an ordinary page. No problem. But when I try that on the front page, it gets knocked out by the system. I assume there must be some special problem with using that code on a front page.

    Here is the code I’ve successfully used on an ordinary page, but can’t get to stick on the front page:

    <div class=”widget clearfix widget_search” id=”search-2″><form id=”searchform” action=”http://northshoreunitarians.ca/&#8221; method=”get”>
    <div><input class=”button” id=”searchsubmit” type=”submit” value=”

    • This topic was modified 11 years, 2 months ago by jbiasucci.
    #165414

    Hey jbiasucci!

    What theme are you currently using? You can use this code on your header.php:

    /*
    							* Display the search form
    							*/
    							get_search_form();

    First, we need to know what kind of theme you’re using.

    Best regards,
    Ismael

    #165488

    Hi Ismail,

    I’m using Enfold. Actually, I mentioned it at the start of my question. Enfold is a great theme and this is the second site I’m building with it.

    Please note I’m OK with html and css, but know very little about php. Can you explain in more detail how I would follow your instruction to “use this code on your header.php.” I assume I would edit the header.php file, but would I insert a new line, and, if so, where in the file?

    Thanks,

    John

    #165939

    Hey John,

    If you want it in the header then you would be adding that code to the header.php. Its a function to display the WordPress search form wherever its placed. You would then need to wrap it in a div and position it with css.

    Alternatively, you could put a widget area in your home page layout using the advanced layout editor and then just put a search widget into that specific widget area.

    Regards,
    Devin

    #166194

    Hi Devin,

    Ok. I see my mistake. I hadn’t noticed the widget area content element in the advanced layout editor before. Problem solved. I just added a widget area to the front page, inserted the search widget, and it looks just fine.

    Thanks,
    John

    #166477

    Glad its working for you now :)

    Regards,

    Josue

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Can I put the search widget on front page without a sidebar?’ is closed to new replies.