Guest User

Multiple Loop, Genesis, Not Grid, Pt 2

a guest
Feb 2nd, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.83 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  *
  5.  * Display the Tip of the Day Custom Post Type archive custom fields using
  6.  * ACF.
  7.  *
  8.  * @author Angie Meeker
  9.  * @uses   Advanced Custom Fields
  10.  */
  11.  
  12.  add_action('genesis_entry_content','genesis_do_post_title', 2);
  13.  
  14.  //* Removes Continue Reading from the echoed excerpt
  15.  function sbt_auto_excerpt_more( $more ) {
  16. return 'aaa';
  17. }
  18. add_filter( 'excerpt_more', 'sbt_auto_excerpt_more', 20 );
  19.  
  20. function sbt_custom_excerpt_more( $output ) {return preg_replace('/<a[^>]+>Continue reading.*?<\/a>/i','',$output);
  21. }
  22. add_filter( 'get_the_excerpt', 'sbt_custom_excerpt_more', 20 );
  23.  
  24.  
  25.  //* Add Tip of the Day body class to the head
  26. add_filter( 'body_class', 'add_tiparchives_body_class' );
  27. function add_tiparchives_body_class( $classes ) {
  28.    $classes[] = 'tiparchives-post-type-archive-{tipoftheday}';
  29.    return $classes;
  30. }
  31.  
  32.  // Return Category and Tip of the Day on Single Posts
  33. add_action ( 'genesis_before_content', 'show_totd', 9 );
  34. function show_totd() {
  35.     echo '<div class="totd-cats-title">Tip of the Day</div>';
  36. }
  37.   // Remove Post Author
  38.  add_filter( 'genesis_post_info', 'remove_post_author_totd_posts' );
  39. function remove_post_author_totd_posts($post_info) {
  40.     $post_info = '[post_date]';
  41.     return $post_info;
  42. }
  43.  
  44.  // Return if CPT Tip of the Day
  45. add_action( 'genesis_after_entry_content', 'manta_tips_pre', 15 );
  46. function manta_tips_pre() {
  47.  
  48.     // Store the pre tips data
  49.     $tips_data_pre = array(
  50.         'totd_tags' => get_field( 'totd_tags' ),
  51.         'tip_article_headline' => get_field( 'tip_article_headline' ),
  52.         'article_author' => get_field( 'article_author' ),
  53.         'article_author_link' => get_field( 'article_author_link' ),
  54.     );
  55.    
  56.  
  57. // Only output if we have tips data
  58.     if ($tips_data_pre['totd_tags'] != '' ||
  59.         $tips_data_pre['tip_article_headline'] != '' ||
  60.         $tips_data_pre['article_author'] != '' ||
  61.         $tips_data_pre['article_author_link'] != '') {
  62.        
  63.         echo '<div class="tip-excerpt"><p><div class="entry-content">';
  64.                
  65.                 echo '<div class="entry-terms">' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'</div>' ;
  66.                 echo '<div class="entry-terms">
  67.                                         <div class="share">Share This Tip:</div>
  68.                                             <div class="addthis_toolbox addthis_default_style">
  69.                                                 <a class="addthis_button_preferred_1"></a>
  70.                                                 <a class="addthis_button_preferred_2"></a>
  71.                                                 <a class="addthis_button_preferred_3"></a>
  72.                                                 <a class="addthis_button_preferred_4"></a>
  73.                                                 <a class="addthis_button_compact"></a>
  74.                                                 <a class="addthis_counter addthis_bubble_style"></a>
  75.                                             </div>
  76.                                             <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=manta"></script>
  77.                                         </div>
  78.                                 </div></div>';
  79.  
  80.                
  81.         echo '</p><div class="divider"></div>';
  82.     }
  83. }
  84.  
  85.  
  86. genesis();
Advertisement
Add Comment
Please, Sign In to add comment