WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sidebar not working with search or tags (7 posts)

  1. florenciacazaban
    Member
    Posted 1 year ago #

    hi!

    i run a site, which has the "simplegrid" responsive theme installed.
    blog address is:
    http://www.lafabricadepensamientos.com

    i don't want a sidebar in my blog, and managed to remove it from single posts and pages.
    now, if i run a search in the search engine, the excerpts get displayed in 2 columns rather than in 3 -the correct way, same as in home page-. i believe this is due to the fact the sidebar function is still present somehow.

    also, i have added tags into posts (a function that doesn't come with the theme). since then, when i try to gather tagged posts on one page, the footer messes up: it displays 2 columns rather than 3.
    again, i suspect this is related to the sidebar.

    any ideas to fix this??

    thank you!

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    please post a direct link to a tag archive or search result page where the problem can be seen.

    does the theme have a tag.php and/or search.php?

    where did you download the theme from?

  3. florenciacazaban
    Member
    Posted 1 year ago #

    hi alchymyth
    The Sweeper !!

    click here to see issue with tag and footer formating:

    http://www.lafabricadepensamientos.com/blog/etiqueta/pensamientos-en-imagenes

    and here to check how excerpts display when running a search:

    http://www.lafabricadepensamientos.com/blog/?s=lugares&x=0&y=0

    theme doesn't come with a tag.php, BUT i added one following the code in twenty ten theme. i did this because, as i said, the theme currently installed did not support tags and i figured that copying it straight from another theme would work (in fact, tags DO work fine, the only problem is this issue with the format).
    search.php was already in the theme.

    i downloaded the theme from the designer's web (dessign.net)

    thanks again :)

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the theme currently installed did not support tags

    support of tags does not depend on tag.php; archive.php or index.php will display any tag archive - http://codex.wordpress.org/Template_Hierarchy.

    copying it straight from another theme would work

    because the html structure depends on the theme, this might not work and couyld lead to layout problems.

    standard procedure would be to copy archive.php or index.php from the same theme, and edit this if necessary.

    the tag footer problem might be because the #content_container and #container divs are not closed before the #footer div;
    also reflected in the validation errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.lafabricadepensamientos.com%2Fblog%2Fetiqueta%2Fpensamientos-en-imagenes%2F&charset=%28detect+automatically%29&doctype=Inline&group=0.

    the search column problem might be in search.php - possibly a counter or so which adds a .home-post-box-last class to every second image and adds a <div class="clear"></div> (?)

  5. florenciacazaban
    Member
    Posted 1 year ago #

    i´ll start with the search problem... i checked what you suggested and there are both of the things you said. i tried to erase home_post_box_last from here

    div class="home_post_box home_post_box_last"

    but nothing changed. then i erased the this full line:

    <?php if($x == 1) { echo '<div class="clear"></div>'; $x = -1; } ?>

    but it only modified the first line of the search results parcially as you can see:

    http://www.lafabricadepensamientos.com/blog/?s=lugares&x=0&y=0

    i´ll show you the code so you can tell me what to erase (or modify) and what not to change. Sorry for this request but i´m a newbie... this is my search.php:

    <?php get_header(); ?>
    
            <div class="blog_left">
    
                <?php
    
                $x = 0;
    
                while (have_posts()) : the_post(); ?>
    
                    <?php if($x == 1) { ?>
    
                    <div class="home_post_box home_post_box_last">
    
                    <?php } else { ?>
    
                    <div class="home_post_box">
    
                    <?php } ?>
    
                        <!--<img src="<?php //bloginfo('stylesheet_directory'); ?>/images/blog-image.jpg" />-->
    
                        <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post'); ?></a>
    
                        <div class="home_post_title_cont">
    
                            <h3><?php the_title(); ?></h3>
                            <h4><?php the_category(); ?></h4>
    
                        </div><!--//home_post_title_cont-->
    
                    </div><!--//home_post_box-->
    
                <?php if($x == 1) { echo '<div class="clear"></div>'; $x = -1; } ?>
    
                <?php $x++; ?>
    
                <?php endwhile; ?>
    
    <?php if($x != 1) { echo ''; } ?>
    
                <div class="clear"></div>
    
            </div><!--//blog_left-->
    
            <?php get_sidebar(); ?>
    
            <div class="clear"></div>
    
    <?php get_footer(); ?>

    thanks!!

  6. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    do not delete anything;
    change both instances of if($x == 1) to if($x == 2) - see below:

    <?php get_header(); ?>
    
            <div class="blog_left">
    
                <?php
    
                $x = 0;
    
                while (have_posts()) : the_post(); ?>
    
                    <?php if($x == 2) { ?>
    
                    <div class="home_post_box home_post_box_last">
    
                    <?php } else { ?>
    
                    <div class="home_post_box">
    
                    <?php } ?>
    
                        <!--<img src="<?php //bloginfo('stylesheet_directory'); ?>/images/blog-image.jpg" />-->
    
                        <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post'); ?></a>
    
                        <div class="home_post_title_cont">
    
                            <h3><?php the_title(); ?></h3>
                            <h4><?php the_category(); ?></h4>
    
                        </div><!--//home_post_title_cont-->
    
                    </div><!--//home_post_box-->
    
                <?php if($x == 2) { echo '<div class="clear"></div>'; $x = -1; } ?>
    
                <?php $x++; ?>
    
                <?php endwhile; ?>
    
    <?php if($x != 1) { echo ''; } ?>
    
                <div class="clear"></div>
    
            </div><!--//blog_left-->
    
            <?php get_sidebar(); ?>
    
            <div class="clear"></div>
    
    <?php get_footer(); ?>
  7. florenciacazaban
    Member
    Posted 1 year ago #

    tried it but didn't work.

    anyways, i came with a different solution, which was copying search.php from default theme: got no errors and search function works just fine!
    and as for the tag-footer issue, as i couldn't fix it, i rearranged footer.

    all solved then.
    thanks for your time and assistance! :)

Topic Closed

This topic has been closed to new replies.

About this Topic