• Hey everyone.
    I’m creating an portfolio for a course on my university, and I decided I wanted to add an searchbar in the footer of the site.
    The site url is https://www.mortenschubert.com/blog/home
    The theme im using is called Minimal Dessign.
    As you can see, the searchbar in the footer is functional, but the search-function itself isn’t really working.
    There are several problems:
    – When I search for something (like Changelog) it generally only finds one post, even though there are several others (I’ve added tags and they have the same title, different version number, see the page ChangeLog for more info.)
    – When I search for something and the searchbar DOES find something, I don’t know where to add my right_content (the small images on the right, as seen on every other page)
    – When it DOESN’T find anything, I can add the right_content, but I can’t add border, background etc. for this page.

    How do I make them look alike, and what should I add in the style.css file to make the background and border appear on both sites?

    Searchform.php:

    <form method=”get” class=”searchform” action=”<?php echo home_url(); ?>” >
    <div>
    <input type=”text” value=”” name=”s” class=”s” />
    <input type=”submit” class=”searchsubmit” value=”Search” />
    </div>
    </form>

    Search.php (copied from the TwentyTen theme)

    <?php
    /**
    * The template for displaying Search Results pages.
    *
    * @package WordPress
    * @subpackage Twenty_Ten
    * @since Twenty Ten 1.0
    */
    get_header(); ?>

    <div id=”container”>
    <div id=”content” role=”main”>

    <?php if ( have_posts() ) : ?>
    <h1 class=”page-title”><?php printf( __( ‘Search Results for: %s’, ‘minimal dessign’ ), ‘<span>’ . get_search_query() . ‘</span>’ ); ?></h1>
    <?php
    /* Run the loop for the search to output the results.
    * If you want to overload this in a child theme then include a file
    * called loop-search.php and that will be used instead.
    */
    get_template_part( ‘loop’, ‘search’ );
    ?>
    <?php else : ?>
    <div id=”post-0″ class=”post no-results not-found”>

    <h2 class=”entry-title”><?php _e( ‘Nothing Found’, ‘minimal dessign’ ); ?></h2>
    <div class=”entry-content”>
    <p><?php _e( ‘Sorry, but nothing matched your search criteria. Please try again with some different keywords.’, ‘minimal dessign’ ); ?></p>

    </div><!–//content–>

    </div><!–//left_container–>

    <?php get_search_form(); ?>

    </div><!– .entry-content –>
    </div><!– #post-0 –>

    <?php endif; ?>

    </div><!– #content –>

    <div class=”right_container”>
    <div class=”right_sidebar”>

    <?php
    global $post;
    $myposts = get_posts(‘numberposts=20&category_name=Featured Small’);
    foreach($myposts as $post) :
    setup_postdata($post);
    ?>

    <?php
    if ( has_post_thumbnail() ) {
    ?> “><?php the_post_thumbnail(‘featured-small’); ?> <?php
    } else {
    ?> “><img src=”<?php echo catch_that_image() ?>” width=”172″ height=”104″ /> <?php
    }
    ?>

    <?php endforeach; ?>

    </div><!–//right_sidebar–>

    </div><!–//right_container–>
    </div><!– #container –>

    Edit: Oh, I’ve also added the loop.php, loop-page.php, loop-attachment.php and the loop-single.php page from the TwentyTen theme (not sure if they’re used for anything, but it seems like they are, so I just copied them.)

    Would really appreciate the help.
    Thanks.
    xSchubert

  • The topic ‘Styling custom search page – can't get the same layout’ is closed to new replies.