• Hallo

    I have been customising a theme and have created a page that will only show posts from a specific category. The problem that I am having is that this page also has a sidebar. All was well until I put a second post on the page which made the sidebar move.

    I’ve been trying to find a fix but as yet have had no joy. I’m sure it’s a problem with the code for the page I just don’t know what or where.

    The code looks like this:

    <?php get_header(); ?>

    <div class=”archive_single”>

    <div class=”left”><< <?php previous_post_link(‘%link’) ?></div>
    <div class=”right”><?php next_post_link(‘%link’) ?> >></div>
    <div class=”clear”></div>

    </div>

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

    <div class=”single”>

    <div class=”single_post”>
    <h3><?php the_title(); ?></h3>

    <?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>

    <?php the_tags( ‘<p>Tags: ‘, ‘, ‘, ‘</p>’); ?>

    </div>

    </div>

    <?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    And here is a link to the page so you can see the sidebar problem:

    http://mr-o.com/news/?cat=10

    I would really appreciate help with this as I’m a little out of my depth. I’ve also tried to find the solution myself but have failed.

    Big thanks in advance, Mat

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter matmochdre

    (@matmochdre)

    Would really appreciate some help with this. Is there someone out there that can help?

    There are posts of this nature on a daily basis, if you have a look through the numerous other threads you will find how to resolve the problem.

    Problem will be related to a Float or Clear, more then likely.

    Thread Starter matmochdre

    (@matmochdre)

    Thanks for the reply. I have taken a look at previous posts as well as done Google searches. The problem is I’m not so great at coding and can’t seem to pin point the cause the cause of my particular problem in the layout I am using. Hence the request for help from someone with better coding knowledge than myself.

    Well you managed to make your theme ok, if you’re capable of doing that i’m sure you’re capable of reading up on how to float and clear elements….

    http://www.google.co.uk/search?q=css+float+clear&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a

    Looking at the page i’m not sure the sidebar is placed correctly to float next to the posts…

    Have a read regarding floats.

    Many other themes can float sidebars, so you can always refer to another for example code..

    Thread Starter matmochdre

    (@matmochdre)

    The theme so far has been 2 straight weeks of trail and error. Well that’s 2 weeks of evenings. Opening pages from a theme that already existed in Dreamweaver and then deleting lines of code, copying and pasting a few from other pages then uploading the page to see what had happened. Sometimes I get lucky and it looks good. Other times it looks pants or I just see an error message and so I start again from scratch.

    Not an ideal process but it has got me this far. I thought that I had cracked it and arrived at a design I was happy with. I’d even managed to create a page that only shows posts from a certain category. Pretty advanced stuff, or so I thought. It looked great when it had just the one post on this page. I added a second post and the sidebar shifted.

    I wish I was better at coding and I could put my finger on what and how it went wrong. Unfortunately I can’t and my trail and error process isn’t working with this problem no matter how many variations of the code I try. So it’s become really frustrating to have got this far and have this one small element ruin the design.

    Thanks for the replies so far. I’ll take a look at what you provided, hopefully understand it and then place the right code, in the right place, in the right document.

    Fingers crossed.

    Also run your pages through this…

    http://validator.w3.org/

    It will point out any problem tags, unclosed, unopened, etc…

    If you have Dreamweaver, why not play around with some test code in DW first to get the idea of how elements work before you go plonking them into the theme code..

    There’s also piles of FREE CSS templates around the web that you toy around with, they should give you a good idea of how to get elements positioned etc.

    I learnt the very same way…. 😉 Copy, paste, modify, copy, paste, break it, start again, copy, paste….. lol… i’m sure you get the idea. We all start somewhere… 😉

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Code problem that I just can’t fix it. Please help!’ is closed to new replies.