0
Welcome Guest! Login
0 items Join Now

Recent post showing up twice...I know nothing about loops..

  • Recent post showing up twice...I know nothing about loops..

    Posted 13 years 1 month ago
    • I have no idea why but I started getting double posts for the most recent post. It doesn't show up in twenty/ten theme so it must be a theme issue...not a plugin issue...that's what I think anyways.

      I was reading about loops but I know nothing of php and how they work. I just can't get my head around it by reading, if someone were to explain it on the phone, ok, but not reading it.

      Here is the code from my index.php file. Anyone have any ideas on how to help me?
      <?php
      /**
       * @version   1.0 February 17, 2011
       * @author    RocketTheme http://www.rockettheme.com
       * @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
       * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
       */
       
      // no direct access
      ?>
       
      <?php global $post, $posts, $query_string; ?>
              <div class="blog">
          
                  <?php if ($gantry->get('blog-page-title') != '') : ?>
                  
                  <h1 class="title">
                      <?php echo $gantry->get('blog-page-title'); ?>
                  </h1>
                  
                  <?php endif; ?>
                  
                  <div class="rt-leading-articles">
                  
                      <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                      
                      if($gantry->get('blog-query') != '') : query_posts("'paged=".$paged.'&'.$gantry->get('blog-query')."'");
                      
                      else: query_posts('paged='.$paged.'&orderby='.$gantry->get('blog-order').'&cat='.$gantry->get('blog-cat').'&post_type='.$gantry->get('blog-type'));
                      
                      endif; 
                      
                      ?>
              
                      <?php while (have_posts()) : the_post(); ?>
                  
                      <!-- Begin Post -->
                  
                      <div class="rt-article">                    
                          <div class="rt-article-bg">
                              <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
                                  
                                  <?php if($gantry->get('blog-title')) : ?>
                  
                                  <!-- Begin Title -->
                              
                                  <div class="rt-headline">
                                      
                                      <?php if($gantry->get('blog-meta-date')) : ?>
                                      
                                      <!-- Begin Date & Time -->
                  
                                      <span class="createdate"><!--<?php _re('Posted on'); ?> --><span><?php the_time('l, d F, Y H:i'); ?></span></span>
                                      
                                      <!-- End Date & Time -->
                                      
                                      <?php endif; ?>
                                      
                                      <?php if($gantry->get('blog-link-title')) : ?>
                                      
                                      <h1 class="title">
                                          <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
                                      </h1>
                                      <div class="articledivider"></div>
                                      
                                      <?php else : ?>
                                          
                                      <h1 class="title">
                                          <?php the_title(); ?>
                                      </h1>
                                      <div class="articledivider"></div>
                                      
                                      <?php endif; ?>
                                          
                                  </div>
                                  <div class="clear"></div>
                                      
                                  <!-- End Title -->
                                      
                                  <?php endif; ?>
                                  
                                  <?php if($gantry->get('blog-meta-comments') || $gantry->get('blog-meta-date') || $gantry->get('blog-meta-modified') || $gantry->get('blog-meta-author')) : ?>
                                      
                                  <!-- Begin Meta -->
                                  
                                  <p class="articleinfo">
                                  
                                      <?php if($gantry->get('blog-meta-date')) : ?>
                                      
                                      <!-- Begin Date & Time -->
                  
                                      <span class="createdate"><!--<?php _re('Posted on'); ?> --><span><?php the_time('l, d F, Y H:i'); ?></span></span>
                                      
                                      <!-- End Date & Time -->
                                      
                                      <?php endif; ?>
                                      
                                      <?php if($gantry->get('blog-meta-modified')) : ?>
                                      
                                      <!-- Begin Modified Date -->
                  
                                      <span class="modifydate"><?php _re('Last Updated on'); ?> <?php the_modified_date('l, d F, Y H:i', '<span>', '</span>'); ?></span>
                                      
                                      <!-- End Modified Date -->
                                      
                                      <?php endif; ?>
                                          
                                      <?php if($gantry->get('blog-meta-author')) : ?>
                                  
                                      <!-- Begin Author -->
                                  
                                      <span class="createdby"><?php _re('Written by'); ?> <span><?php the_author(); ?></span></span>
                                      
                                      <!-- End Author -->
                                      
                                      <?php endif; ?>
                                      
                                      <?php if($gantry->get('blog-meta-comments')) : ?>
                                          
                                          <!-- Begin Comments -->
                                          
                                          <?php if($gantry->get('blog-meta-link-comments')) : ?>
                                          
                                          <div class="rt-comment-block">
                                              <a href="<?php the_permalink(); ?>#comments">
                                                  <span class="rt-comment-text"><?php comments_number(_r('0 Comments'), _r('1 Comment'), _r('% Comments')); ?></span>
                                              </a>
                                          </div>
          
                                          <?php else : ?>
                      
                                          <div class="rt-comment-block">
                                              <span class="rt-comment-text"><?php comments_number(_r('0 Comments'), _r('1 Comment'), _r('% Comments')); ?></span>
                                          </div>
                                          
                                          <?php endif; ?>
                                          
                                          <!-- End Comments -->
                                      
                                      <?php endif; ?>
                                      
                                  </p>
                                  
                                  <!-- End Meta -->
                                  
                                  <?php endif; ?>
                                  
                                  <div class="rt-article-content">
                                  
                                      <!-- Begin Post Content -->     
                                  <?php if(function_exists('the_post_thumbnail') && has_post_thumbnail()) : the_post_thumbnail('gantryThumb', array('class' => $gantry->get('thumb-position'))); endif; ?>
                                      <?php if($gantry->get('blog-content') == 'content') : ?>
                                      
                                      <?php the_content(false); ?>
                                                          
                                      <?php else : ?>
                                                          
                                      <?php the_excerpt(); ?>
                                                              
                                      <?php endif; ?>
                                      
                                      <?php if(preg_match('/<!--more(.*?)?-->/', $post->post_content)) : ?>
                                      
                                      <p class="rt-readon-surround">                                                                          
                                          <a href="<?php the_permalink(); ?>" ><span><?php echo $gantry->get('blog-readmore'); ?></span></a>
                                      </p>
                                      
                                      <?php endif; ?>
                                      
                                      <div class="clear"></div>
                                      
                                      <!-- End Post Content -->
                                  
                                  </div>
                                  
                              </div>
                              <div class="clear"></div>
                          </div>              
                      </div>
                      
                      <!-- End Post -->
                      
                      <?php endwhile;?>
                      
                      <!-- Begin Navigation -->
                                                  
                      <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if($total_pages > 1) : ?>
                              
                      <div class="rt-pagination nav">
                          <div class="alignleft">
                              <?php next_posts_link('&laquo; '._r('Older Entries')); ?>
                          </div>
                          <div class="alignright">
                              <?php previous_posts_link(_r('Newer Entries').' &raquo;') ?>
                          </div>
                          <div class="clear"></div>
                      </div><br />
                                  
                      <?php endif; ?>
              
                      <!-- End Navigation -->
          
                  </div>
              </div>


      Thanks in advance
      Doug
    • Newbie who's not so new...just slow on the know.
      AND Yes, I read the Top Tips for Support and YES, it helps get results!!!
      Links and screenshots get results!! Try It!!!
      After reading some of the replies and people not paying attention to what is asked of them...I would like to promote this whole...

Time to create page: 0.047 seconds