My sidebar is repeating and I don't want that
-
If you go to this page you’ll see what I am talking about.
https://stage.kantarvideo.com/category/mentions/I only want the sidebar to appear one time which is next the newest post. However it repeats itself after each post. I know it probably has to do with the way I’ve set up the HTML but I’m not sure the best way to go about changing that. I’m not experienced in PHP, is there a script that I can use that will only show the sidebar one time? Below is the code I am using for this page. Any help is appreciated. Thanks!
<?php get_header(); ?> <h1><? the_category(', ')?></h1> <? if(have_posts()){ while(have_posts()){the_post(); if(in_category(get_cat_id('News'))){?> <h1>News</h1> <div class="main-holder"> <div class="twocolumns"> <div class="data"> <p><? the_time('M j, Y')?></p> </div> <div class="text-news"> <h2><? the_title()?></h2> <? the_content()?> </div> </div> </div> <? } else {?> <div class="main-holder"> <div class="inner"> <div class="content"> <div class="blog-post"> <div class="box-title"> <div class="txt"> <p><? the_time('M j, Y')?></p> </div> </div> <div class="blog-text"> <h2><? the_title()?></h2> <? if(has_post_thumbnail()){?> <div class="image"> <? the_post_thumbnail()?> </div> <? }?> <? the_content()?> <div class="txt-inf"> <span>Posted in</span> <ul> <li><? the_category(', ')?></li> </ul> </div> <div class="share-list"> <div class="sharethis"> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <a href="https://www.addthis.com/bookmark.php?v=250&username=xa-4be34fd865544a7b" class="addthis_button_compact">Share</a> <span class="addthis_separator">|</span> <a class="addthis_button_facebook"></a> <a class="addthis_button_myspace"></a> <a class="addthis_button_google"></a> <a class="addthis_button_twitter"></a> </div> <script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js#username=xa-4be34fd865544a7b"></script> <!-- AddThis Button END --> </div> </div> <div class="box-inform"> <? comments_template()?> </div> </div> </div> </div> <?php include (TEMPLATEPATH . '/sidebar-news.php'); ?> </div> </div> <? }?> <? }?> <? }?> <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘My sidebar is repeating and I don't want that’ is closed to new replies.