WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar not showing up?!?!? (10 posts)

  1. supreme
    Member
    Posted 6 years ago #

    My sites sidebar shows only on the main page of my website, when you click on any link in the sidebar (from main page) the whole sidebar disappears????

    MY SITE

    Only change that I have made to the sidebar code is reordering the pages and general section.

    Can anyone tell me what i'm doing wrong???

  2. sunflyer
    Member
    Posted 6 years ago #

    did you make the template yourself ? Can I see the code you have in your sidebar.php ?

    [sig moderated]

  3. supreme
    Member
    Posted 6 years ago #

    Thanks for the response! Here is the code below.

    <div id="sidebar">
    <?php if (is_home()) { $check_home = '1'; } else { $check_home = '0'; } ?>

    <div class="sidebar_left">

    • <?php include('adsense_sidebar.php') ?>
    • <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>

      <?php endif; ?>

    </div>

    <div class="sidebar_right">

      <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>

    • <?php include (TEMPLATEPATH . '/searchform.php'); ?>
      • <?php /* If this is the frontpage */ if ($check_home == '1') { ?>
        <?php get_links_list(); ?>

    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>

  4. <h2>Archives</h2>
      <?php wp_get_archives('type=monthly'); ?>
  5. <h2>Categories</h2>
      <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=1'); ?>
  6. <h2>Recent Entries</h2>
      <?php query_posts('showposts=10'); ?>
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    • "><?php the_title() ?>
    • <?php endwhile; endif; ?>

  7. <h2>Meta</h2>
  8. <?php } ?>
    <?php endif; ?>

    </div>
    <div style="clear:both;"></div>
    </div>

  • whooami
    Member
    Posted 6 years ago #

    sunflyer,

    this forum doesnt allow signatures. and did you know you are violating Matt's trademark?

    http://wordpress.org/about/domains/

  • supreme
    Member
    Posted 6 years ago #

    ???? Anyone?

  • whistler2020
    Member
    Posted 6 years ago #

    thats the sidebar.php code.

    check the Main Index Template (index.php) or in your footer.php, look for

    <?php get_sidebar(); ?>

  • supreme
    Member
    Posted 6 years ago #

    If i dont have this <?php get_sidebar(); ?> code, should I apply it somewhere? will that bring my sidebar to all pages?

  • whistler2020
    Member
    Posted 6 years ago #

    that is the command that adds your sidebar code, it should come immediately after closing your content div. which usually occurs in your footer.php i.e.

    <!-- begin footer -->
          </div> <!-- close content -->
    <?php get_sidebar(); ?>
  • supreme
    Member
    Posted 6 years ago #

    Still no luck. I am seriously stuck. Does anyone have AIM/MSN, I would be willing to paypal anyone that can help me solve this problem.

    Thanks again Whistler

  • whistler2020
    Member
    Posted 6 years ago #

    in your first sidebar is code that checks to see if the page is the home page and assigns a variable.

    <div id="sidebar">
    <?php if (is_home()) { $check_home = '1'; } else { $check_home = '0'; } ?>

    in the second sidebar, and i'm assuming this is the one missing, it checks the variable.

    if you want the second bar to appear on all pages you need to take out the if statement

    <div class="sidebar_right">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    <?php /* If this is the frontpage */ if ($check_home == '1') { ?>
    <?php get_links_list(); ?>
  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags