- This topic is empty.
January 16, 2012 at 4:09 pm #36153
Hey, I’ve been working on this site for a bit
– My client has requested that I make a separate template for the first page so the main content area and the sidebar are not as tall/long.
I achieved that with the main content area, but had tried pasting in the code I had in the sidebar.php file, in place of get_sidebar(), and it makes 2 duplicate sidebars instead of 1 static sidebar.
I want to set a custom div for the sidebar in the index, so that it becomes shorter.
I have already enabled a JS script that makes both the main-content and the sidebar’s heights equal to eachother, so that’s not the issue, the dynamic PHP stuff is.
Your help would be greatly appreciated!
AdamJanuary 16, 2012 at 4:36 pm #94766TheDocMember
Hey Adam – you’re going to have to post some code for us to look at!January 16, 2012 at 11:03 pm #94787
This is the index code:
Template Name: One Dollar, One Brick: Home
All It Takes Is One Dollar.
'' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>
January 16, 2012 at 11:09 pm #94788
Sidebar PHP Code:
Help Us Help The
People of Nuqui
$args = array( 'numberposts' => 10, 'order'=> 'ASC', 'orderby' => 'title' );
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post); ?>
/* When we call the dynamic_sidebar() function, it'll spit out
* the widgets for that widget area. If it instead returns false,
* then the sidebar simply doesn't exist, so we'll hard-code in
* some default sidebar stuff just in case.
if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
// A second sidebar for widgets, just because.
if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
And here’s the style sheet:
http://www.onedollaronebrick.org/style.cssJanuary 16, 2012 at 11:28 pm #94789TheDocMember
Create a new file called sidebar-home.php. Then on your home template (which shouldn’t be index.php, by the way) you can use get_sidebar(‘home’).January 17, 2012 at 12:53 am #94793
This is what happens, even when I insert the get_sidebar(‘home’) and created a sidebar-home.php fileJanuary 17, 2012 at 1:01 am #94794jamygoldenMember
That is happening because you’re either calling
Together or because your sidebar-home.php contains duplicate code.January 21, 2012 at 4:29 pm #95139
Is there a way to figure out where the PHP code is that’s calling the sidebar twice?
I don’t see two times
- The forum ‘Back End’ is closed to new topics and replies.