Search Keywords & Fix Side Bar (2 posts)

  1. mariusveq
    Posted 3 years ago #


    I have two enigmas for you guys:

    1. I have a very simple theme for my blog, and I want the search button to give me results not only from the titles but also from the keywords that I introduce for every post. This is what I have in search.php:

    <?php get_header(); ?>
    <div id="post-area">
       	  	  <div id="post-<?php the_ID(); ?>" class="page type-post">
                                <div class="stumblr-title"><h1>Search Results</h1></div>
                  <div class="stumblr-content">
               		 <?php if (have_posts()) : ?>
                            <?php while (have_posts()) : the_post(); ?>
                       <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
                            <?php endwhile; ?>
                        <?php else : ?>
                                <p>No Results</p>
                        <?php endif; ?>
         <div class="clear"></div></div><!-- end page -->
    <?php get_footer(); ?>

    2. I have a sidebar and the loop page, the page with the posts. On the sidebar I have only the logo of the blog and under it the search box. What I need is to fix this two, so when I scroll the only things that moves is the posts page. This is from the style.css:

    /* sidebar styles */
      #stumblr-sidebar     { width:200px; display:inline; float:right; margin-top:80px; }
      #logo 			 { margin-bottom:10px; width:200px; overflow:hidden; }

    This is from the header.php

    <div id="wrap">
    	<div id="stumblr-sidebar">
        	<div id="logo">
            	<a href="<?php echo home_url( '/' ); ?>"  title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    				<?php if ($stumblr_logo != '') {?><img src="<?php echo $stumblr_logo; ?>" alt="<?php bloginfo('sitename'); ?>"><?php } else { ?><img src="<?php echo get_template_directory_uri(); ?>/images/light/logo.png" alt="<?php bloginfo('sitename'); ?>" width="200"><?php } ?>
    <?php if ( is_active_sidebar( 'stumblr_widgets')) { ?>
    <div id="sidebar-widget-area">
    <?php dynamic_sidebar( 'stumblr_widgets' ); ?>
    <?php }  ?>
    </div><!-- // stumblr-sidebar -->

    Any idea on what can I introduce so I manage the two problems?

    Thanks in advance,

  2. WPyogi
    Forum Moderator
    Posted 3 years ago #

    Not totally sure what you want with the sidebar - -but if you mean you want it to stay where it is while the rest of the page scrolls, you can do that using fixed positioning on the sidebar. See this for the CSS particulars:


Topic Closed

This topic has been closed to new replies.

About this Topic