Advertisement
Guest User

Untitled

a guest
Feb 7th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.31 KB | None | 0 0
  1. <?php
  2. function bfa_post_kicker($before = '<div class="post-kicker">', $after = '</div>')
  3. {
  4.     global $bfa_ata;
  5.    
  6.     // don't display on WP Email pages
  7.     if(intval(get_query_var('email')) != 1) {
  8.        
  9.         if( (is_home() AND $bfa_ata['post_kicker_home'] != "") OR
  10.         (is_page() AND $bfa_ata['post_kicker_page'] != "") OR
  11.         (is_single() AND $bfa_ata['post_kicker_single'] != "") OR
  12.         ( (is_archive() OR is_search() OR is_author() OR is_tag()) AND $bfa_ata['post_kicker_multi'] != "") ) {
  13.            
  14.             echo $before;
  15.            
  16.             if ( is_home() )        $kickertype = 'post_kicker_home';
  17.             elseif ( is_page() )    $kickertype = 'post_kicker_page';
  18.             elseif ( is_single() )  $kickertype = 'post_kicker_single';
  19.             else                    $kickertype = 'post_kicker_multi';
  20.            
  21.             echo bfa_postinfo($bfa_ata[$kickertype]);
  22.            
  23.             echo $after;       
  24.         }
  25.     }
  26. }
  27.  
  28. function bfa_post_headline($before = '<div class="post-headline">', $after = '</div>')
  29. {
  30.     global $bfa_ata, $post;
  31.  
  32. //  Case 1 - 'Use Post / Page Options' is no, then just use the post/page title
  33.     if ($bfa_ata['page_post_options'] == 'No') {
  34.         echo $before;
  35.         ?><h<?php echo $bfa_ata['h_posttitle']; ?>><?php
  36.             if ( is_single() OR is_page() ) {
  37.                 the_title(); ?></h><?php echo $bfa_ata['h_posttitle']; ?><?php
  38.             } else { ?>
  39.                 <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e(' ','atahualpa') . the_title_attribute('echo=1') ?>">
  40.                 <?php the_title(); ?></a></h><?php echo $bfa_ata['h_posttitle']; ?><?php
  41.             }
  42.         echo $after;
  43.         return;
  44.     }
  45. //  Case 2 - 'Use Post / Page Options' is Yes, then use the BFA title
  46.     if ( is_single() OR is_page() ) {
  47.         $bfa_ata_body_title = get_post_meta($post->ID, 'bfa_ata_body_title', true);
  48.         $bfa_ata_display_body_title = get_post_meta($post->ID, 'bfa_ata_display_body_title', true);
  49.         $bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
  50.     } else {
  51.         $bfa_ata_body_title_multi = get_post_meta($post->ID, 'bfa_ata_body_title_multi', true);
  52.     }
  53.    
  54.     // Since 3.6.1: Display a link to the full post if there is no post title and the post is too short
  55.     // for a read more link.
  56.    
  57.     // some plugins hook into 'the_title()' so we only want it called once. But it must also be called
  58.     // when using the bfa_ata titles so we use a dummy call:
  59.     //      $bfa_toss = the_title('','',false);
  60.     // in those cases
  61.     $bfa_temp_title = get_the_title();
  62.     if ( $bfa_temp_title == '' ) { ?>
  63.         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link','atahualpa')?>">Permalink</a><?php
  64.        
  65.     } elseif ( (!is_single() AND !is_page()) OR $bfa_ata_display_body_title == '' ) {
  66.        
  67.         echo $before; ?>
  68.         <h<?php echo $bfa_ata['h_posttitle']; ?>><?php
  69.            
  70.         if( !is_single() AND !is_page() ) { ?>
  71.             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e(' ','atahualpa') .  the_title_attribute('echo=1') ?>"><?php
  72.         }
  73.  
  74.         if ( (is_single() OR is_page()) AND $bfa_ata_body_title != "" ) {
  75.             echo htmlentities($bfa_ata_body_title,ENT_QUOTES,'UTF-8');
  76.             $bfa_toss = the_title('','',false);
  77.         } else {
  78.             if ( $bfa_ata_body_title_multi != '' ) {
  79.                 echo htmlentities($bfa_ata_body_title_multi,ENT_QUOTES,'UTF-8');  
  80.                 $bfa_toss = the_title('','',false);
  81.             } else
  82.                 echo $bfa_temp_title;
  83.         }
  84.  
  85.         if ( !is_single() AND !is_page() ) { ?></a><?php } ?></h><?php echo $bfa_ata['h_posttitle']; ?>
  86.         <?php echo $after;
  87.     }
  88. }
  89.  
  90.  
  91.  
  92.  
  93. function bfa_post_byline($before = '<div class="post-byline">', $after = '</div>')
  94. {
  95.     global $bfa_ata, $post;
  96.    
  97.     // don't display on WP Email pages
  98.     if(intval(get_query_var('email')) != 1) {
  99.        
  100.         if( (is_home() AND $bfa_ata['post_byline_home'] != "") OR
  101.         (is_page() AND $bfa_ata['post_byline_page'] != "") OR
  102.         (is_single() AND $bfa_ata['post_byline_single'] != "") OR
  103.         ( (is_archive() OR is_search() OR is_author() OR is_tag()) AND $bfa_ata['post_byline_multi'] != "") ) {
  104.            
  105.             echo $before;
  106.  
  107.             if ( is_home() )        $bylinetype = 'post_byline_home';      
  108.             elseif ( is_page() )    $bylinetype = 'post_byline_page';
  109.             elseif ( is_single() )  $bylinetype = 'post_byline_single';
  110.             else                    $bylinetype = 'post_byline_multi';
  111.            
  112.             echo bfa_postinfo($bfa_ata[$bylinetype]);
  113.                    
  114.             echo $after;
  115.         }
  116.     }
  117. }
  118.  
  119.                        
  120. function bfa_post_bodycopy($before = '<div class="post-bodycopy clearfix">', $after = '</div>')
  121. {
  122.     global $bfa_ata, $post, $bfa_pagetemplate_name, $bfa_pagetemplate_full_post_count, $bfa_ata_postcount;
  123.  
  124.     $do_full_post = 0;
  125.     echo $before;
  126.     if ((is_home()     AND $bfa_ata['excerpts_home'] == "Full Posts")
  127.     OR  (is_home()     AND !is_paged() AND $bfa_ata_postcount <= $bfa_ata['full_posts_homepage'])
  128.     OR  (is_category() AND $bfa_ata['excerpts_category'] == "Full Posts")
  129.     OR  (is_date()     AND $bfa_ata['excerpts_archive'] == "Full Posts")
  130.     OR  (is_tag()      AND $bfa_ata['excerpts_tag'] == "Full Posts")
  131.     OR  (is_search()   AND $bfa_ata['excerpts_search'] == "Full Posts")
  132.     OR  (is_author()   AND $bfa_ata['excerpts_author'] == "Full Posts")
  133.     OR   is_single()
  134.     OR   is_page()
  135.     ) { $do_full_post = 1; }
  136.    
  137.     if (bfa_is_pagetemplate_active($bfa_pagetemplate_name)) {
  138.         if ($bfa_ata_postcount <= $bfa_pagetemplate_full_post_count)
  139.             { $do_full_post = 1; }
  140.         else
  141.             { $do_full_post = 0; }
  142.     }
  143.    
  144.     if ($do_full_post == 1) {
  145.         $bfa_ata_more_tag_final = str_replace("%post-title%", the_title('', '', false), $bfa_ata['more_tag']);
  146.         the_content($bfa_ata_more_tag_final);
  147.     } else {
  148.         if (function_exists('the_post_thumbnail') AND !function_exists('tfe_get_image')) {
  149.              if(has_post_thumbnail()): ?>
  150.                 <a href="<?php the_permalink() ?>"> <?php the_post_thumbnail(); ?></a>
  151.                 <?php endif;
  152.         }
  153.         the_excerpt();
  154.     }
  155.     echo $after;
  156. }
  157.  
  158.                        
  159. function bfa_post_pagination($before = '<p class="post-pagination"><strong>Pages:', $after = '</strong></p>')
  160. {
  161.     global $bfa_ata, $bfa_ata_postcount;
  162.    
  163.     if ((is_home()     AND $bfa_ata['excerpts_home'] == "Full Posts")
  164.     OR  (is_home()     AND !is_paged() AND $bfa_ata_postcount <= $bfa_ata['full_posts_homepage'])
  165.     OR  (is_category() AND $bfa_ata['excerpts_category'] == "Full Posts")
  166.     OR  (is_date()     AND $bfa_ata['excerpts_archive'] == "Full Posts")
  167.     OR  (is_tag()      AND $bfa_ata['excerpts_tag'] == "Full Posts")
  168.     OR  (is_search()   AND $bfa_ata['excerpts_search'] == "Full Posts")
  169.     OR  (is_author()   AND $bfa_ata['excerpts_author'] == "Full Posts")
  170.     OR  is_single()
  171.     OR is_page() ) {
  172.         wp_link_pages('before='.$before.'&after='.$after.'&next_or_number=number');
  173.     }
  174. }
  175.  
  176.  
  177. function bfa_archives_page($before = '<div class="archives-page">', $after = '</div>')
  178. {
  179.     global $bfa_ata, $wp_query;
  180.     $templateURI = get_template_directory_uri();
  181.    
  182.     $current_page_id = $wp_query->get_queried_object_id();
  183.    
  184.     if ( is_page() AND $current_page_id == $bfa_ata['archives_page_id'] ) {
  185.        
  186.         echo $before;              
  187.         if ( $bfa_ata['archives_date_show'] == "Yes" ) { ?>
  188.             <h3><?php echo $bfa_ata['archives_date_title']; ?></h3>
  189.             <ul>
  190.             <?php wp_get_archives('type=' . $bfa_ata['archives_date_type'] . '&show_post_count=' .
  191.             ($bfa_ata['archives_date_count'] == "Yes" ? '1' : '0') . ($bfa_ata['archives_date_limit'] != "" ? '&limit=' .
  192.             $bfa_ata['archives_date_limit'] : '')); ?>
  193.             </ul>
  194.         <?php }                        
  195.         if ( $bfa_ata['archives_category_show'] == "Yes" ) { ?>
  196.             <h3><?php echo $bfa_ata['archives_category_title']; ?></h3>
  197.             <ul>
  198.             <?php wp_list_categories('title_li=&orderby=' . $bfa_ata['archives_category_orderby'] .
  199.             '&order=' . $bfa_ata['archives_category_order'] .
  200.             '&show_count=' . ($bfa_ata['archives_category_count'] == "Yes" ? '1' : '0') .
  201.             '&depth=' . $bfa_ata['archives_category_depth'] .
  202.             ($bfa_ata['archives_category_feed'] == "Yes" ? '&feed_image=' . $templateURI .
  203.             '/images/icons/feed.gif' : '')); ?>
  204.             </ul>
  205.         <?php }
  206.         echo $after;
  207.     }
  208. }
  209.  
  210.  
  211. function bfa_post_footer($before = '<div class="post-footer">', $after = '</div>')
  212. {
  213.     global $bfa_ata, $post;
  214.    
  215.     // don't display on WP Email pages
  216.     if(intval(get_query_var('email')) != 1) {
  217.        
  218.         if( (is_home() AND $bfa_ata['post_footer_home'] != "") OR
  219.         (is_page() AND $bfa_ata['post_footer_page'] != "") OR
  220.         (is_single() AND $bfa_ata['post_footer_single'] != "") OR
  221.         ( (is_archive() OR is_search() OR is_author() OR is_tag()) AND $bfa_ata['post_footer_multi'] != "") ) {
  222.            
  223.             echo $before;
  224.            
  225.             if ( is_home() )            $footertype = 'post_footer_home';
  226.             elseif ( is_page() )        $footertype = 'post_footer_page';
  227.             elseif ( is_single() )      $footertype = 'post_footer_single';
  228.             else                        $footertype = 'post_footer_multi';
  229.            
  230.             echo bfa_postinfo($bfa_ata[$footertype]);
  231.                    
  232.             echo $after;
  233.         }
  234.     }
  235. }
  236.  
  237.  
  238. function bfa_get_comments()
  239. {
  240.     global $bfa_ata;
  241.    
  242.     // Load Comments template (on single post pages, and "Page" pages, if set on options page)
  243.     if ( is_single() OR ( is_page() AND $bfa_ata['comments_on_pages'] == "Yes") ) {
  244.        
  245.         // don't display on WP-Email pages
  246.         if( intval(get_query_var('email')) != 1 ) {
  247.            
  248.             if ( function_exists('paged_comments') ) {
  249.                 // If plugin "Paged Comments" is activated, for WP 2.6 and older
  250.                 paged_comments_template();
  251.             } else {
  252.                 // This will load either legacy comments template (for WP 2.6 and older) or the new standard comments template (for WP 2.7 and newer)
  253.                 comments_template();
  254.             }
  255.         }
  256.     }
  257. }
  258. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement