Jump to content

PHP + Wordpress


MuRRe

Recommended Posts

Hi!

First off, I don't know PHP almost at all.

I know some Java, but PHP is alot different. I started my own blog, its located at:

http://murre.x10hosting.com/

(sorry, in swedish).

The problem is, the search bar, I want to be able to get the search bar either just right to "Om bloggen, om oss...", or at all the way at the right, but at the navbar.

This is code of the navbar:

<div id="navbar">

<ul>

<li><a href="<?php echo get_settings('home'); ?>">Home</a></li>

<?php wp_list_pages('title_li=&depth=1'); ?>

 

<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">

<input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />

<input type="hidden" id="searchsubmit" value="Search" />

 

 

</ul>

</div>

 

I just took the form for the search from another php file (i just downloaded a theme) and ctrl-v.

I have tried to make it work, but i just can't do it. It comes underneath insted of next to the navigation.

 

 

Thanks in advance

MuRRe

Link to comment
Share on other sites

I doubt this will work but you can try it:

 

<div id="navbar">
   <div id="blah">
    <ul>
      <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
      <?php wp_list_pages('title_li=&depth=1'); ?>
    </div>
    <div style="float: right">
<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
   <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
   <input type="hidden" id="searchsubmit" value="Search" />
   </div>

   </ul>
</div>

 

To find an answer, I would google CSS align div right    or something similiar should be plenty of examples. I just hate CSS cause of how much a pain it is to get right in all the browsers, so yea.

Link to comment
Share on other sites

I doubt this will work but you can try it:

 

<div id="navbar">
   <div id="blah">
    <ul>
      <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
      <?php wp_list_pages('title_li=&depth=1'); ?>
    </div>
    <div style="float: right">
<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
   <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
   <input type="hidden" id="searchsubmit" value="Search" />
   </div>

   </ul>
</div>

 

To find an answer, I would google CSS align div right    or something similiar should be plenty of examples. I just hate CSS cause of how much a pain it is to get right in all the browsers, so yea.

Lol, almost.

It moved to the right, but didn't move up. I will have to investigate further,

Link to comment
Share on other sites

<div id="navbar" style="float: left;">
   <ul>
      <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
      <?php wp_list_pages('title_li=&depth=1'); ?>
   </ul>
</div
<div style="float: right;">
<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
   <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
   <input type="hidden" id="searchsubmit" value="Search" />
</div>
<div style="clear: both;">
</div>

 

something like that should do it

Link to comment
Share on other sites

<div id="navbar" style="float: left;">
   <ul>
      <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
      <?php wp_list_pages('title_li=&depth=1'); ?>
   </ul>
</div
<div style="float: right;">
<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
   <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
   <input type="hidden" id="searchsubmit" value="Search" />
</div>
<div style="clear: both;">
</div>

 

something like that should do it

 

And it "almost" did.

The result (in FireFox/IE anyways).

http://picasaweb.google.se/marten.cederholm/DifferentStuff#5277250008917872066

Link to comment
Share on other sites

<div id="navbar">
<div style="float: left;">
   <ul>
      <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
      <?php wp_list_pages('title_li=&depth=1'); ?>
   </ul>
</div>
<div style="float: right;">
<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
   <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
   <input type="hidden" id="searchsubmit" value="Search" />
</div>
<div style="clear: both;">
</div>
</div>

 

there we go!

Link to comment
Share on other sites

<div id="navbar">
<div style="float: left;">
   <ul>
      <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
      <?php wp_list_pages('title_li=&depth=1'); ?>
   </ul>
</div>
<div style="float: right;">
<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
   <input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
   <input type="hidden" id="searchsubmit" value="Search" />
</div>
<div style="clear: both;">
</div>
</div>

 

there we go!

 

Can't get it to look nice for me!!!

 

How about this

<div id="navbar">

<ul>

<li style="float: right;"><form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">

<input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />

<input type="hidden" id="searchsubmit" value="Search" />

</form></li>

<li><a href="<?php echo get_settings('home'); ?>">Home</a></li>

<?php wp_list_pages('title_li=&depth=1'); ?>

</ul>

</div>

 

But it still gets a little down:

http://picasaweb.google.se/marten.cederholm/DifferentStuff#5277252152183380914

Link to comment
Share on other sites

Add this:

style="margin-top:-3px;"

 

to this:

<input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />

 

<input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" style="margin-top:-3px;" />

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.