WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Searchbar (13 posts)

  1. therealhopeful
    Member
    Posted 7 years ago #

    Hello. When I try to run a searth a URL like this will be generated:

    http://www.correctnesscommentary.com/?search=test

    However, search.php does not appear get get loaded. I just loads my homepage. Any thoughts?

    Thanks.

  2. moshu
    Member
    Posted 7 years ago #

    You seem to have problems bigger than that: there is no style on your blog - and trying to see the stylesheet in FF dev toolbar gives a huge mess.

    Edit. And this is not "advanced" just a simple how-to. Moved.

  3. therealhopeful
    Member
    Posted 7 years ago #

    Hello moshu. Yes, I am aware that the style sheet for some reason does not load in FireFox or Netscape. (IE loads & looks great. Opera loads, but still needs some adjustment).

    If you look at the site in IE, you will see what I am referencing.

  4. moshu
    Member
    Posted 7 years ago #

    Wrong order. First fix the blog. Then deal with the details.

    What are the two URI values in admin > Options > General?

  5. therealhopeful
    Member
    Posted 7 years ago #

    WordPress address (URL): http://www.correctnesscommentary.com/wp

    Blog address (URL): http://www.correctnesscommentary.com

    Also, yesterday I went through the process described on this page:
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Thanks.

  6. moshu
    Member
    Posted 7 years ago #

    It seems you did something wrong during the "process"... that's why you don't have style on your main page.

  7. therealhopeful
    Member
    Posted 7 years ago #

    Well, the only deviation from the process that I made was some additions to the .htaccess (step 7) file.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    Options -Indexes
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?test.correctnesscommentary\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
    AddType application/x-httpd-php .css [NC]

    Okay, so I went back and looked at step 11, where it tells you to adjust the permalinks. It also says that I may need to update the .htaccess file. I tried copying the wp/.htaccess file to / but I didn't notice any difference in the search ability.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>
    
    # END WordPress
    
    Options -Indexes
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?test.correctnesscommentary\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]
    AddType application/x-httpd-php .css [NC]

    Any thoughts? Thanks.

  8. moshu
    Member
    Posted 7 years ago #

    I don't have any thoughts about the search... because that's not the issue here. Your blog doesn't display properly (it doesn't find the stylesheet) - so nothing will work until you fix it.
    A very common mistake is occuring with #7. It doesn't say "move" - it says "copy", which means you have them in both locations!

  9. therealhopeful
    Member
    Posted 7 years ago #

    Hello moshu. I am working on the CSS issue. However, frankly, CSS has absolutely nothing to do with the functionality of a webpage; it just affects layout, coloring, formats, etc. If it's that big of an issue for you, the CSS does render in IE and Opera. Regarding 'move' versus 'copy', I did 'copy' the file; I did not 'move' it. After copying the file, I appended my custom rules to the end of it. Now, I'm no expert on the .htaccess sytax, but just by looking at it (and applying some general programming rules) there does not appear to be any conflicts. Perhaps you can enlighten me, if I am wrong.

    All of this aside, as none of it is affects the functionality of the WordPress search bar (all the other WordPress links work just fine), do you know where I can find any documentation regarding how the_search_query() works? Thanks. :)

  10. Doodlebee
    Member
    Posted 7 years ago #

    However, frankly, CSS has absolutely nothing to do with the functionality of a webpage

    No, but it's a symptom of the bigger issue. What you're trying to do is cure the abdominal pains from a stomachache before dealing with the full-on cancer diagnosis. However, if you deal with the *cancer* itself, the stomach pains will go away, as well as a host of other issues related to it. That's what moshu is trying to tell you.

    Fix your issues and if the whole problem isn't completely fixed, then you'll be one gigantic step in getting your problem resolved.

  11. moshu
    Member
    Posted 7 years ago #

    as none of it is affects the functionality of the WordPress search bar (all the other WordPress links work just fine)
    1. That's what you think.
    2. No, they don't. WP can't even find its stylesheet, so there is something wrong with the home/site_url settings.
    3. Now, the search form usually works based on that, e.g.
    <form id="searchform" method="get" action="<?php bloginfo('home'); ?>"> - it won't work, until you clean up the mess.
    4. Sorry, I don't know anything about .htaccess. However I'd give it a try without your custom rules, just the WP stuff...
    5. I am afraid that's all I could offer.

  12. therealhopeful
    Member
    Posted 7 years ago #

    Okay, my site now validates. Most of the validation problem was from an error in the PHP script that generates those long referral lists in the sidebar. Unfortunately, the searchbar still does not work. I've stripped down my .htaccess file to the following:

    AddType application/x-httpd-php .css [NC]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Unfortunately, the AddType statement at the top cannot be removed because it enables PHP to be run in my stylesheet. Without it the entire color schema falls apart.

    It should be noted that the .htaccess file at in the WordPress installation directory differs slightly. WordPress changed the file, after I copied it to my root directory:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>
    
    # END WordPress

    Also, when I was customizing the template I stripped out a lot of the header. Here's what left:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <?php /* printing meta keywords */
      include ("__db_open.php");
      print ("<meta name=\"keywords\" content=\"");
        $query  = "SELECT cat_name FROM wp_categories ORDER BY cat_name ASC";
        $result = mysql_query($query,$link);
        while($record = mysql_fetch_row($result)) {
          print ($record[0].", ");
          }
      print("\" />");
    ?>
    <meta name="description" content="Correctness Commentary: Dedicated to shining the light of the gospel on the moral decay of this world." />
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    </head>
    <body>
    
      <div class="container">
    
      <div class="header">
        <div class="headerbanner"><?php include("__short_banner_ad.php"); ?></div>
        <?php include (TEMPLATEPATH . '/searchform.php'); ?>
      </div>
    
      <div class="midsection">

    Searchform.php remains as follows:

    <div class="search">
      <form method="get" id="search" action="<?php bloginfo('url'); ?>/">
        <input class="search" type="text" value="<?php the_search_query(); ?>" name="search"/>
      </form>
    </div>

    Any thoughts/suggestions are much appreciated. :)

  13. therealhopeful
    Member
    Posted 7 years ago #

    This problem is now resolved. It was related CSS, but CSS was not the problem itself. As it turned out, when I changed some of the id specifiers in the search form that caused it to break. After changing them back to their defaults, the search ability now works again! ^_^

    <div class="search">
      <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
        <input class="search" type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
        <!-- <input type="submit" id="searchsubmit" value="Search" /> -->
      </form>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic