Advertisement
Guest User

Custom loop, Genesis, NOT Grid

a guest
Feb 2nd, 2014
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.88 KB | None | 0 0
  1. <?php if (have_posts()) : $counter = 1; while (have_posts()) : the_post(); if( $counter == 1 ) { ?>
  2.  
  3.                 // Return if CPT Tip of the Day
  4. add_action( 'genesis_after_entry_content', 'manta_tips_pre', 15 );
  5. function manta_tips_pre() {
  6.  
  7.     // Store the pre tips data
  8.     $tips_data_pre = array(
  9.         'totd_tags' => get_field( 'totd_tags' ),
  10.         'tip_article_headline' => get_field( 'tip_article_headline' ),
  11.         'article_author' => get_field( 'article_author' ),
  12.         'article_author_link' => get_field( 'article_author_link' ),
  13.     );
  14.    
  15.  
  16. // Only output if we have tips data
  17.     if ($tips_data_pre['totd_tags'] != '' ||
  18.         $tips_data_pre['tip_article_headline'] != '' ||
  19.         $tips_data_pre['article_author'] != '' ||
  20.         $tips_data_pre['article_author_link'] != '') {
  21.        
  22.         echo '<div class="tip-excerpt"><p><div class="entry-content">';
  23.                
  24.                 echo '<div class="entry-terms">' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'</div>' ;
  25.                 echo '<div class="entry-terms">
  26.                                         <div class="share">Share This Tip:</div>
  27.                                             <div class="addthis_toolbox addthis_default_style">
  28.                                                 <a class="addthis_button_preferred_1"></a>
  29.                                                 <a class="addthis_button_preferred_2"></a>
  30.                                                 <a class="addthis_button_preferred_3"></a>
  31.                                                 <a class="addthis_button_preferred_4"></a>
  32.                                                 <a class="addthis_button_compact"></a>
  33.                                                 <a class="addthis_counter addthis_bubble_style"></a>
  34.                                             </div>
  35.                                             <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=manta"></script>
  36.                                         </div>
  37.                                 </div></div>';
  38.  
  39.                
  40.         echo '</p><div class="divider"></div>';
  41.     }
  42. }
  43.  
  44.                 <?php } else { ?>
  45.  
  46.                 // Return if CPT Tip of the Day
  47. add_action( 'genesis_after_entry_content', 'manta_tips_teaser_pre', 15 );
  48. function manta_tips_teaser_pre() {
  49.  
  50.     // Store the pre tips data
  51.     $tips_data_pre = array(
  52.         'totd_tags' => get_field( 'totd_tags' ),
  53.     );
  54.    
  55.  
  56. // Only output if we have tips data
  57.     if ($tips_data_pre['totd_tags'] !='') {
  58.        
  59.         echo '<div class="tip-excerpt"><p><div class="entry-content">';
  60.                
  61.                 echo '<div class="entry-terms">' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'</div>' ;
  62.                                 </div></div>';
  63.         echo '</p><div class="divider"></div>';
  64.     }
  65. }
  66.  
  67.                 <?php }
  68.                 $counter++;
  69.                 endwhile;
  70.                 endif;
  71.                 ?>
  72.                
  73.                 <?php endwhile; ?>
  74.                
  75.                         <?php next_posts_link('Older Entries'); ?>
  76.                         <?php previous_posts_link('Newer Entries'); ?>
  77.                        
  78.                 <?php else : ?>
  79.                
  80.                         <h2>Nothing Found</h2>
  81.                        
  82.                 <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement