2 Sidebar Widget Areas
-
http://rusticblonde.byethost22.com/TestSite/
Hi there,
can anyone help me Im lost as to why i have 2 boxes for the 2nd sidebar area.
I have inserted the get_sidebar code into both the page.php and the index.php
and removing the page one removes them both,
I basically want this to sit below the content.
Can anyone help please.
thanks
Kirsty
-
actually ive just found it once, in the page.php file.
Is it because im trying to call the 2 bars in 1 area?
thanks
<?php get_header(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post"> <div class="entry"> <?php the_content('Read the rest of this entry ยป'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> <?php endwhile; ?> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> </div> <!--/content --> <?php get_sidebar(); ?> <?php get_sidebar('second'); ?> <?php get_footer(); ?>This is my code for the page.php file
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
well swapped it to main 1 and its still duplicated. Any ideas folks?
Your help is much appreciated ๐
also this is the code for the main1 sidebar
<div id="sidebar-main1"> <ul id="sidebar-main1"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-main1') ) : ?> <?php endif; ?> </div>Sorry for all posts.
thanks[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
Hi Moderators, what do i have to do to get this resolved? Apologies for the mis information.
what do i have to do to get this resolved?
possibly be patient and what a bit longer than just 30 minutes?
even with a duplicate alchymyth? As i thought this would suggest that i had pasted the call twice.
Sorry for the abruptness. Im very new and trying to learn. As usually the changes when i edit the code are instantly viewable
what are your codes in functions.php for registering the sidebars?
http://codex.wordpress.org/Function_Reference/register_sidebar
what is the code of sidebar-second.php?
apologies how to do i put backticks and i will paste the code
alchymyththankyou for your help
apologies if i post this wrong:
<?php if ( function_exists('register_sidebar') ) register_sidebar(array('name'=>'sidebar', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h4>', 'after_title' => '</h4>', )); if ( function_exists('register_sidebar') ) register_sidebar(array('name'=>'sidebar-main1', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h4>', 'after_title' => '</h4>', )); register_sidebar(array( 'name' => __( 'Right Hand Sidebar' ), 'id' => 'right-sidebar', 'description' => __( 'Widgets in this area will be shown on the right-hand side.' ), 'before_title' => '<h1>', 'after_title' => '</h1>' )); ?>this is my function file
and my main1 php is:
<div id="sidebar-main1"> <ul id="sidebar-main1"> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('sidebar-main1') ) : else : ?> <ul> </ul> <?php endif; ?> </ul> </div>why i have 2 boxes for the 2nd sidebar area.
seems to be caused by the (invalid) repeated and nested use of the css id
#sidebar-main1in the sidebar file;possibly change the css id to a differnt name in one of those lines:
<div id="sidebar-main1"> <ul id="sidebar-main1">example:
<div id="sidebar-main-wrap"> <ul id="sidebar-main1">and add corrsponding css to style.css if necessary.
oh sugar! Didnt realise that. I assumed they had to be the same to correspond.
I will try this.
Thankyou again
awesomeness alchymyth
It appears to have worked! I will remember to use a different name to the UL name for extra bars in future.
Your help has been much appreciated hun.
Thankyou again
The topic ‘2 Sidebar Widget Areas’ is closed to new replies.