by alanaj
4 replies
  • WEB DESIGN
  • |
Hi WF,

I apologize if this is in the wrong place. If it is, please let me know and I'll move my post. I have a customized WP theme but there are two issues that I really need help with.


1. My search box doesn't work.

Style.CSS code:

searchr{width:126px;height:28px;background:url(ima ges/searchbg.png);right:0;}

.searchr input[type="text"]{border:0;margin:6px 0;margin-left:3px;padding:1px;width:95px;background: none !important; height:18px;float:left;color:#666666;font-family:Arial;font-size:13px; font-weight:bold;}

.searchr input[type="image"]{width:20px;height:27px;float:right;margin:0px;mar gin-left:0;}

#sform{width:300px;height:20px; font-size:12px; padding:2px; }

#s{width:180px;height:15px;border:#333333;backgrou nd:url(images/search.png) no-repeat;padding:5px;}

#s input{height:25px;width:50px;}

#searchsubmit{font-weight:bold;color:#CCCCCC;width:65px; padding:4px;height:19px;background:#364040; }

.searchform input{vertical-align:middle;}


Then the search box code on the page templates is:

<div class="searchr">

<form id="searchform" action="<?php bloginfo('url'); ?>/">

<input name="s" value="Search Site..." onfocus="if(this.value==this.defaultValue)this.val ue='';" onblur="if(this.value=='')this.value=this.defaultV alue;" type="text">

<input src="<?php bloginfo('template_directory'); ?>/images/space.gif" value=" " type="image">

</form>

</div>




2. The main page template doesn't work. Here is the code:

<?php query_posts('posts_per_page=4&cat=4');

if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<div class="grey"><!--grey start-->

<div class="grey_heading"><?php echo the_title() ?></div>

<div class="grey_text">

<?php $content=get_the_content(); echo substr(strip_tags($content),0,260);?> <a href="#">Read more...</a>

</div>

</div><!--grey end-->

<?php endwhile; endif; ?>

<div style="clear:both;"></div>

<?php query_posts('posts_per_page=1&cat=7');

if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<div class="heading"><?php echo the_title() ?></div>

<div class="text">

<?php $content=get_the_content(); echo $content;?>

</div>

<?php endwhile; endif; ?>

<br />

</div><!--content end-->

Any and all help is greatly appreciated. Thank you in advance!
#coding #php coding #wordpress
  • Profile picture of the author Karen Blundell
    the search code has a space where there shouldn't be one:

    Code:
    <div class="searchr">
     
    <form id="searchform" action="<?php bloginfo('url'); ?>/">
     
    <input  name="s" value="Search Site..."  onfocus="if(this.value==this.defaultValue)this.val  ue='';"  onblur="if(this.value=='')this.value=this.defaultV  alue;"  type="text">
     
    <input src="<?php bloginfo('template_directory'); ?>/images/space.gif" value=" " type="image">
     
    </form>
     
    </div> 
    take the space out between the "l" and the "u" in value and try the form to see if it works

    in the the template file it looks like it's just calling posts from just category id 4 see here

    Code:
    <?php query_posts('posts_per_page=4&cat=4');
    just remove the 4 and it should work


    if it doesn't send me a pm and I'll take another look
    Signature
    ---------------
    {{ DiscussionBoard.errors[2613608].message }}
  • Profile picture of the author alanaj
    Hi Karen,

    Thanks for helping me out. I made the corrections you suggested but the search box still doesn't work and I still can't use the index template. I have to make a few more posts before I can send you a PM. Will send it tonight or tomorrow.

    Thanks again.
    {{ DiscussionBoard.errors[2616699].message }}
    • Profile picture of the author Karen Blundell
      Hi Alana,

      I sent you a pm. Take care.
      Signature
      ---------------
      {{ DiscussionBoard.errors[2617362].message }}
  • Profile picture of the author joomlawala
    I am a freelancer, I work PSD to XHML/any tempalte. I also work on Joomla, Wordpress, PHP, open source CMSs and eCommerce sites. Please contact me for your required site. I will quote..email me.
    Signature

    Masud
    Email me at: masud@softsubstation.com
    [to start PSD-to-XHTML/CSS $70; PSD-to-Joomla/WP $150 only]

    {{ DiscussionBoard.errors[2618823].message }}

Trending Topics