the linked page uses the ‘sidebar template’ and displays fine (at least for me in FF20)
do you have any pages with the sidebar problem evident?
what is the full code of those ‘PHP include file which I use as a template’?
Twenty Eleven uses the body_class() .singular to control the layout with or without sidebars (done in functinos.php of the theme); you will probably need to adjust that together with your included php;
be aware that any customisations will get lost when you update the theme; consider to create and use a child theme for customisations – http://codex.ww.wp.xz.cn/Child_Themes
You don’t see that the content is pushed down? It looks like that when I use Firefox and Opera. Haven’t checked in other browsers.
I always download WP themes so there’s always a backup on my computer in case I screw up the theme.
Here’s the template:
<?php
/**
* Template Name: Sidebar1
* Description: A Page Template that adds a sidebar to pages
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
<?php include ('sidebar1.php'); ?>
And the PHP include file: <div id=”secondary”>
<h1>Biografi</h1>
<h1>Historik</h1>
<h1>Diskografi</h1>
</div> <!– end #sidebar1 –>`
the body_class output of your linked page indicates to me that the page is using a page template with the file name sidebar-page.php (which is one of the default templates of Twenty Eleven):
<body class="page page-id-93 page-template page-template-sidebar-page-php single-author two-column right-sidebar">
under which file name have you save the posted page template ‘Sidebar1’ ?
I now see the problem with the pushed-down content column;
this might be caused by the fact that the linked page’s html output in the browser does not match the structure of your posted template code; for instance, the ‘sidebar’ appears before the content…
the browser also shows some attempted code in teh content of the page:
...
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p><?php get_sidebar('sidebar1'); ?></p>
btw: the sidebar should be called before the footer.
possibly review http://codex.ww.wp.xz.cn/Function_Reference/get_sidebar
I removed that sidebar code in the entry text. Not sure how it got there.
I also moved the sidebar code above the footer code. Still looking the same though.
The Sidebar1 template is just called sidebar1
Ok it’s working now. This is why I shouldn’t code when I’m tired. Like you pointed out, I used the wrong template. Before my own wasn’t visible in the list so I must have clicked the wrong one. Now it’s visible and working.
Thank you for the help. It’s much appreciated.
check the code in sidebar-page.php
also check which page template is attributed to the page with the ID 93 (‘BIO’ ?)
well done 😉
Ok it’s working now.
that is because you probably have attributed the right template to that page;
this is the body tag now:
<body class="page page-id-93 page-template page-template-sidebar1temp-php single-author singular two-column right-sidebar">
I can tell it is now using the template file sidebar1temp.php