Skip to main content
Tweeted twitter.com/#!/StackWordPress/status/259536145325641729
added 1559 characters in body
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244
  • home.php: http://pastebin.com/6ac2asue

  • functions.php: http://pastebin.com/1SK206Bh

     <?php $do_not_duplicate = array();
     $folio_loop = new WP_Query( array
         (
             'featured' => 'featured-post',
             'post_type' => 'projects',
             'posts_per_page' => '1',
             )
         );
    
          while ( $folio_loop->have_posts() ) : $folio_loop->the_post();
         $do_not_duplicate[] = $post->ID; ?>
    
         <div id="featured" style="position: relative;">
    
    
             <div class="featured-overlay" style="position: absolute; right: 20px; bottom: 20px; width: 165px; height: 165px; text-align: center;">
                 <div class="project-meta-featured">
               <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
             <span>
             <?php
                 global $post;
                 $text = get_post_meta( $post->ID, '_cmb_project_meta', true );
                 echo $text;
             ?>
             </span>
             <br />
             <?php
                 global $post;
                 $text = get_post_meta( $post->ID, '_cmb_client_meta', true );
                 echo $text;
             ?>
    
    
             </a>
               </div>
             </div>
    
             <?php if ( has_post_thumbnail()) : ?>
                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                     <?php the_post_thumbnail('featured'); ?>
                 </a>
             <?php endif; ?>
    
    
    
         </div>
    
     <?php endwhile; ?>
    
  • home.php: http://pastebin.com/6ac2asue

  • functions.php: http://pastebin.com/1SK206Bh

     <?php $do_not_duplicate = array();
     $folio_loop = new WP_Query( array
         (
             'featured' => 'featured-post',
             'post_type' => 'projects',
             'posts_per_page' => '1',
             )
         );
    
          while ( $folio_loop->have_posts() ) : $folio_loop->the_post();
         $do_not_duplicate[] = $post->ID; ?>
    
         <div id="featured" style="position: relative;">
    
    
             <div class="featured-overlay" style="position: absolute; right: 20px; bottom: 20px; width: 165px; height: 165px; text-align: center;">
                 <div class="project-meta-featured">
               <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
             <span>
             <?php
                 global $post;
                 $text = get_post_meta( $post->ID, '_cmb_project_meta', true );
                 echo $text;
             ?>
             </span>
             <br />
             <?php
                 global $post;
                 $text = get_post_meta( $post->ID, '_cmb_client_meta', true );
                 echo $text;
             ?>
    
    
             </a>
               </div>
             </div>
    
             <?php if ( has_post_thumbnail()) : ?>
                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                     <?php the_post_thumbnail('featured'); ?>
                 </a>
             <?php endif; ?>
    
    
    
         </div>
    
     <?php endwhile; ?>
    
Source Link
Eamon
  • 21
  • 2

Custom Post Type Pagination & duplicate posts

I'm working on a template which will use some custom-post-types & custom-taxonomies.. I'm having problems with pagination and duplicate posts.

HOME.PHP

LOOP #1 On the homepage (home.php) I have 2 Loops. The fist one shows 1 post (custom post type: Projects) which has the custom-taxonomy "Featured" assigned to it.

LOOP #2 On the second loop I have the six most recent "Projects" (Custom post type) but I dont want a duplicate from the first loop. Under the six posts I'd like a pagination

Both loops in home.php work.. but I still have that duplicate and I can't get pagination to work..

PasteBin