Page with Sidebar on Right Side
-
I have been attempting to use a child theme to modify Spun.
I am trying to create a Page Template that will show the sidebar on the right side (about 70% primary content, 30% sidebar content). I would like this sidebar to only show up when this specific Page Template is being used.
I have created a Page Template that looks like this:
<?php /** * Template Name: Store * *A modified file for a Store from Spun's Page Template * * @package Spun * @since Spun 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-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 .site-content --> </div><!-- #primary .content-area --> <?php get_sidebar(); ?> <?php get_footer(); ?>
And used CSS (found here) to try to accomplish this goal:
.page #primary { float: left; width: 70%; } #secondary { clear: right; display: block; padding: 50px 0; float: right; width: 30%; } .sidebar-link { display: none; } .page .hentry { padding: 0px; width: 100%; } .widget-column { width: 100%; } .one.widget-column { float: none; margin: 0 0 0 40px; }
So far, I have succeeded in turning all Pages into 70% width, with no visible sidebar and no other successes.
The page is here: http://nekothreesixty.com/wolf-bee-alchemy/
I would also settle for making a new sidebar and widgetizing it, as suggested here but I have not had good luck getting that to work either. Anyone figured this one out?
If it is helpful to note: I have also modified the content-home to display Pages instead of posts, created a custom Page Template that calls all posts in the category Blog, changed fonts & colors.
-
I have succeeded in making the code found here (and pasted above) function. I believe my issue was improperly using a child theme.
However, that code changed all Pages to 70% width, so to avoid this I changed the CSS to:
.page #store-primary { float: left; width: 70%; }
and changed the code in store.php (My Page Template) from:
<div id="primary" class="content-area">
to
<div id="store-primary" class="content-area">
Because I am not using the sidebar anywhere else I didn’t need to change anything else.
In order to make it show on just my Template Page I added the code:
<?php get_sidebar(); ?>
to the Template; and removed it from the page.php file.
I hope this helps anyone else with this issue!
Thanks 🙂
- The topic ‘Page with Sidebar on Right Side’ is closed to new replies.