Wordpress and Webdesign Forum go41 » WordPress Code Snippets

  1. Hi Joern,

    I'm finally updating all of our static content which means more content heading up to the nav bar and consequently things are getting a bit crowded.

    What I'd really like to do is move the search bar so that it sits below the main nav bar. I'd like it to appear on every page and look neat but I really need the space on the nav bar so it's got to move somewhere!

    Could you let me know what I'd need to do to move the searchbar underneath the nav bar so it looks well formatted, and so that it appears on every page?

    Thanks Joern,

    Andrew.

    Posted 1 year ago #
  2. adamwork
    Member

    Hi Andrew

    You still need to keep <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    in your header, which will ensure that it appears on every page.

    Then just change the css, to alter it's position/colour etc.

    Depending on the theme your using, if its arthemia, it's called #searchform

    Hope this helps

    Posted 1 year ago #
  3. Brilliant, thanks Adam. Sorry to ask for extra help but could you give me an idea of how style.css would change to put the form under the nav bar?

    Posted 1 year ago #
  4. adamwork
    Member

    You could try something like
    margin-top:40px;
    which might help to push it down out of the navbar...

    Posted 1 year ago #
  5. Andrew, you could try to move:

    <?php include (TEMPLATEPATH . '/searchform.php'); ?>

    in header.php some lines up, into your div class="right" just below the end of your oio-banner-..

    It will be under the banner than, you got some space there

    or just copy it, you will see it twice, for testing only.

    doing as adam suggests will double up your navbar, not really nice...

    about your 'static content': I believe (not sure) that static pages are not so good as posts in terms of SEO. Pages do not appear in feeds, that's why I think this.

    I would create posts in new categories instead updating or even extending pages.
    Just my opinion, you should explore your site stats (if possible) and check which posts or pages peoples arrive on your site.

    Posted 1 year ago #
  6. Thanks very much for all the suggestions. Joern I think you're right it will look best above the nav bar - the only issue is that the magnifying glass looks really weak on a white background. Can I delete that image or change the background for the search bar?

    Also how do I change the text for that search bar?

    Posted 1 year ago #
  7. this search bar is actually the file searchform.php

    here you find the text to change - Search the archive...

    you are free to change it as well as the image arthemia/images/magnify.gif

    you might try the searchform.php from the default theme of your wordpress

    you could also use

    <?php get_search_form(); ?>

    to get a default search bar, explained here:

    http://codex.wordpress.org/Function_Reference/get_search_form

    Posted 1 year ago #
  8. Wicked, I just added a new Go! gif into the folder and pointed it at that. Much neater. Thanks Joern.

    My only confusion now (!) is that when I add anything onto the nav bar it automatically adds it onto a second line of the nav bar, as if it's keeping a space for the search bar. I'd really like to use that free space now!

    Posted 1 year ago #
  9. right, your navbar entries are in a div:

    #page-bar {
    width:722px;
    }

    I think now you could change this to

    #page-bar {
    width:940px;
    }

    and use a bigger go.gif...

    good luck

    Posted 1 year ago #
  10. BLESS YOU YOU WONDERFUL INTERNET STRANGER!

    Posted 1 year ago #
  11. Nevermind: turns out I needed to limit the size of the navbar.

    Sorry to reopen this, but I definitely cannot move my search box. My problem is a bit different though in that I had commented it out of the header.php and then place it instead in the sidebar widget. However, now due to design changes, I want it back in the original location but I cannot get it there at all!

    Any suggestions?

    http://www.lisuncg.net

    Posted 1 year ago #
  12. this is solved I guess?

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Join us! or log in (lost password?):