dan.tee
Forum Replies Created
-
SOLVED! Thanks kill-switch413! I don’t think I’d have got that far without your help. Turns out that sidebar.php had secondary widget area outside my designated side bar divs. Not a problem on all the other pages – they weren’t calling secondary widgets. But Blog apparently must be.
But it’s all fixed now, praise God! Thank you sir, very much indeed.
ah ha! The reconstruction of index.php without the php includes for footer, header and sidebar has just worked a treat. So now I will try replacing the includes one at a time, and we’ll see where we get to. The light is on at the end of the tunnel!
OK, my mistake here: Blog uses index.php to construct itself. We might be getting somewhere now:
<?php get_header(); ?> <div class="contentContainer"> <div class="leftContentContainer"> <div class="leftContent">test of theory <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and that will be used instead. */ get_template_part( 'loop', 'index' ); ?> </div> <!-- end of entry --> </div> <!-- end of post --> </div> <!-- end of leftContent --> </div> <!-- end of leftContentContainer --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Hi killswitch – only just read your post. Will try what you suggest with the UTF-8 and will check again for dodgy tags. I’m also working in Dreamweaver on the Mac by the way, so I don’t have access to Notepad. Here’s the page.php:
<?php /* Template Name: Snarfer */ ?><?php /** * The template for displaying all pages. * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages * and that other 'pages' on your WordPress site will use a * different template. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div class="contentContainer"> <div class="leftContentContainer"> <div class="leftContent">test of theory <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( is_front_page() ) { ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php } else { ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php } ?> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-content --> </div><!-- #post-## --> <?php comments_template( '', true ); ?> <?php endwhile; ?> </div> <!-- end of leftContent --> </div> <!-- end of leftContentContainer --> <?php get_sidebar(); ?> <?php get_footer(); ?>
now it turns out that the blog page is refusing to use the template I tell it to. I’ve added a text snippet (Literally, straight into the HTML) to all of index, page, sidebar of ‘test of theory’. It appears on ALL sections and pages of the site, indicating that they are all using the same template, yet when the Blog page loads, the site structure breaks. No matter what I set as the template page for Blog in the admin, it’s defaulting to using the defaults. Which work fine on all the other pages.
So I’ve just tried making one of the other pages use the new page template that the blog page is using… and it works just fine. Something about the fact that the blog page has The Loop on perhaps or just blog posts in general is breaking the ability of the underlying CSS to make the ‘columns’ match each other in height. I think I’m going to cry now.
Thanks for your input folks, particularly @killswitch. I’ve now made the blog page use the page.php template by giving page.php a template name as copied from the text above (yes, I’ve even used ‘snarfer’!) However, the problem persisted, suggesting therefore that something was wrong with page.php. So… I made a copy of page.php, stripped out the php where it was calling for the structural elements (header, footer, sidebar), and pasted back in the html (copied from the PHP docs) for those items. View it locally on my browser – works fine. Upload it to the top level of the site (www.surgicalscousers.co.uk/page.htm) it works fine. But the same file, with a new doc name and the template info added, and loaded to the site, and the blog page made to use it as the template… displays the same problem. So far as I can tell, there’s nothing wrong with the code – WP just won’t show it right, and only on that page!
Help!!
Forum: Themes and Templates
In reply to: sidebar jumps on posts pageI’m not an expert but my guess is that the loaded post content area is wider than the content area on any other page. It therefore forces the sidebar to appear in the next available position, which would be underneath. Check your CSS to see if there’s any margin discrepancies? That’s where I’d start anyway…
I’ve now uploaded the offending website to https://www.surgicalscousers.co.uk.