• 1.
    <?php
  • 2.
    				$args = array(
  • 3.
    				   'public'   => true,
  • 4.
    				   '_builtin' => false
  • 5.
    				);
  • 6.
    				
  • 7.
    				$output = 'names'; // names or objects, note names is the default
  • 8.
    				$operator = 'and'; // 'and' or 'or'
  • 9.
    				
  • 10.
    				//$post_types = get_post_types( $args, $output, $operator );
  • 11.
    				$post_types = get_post_type_object(get_post_type($post));
  • 12.
    				 
  • 13.
    			?>
  • 14.
    			
  • 15.
    			
  • 16.
    			<?php foreach ( $post_types  as $post_type ) { ?>
  • 17.
    			
  • 18.
    				<?php
  • 19.
    				    $args = array('post_type' => $post_type, 'posts_per_page' => -1, 'paged' => $paged);
  • 20.
    				    $loop = new WP_Query($args);
  • 21.
    				    $count = 0;
  • 22.
    				?>
  • 23.
    				
  • 24.
    				<?php if ($loop) : while ($loop->have_posts()) : $loop->the_post(); ?>
  • 25.
    				<article class="grid_12 post-entry">
  • 26.
    					<header>
  • 27.
    						<h4><a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a></h4>
  • 28.
    						<?php the_excerpt(); ?>
  • 29.
    					</header><!-- End header -->
  • 30.
    					
  • 31.
    					<footer class="meta">
  • 32.
    						<p><?php the_date(); ?> - Geplaatst door: <?php the_author(); ?></p>
  • 33.
    					</footer><!-- End footer.meta -->
  • 34.
    					
  • 35.
    				</article><!-- End article.grid_12 post-entry -->
  • 36.
    				<?php endwhile; ?>
  • 37.
    				<?php else : ?>
  • 38.
    					<p>No posts were found! I'm not sure what you're looking for.</p>
  • 39.
    				<?php endif; ?>
  • 40.
    				<?php wp_reset_query(); ?>
  • 41.
    				
  • 42.
    			<?php } ?>
<?php $args = array( 'public' => true, '_builtin' => false ); $output = 'names'; // names or objects, note names is the default $operator = 'and'; // 'and' or 'or' //$post_types = get_post_types( $args, $output, $operator ); $post_types = get_post_type_object(get_post_type($post)); ?> <?php foreach ( $post_types as $post_type ) { ?> <?php $args = array('post_type' => $post_type, 'posts_per_page' => -1, 'paged' => $paged); $loop = new WP_Query($args); $count = 0; ?> <?php if ($loop) : while ($loop->have_posts()) : $loop->the_post(); ?> <article class="grid_12 post-entry"> <header> <h4><a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </header><!-- End header --> <footer class="meta"> <p><?php the_date(); ?> - Geplaatst door: <?php the_author(); ?></p> </footer><!-- End footer.meta --> </article><!-- End article.grid_12 post-entry --> <?php endwhile; ?> <?php else : ?> <p>No posts were found! I'm not sure what you're looking for.</p> <?php endif; ?> <?php wp_reset_query(); ?> <?php } ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter