New Template Breaks
-
Theme: twentyeleven
New Templates are located in the child theme.
Attempted to create a new template by using the following copied from index.php<?php get_header(); ?> <div id="primary"> <div id="content" role="main"> html content </div> </div> <?php get_sidebar();?> <?php get_footer(); ?>
This code breaks because the outmost div expands to 100% width and pushes the sidebar down. The original index.php page displays as expected with the sidebar in the correct position.
Looking the style.css (the original, not the child theme file) it appears there are several rules for #primary, thus:
Rule 1#primary { float: left; margin: 0 -26.4% 0 0; width: 100%; }
Rule 2
#primary { float: left; margin: 0; width: 100%; }
Rule 3
.singular #primary { margin: 0; }
It appears that rule 3 is activated and is overriding Rule 1. The reason that rule 3 is activated appears to be that “.singular” appears as a class in the body tag.
Now I’m puzzled. How does the .singular class get applied? Something to do with the following I suppose:
<body <?php body_class($class); ?>>
but what prompts this action and why does it happen.
All I want is a template that will display custom taxonomy terms and maintain a sidebar on the RHS.
Any suggestions as to another approach or a way to unravel this one. I thought that index.php would be the right template to copy from but it seems there is more to it than that. Note I realize that I could do something like replacing the div’s with my own and my own css but I would have thought that is something that should be easily done with WP “as is”.
Currently the problem can be seen at book dot value-based-marketing dot com/table-of-contents
Thanks
- The topic ‘New Template Breaks’ is closed to new replies.