Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if (have_posts()) : $counter = 1; while (have_posts()) : the_post(); if( $counter == 1 ) { ?>
- // Return if CPT Tip of the Day
- add_action( 'genesis_after_entry_content', 'manta_tips_pre', 15 );
- function manta_tips_pre() {
- // Store the pre tips data
- $tips_data_pre = array(
- 'totd_tags' => get_field( 'totd_tags' ),
- 'tip_article_headline' => get_field( 'tip_article_headline' ),
- 'article_author' => get_field( 'article_author' ),
- 'article_author_link' => get_field( 'article_author_link' ),
- );
- // Only output if we have tips data
- if ($tips_data_pre['totd_tags'] != '' ||
- $tips_data_pre['tip_article_headline'] != '' ||
- $tips_data_pre['article_author'] != '' ||
- $tips_data_pre['article_author_link'] != '') {
- echo '<div class="tip-excerpt"><p><div class="entry-content">';
- echo '<div class="entry-terms">' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'</div>' ;
- echo '<div class="entry-terms">
- <div class="share">Share This Tip:</div>
- <div class="addthis_toolbox addthis_default_style">
- <a class="addthis_button_preferred_1"></a>
- <a class="addthis_button_preferred_2"></a>
- <a class="addthis_button_preferred_3"></a>
- <a class="addthis_button_preferred_4"></a>
- <a class="addthis_button_compact"></a>
- <a class="addthis_counter addthis_bubble_style"></a>
- </div>
- <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=manta"></script>
- </div>
- </div></div>';
- echo '</p><div class="divider"></div>';
- }
- }
- <?php } else { ?>
- // Return if CPT Tip of the Day
- add_action( 'genesis_after_entry_content', 'manta_tips_teaser_pre', 15 );
- function manta_tips_teaser_pre() {
- // Store the pre tips data
- $tips_data_pre = array(
- 'totd_tags' => get_field( 'totd_tags' ),
- );
- // Only output if we have tips data
- if ($tips_data_pre['totd_tags'] !='') {
- echo '<div class="tip-excerpt"><p><div class="entry-content">';
- echo '<div class="entry-terms">' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'</div>' ;
- </div></div>';
- echo '</p><div class="divider"></div>';
- }
- }
- <?php }
- $counter++;
- endwhile;
- endif;
- ?>
- <?php endwhile; ?>
- <?php next_posts_link('Older Entries'); ?>
- <?php previous_posts_link('Newer Entries'); ?>
- <?php else : ?>
- <h2>Nothing Found</h2>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement