WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar won't show on frontpage, but shows fine on other pages (7 posts)

  1. untitledflow
    Member
    Posted 3 years ago #

    I tried to google it and search help in forum, but still can't figure out. I'm new to WordPress, so might sound like a dumb question. Like the topic says, the sidebar won't display on frontpage while it shows fine on all other pages I'm using Breathe theme and this is how my index.php looks like:

    <?php

    global $options;

    foreach ($options as $value) {

    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }

    }

    ?>

    <?php get_header(); ?>

    <?php if (have_posts()) : ?>

    <div class="posts-wrap">

    <!-- Welcome box -->

    <?php if ( $breathe_welcome == yes ) { ?>

    <div class="welcome">

    <?php echo stripslashes($breathe_welcome_message); ?>

    </div>
    <?php } ?>

    <!-- End welcome box -->

    <!-- Top Ads -->

    <?php if ( $breathe_ads_top == yes ) { ?>

    <div class="top-ads">

    <?php echo stripslashes($breathe_ads_code_top); ?>

    </div>

    <?php } ?>

    <!-- End Top Ads -->

    <?php while (have_posts()) : the_post(); ?>

    <div class="post post-index" id="post-<?php the_ID(); ?>">

    <h2 class="entry-title index-entry-title">

    " title="<?php the_title(); ?>"><?php the_title(); ?>

    </h2>

    <div class="additional-meta"><?php the_time('l, j F, Y') ?></div>

    <?php if ( function_exists( 'get_the_image' ) ) { get_the_image(); } ?>

    <?php the_content(); ?>

    <div class="more clearfloat"> " rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo('Read More...»'); ?></div>

    <div class="comments">"><?php comments_number('0', '1', '%', 'number'); ?> Comments

    </div>

    <div class="entry-content entry-content-index">

    <div class="lastline"></div>

    </div><!-- end .entry-content -->

    </div> <!-- end .post -->

    <?php endwhile; ?>

    <div class="navigation navigation-index">

    <div class="nav-prev"><?php next_posts_link( __('« Older Entries', 'blank')) ?></div>

    <div class="nav-next"><?php previous_posts_link( __('Newer Entries »', 'blank')) ?></div>

    </div>

    <?php if ( $breathe_ads_bottom == yes ) { ?>

    <div class="bottom-ads">

    <?php echo stripslashes($breathe_ads_code_bottom); ?>

    </div>

    <?php } ?>

    <?php else : ?>

    <?php get_sidebar();?>

    <h2><?php _e('The page youre looking for doesnt exist', 'blank'); ?></h2>

    <div class="search-404">

    <?php _e('Do you want to search for it?', 'blank'); ?>

    <?php include (TEMPLATEPATH . "/searchform.php"); ?>

    </div>

    <?php endif; ?>

    </div><!-- end .posts-wrap -->

    <?php get_footer(); ?>

  2. WebTechGlobal
    Member
    Posted 3 years ago #

    From what I read, your sidebar is not meant to show on all pages...

    <?php if ( $breathe_ads_bottom == yes ) { ?>
    // DO THIS...
        <div class="bottom-ads">
        <?php echo stripslashes($breathe_ads_code_bottom); ?>
        </div>
    <?php } else
    // display sidebar...
    get_sidebar();?>

    [Please post code snippets between backticks or use the code button.]

  3. WebTechGlobal
    Member
    Posted 3 years ago #

    So it seems the value $breathe_ads_bottom is set to yes.

    From what I read at the start of your code this variable is set using options data. Could it simply be your theme or a plugin setting?

  4. untitledflow
    Member
    Posted 3 years ago #

    the thing is that it was working fine before, but I added another widget today to the sidebar and for some reason the whole sidebar disappeared on front page, when I put. This part

    <?php get_sidebar();?>
    was absent in index.php, so I added it, but still nothing. it might be plugin setting then, not theme

  5. WebTechGlobal
    Member
    Posted 3 years ago #

    I'm thinking your widgets before you made the modification were only hard coded, rather than from the widget page?

    Have you added widgets to your sidebar on the widget page? Just making sure you have not added get_sidebar() and it is working, just no widgets.

    Been a while since I worked on themes but normally we use sidebar.php, are you possibly missing out something there?

    So are you also saying this message and search form do not appear?

    <?php get_sidebar();?>
    
    <h2><?php _e('The page youre looking for doesnt exist', 'blank'); ?></h2>
    <div class="search-404">

    try putting something just before the get_sidebar line and if that displays then we know it is stepping into

    <?php } else

    and then blank sidebar would indicate get_sidebar is not working properly because from the code you have shown that message regarding no page being found and a search box should appear.

    I could probably fix it quick enough with access to your theme but I need to log off soon, past 1am here.

  6. untitledflow
    Member
    Posted 3 years ago #

    yeah, that message did not appear until I put inserted it, but still no changes, I'm on for the next 6-7 hours, so if you get the time to check it out, I would HIGHLY appreciate it. Thank you so much for the info

  7. WebTechGlobal
    Member
    Posted 3 years ago #

    Won't get the time today sorry. Deep into something.

    I would prefer to run tests on the theme directly myself if I was going to help. This forum is very limited for sharing files etc, yet we can't discuss hiring etc.

    You can however get further support on the WebTechGlobal forum and go from there. Free. Can't say when but I'll get around to it asap and you can give me your theme on there or PM me FTP details etc.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.