* @copyright Copyright (c) 2013, Nicolas GUILLAUME
* @link http://themesandco.com/customizr
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
class TC_post {
//Access any method or var of the class with classname::$instance -> var or method():
static $instance;
function __construct () {
self::$instance =& $this;
//posts parts actions
add_action ( '__before_content' , array( $this , 'tc_post_header' ));
add_action ( '__after_content' , array( $this , 'tc_post_footer' ));
//add post header, content and footer to the __loop
add_action ( '__loop' , array( $this , 'tc_post_content' ));
//selector filter
add_filter ( '__article_selectors' , array( $this , 'tc_post_selectors' ));
}
/**
* Displays the conditional selectors of the article
*
* @package Customizr
* @since 3.0.10
*/
function tc_post_selectors () {
//check conditional tags : we want to show single post or single custom post types
global $post;
if ( !isset($post) )
return;
if ( 'page' == $post -> post_type || 'attachment' == $post -> post_type || !is_singular() )
return;
tc__f('rec' , __FILE__ , __FUNCTION__, __CLASS__ );
echo 'id="post-'.get_the_ID().'" '.tc__f('__get_post_class' , 'row-fluid');
}
/**
* The template part for displaying the single posts header
*
* @package Customizr
* @since Customizr 3.0
*/
function tc_post_header() {
//check conditional tags : we want to show single post or single custom post types
global $post;
if ( 'page' == $post -> post_type || 'attachment' == $post -> post_type || !is_singular() )
return;
if ( tc__f( '__is_home_empty') )
return;
if( in_array( get_post_format(), tc__f('post_type_with_no_headers') ) )
return;
tc__f('rec' , __FILE__ , __FUNCTION__, __CLASS__ );
ob_start();
?>
post_type || 'attachment' == $post -> post_type || !is_singular() )
return;
if ( tc__f( '__is_home_empty') )
return;
tc__f('rec' , __FILE__ , __FUNCTION__, __CLASS__ );
//display an icon for div if there is no title
$icon_class = in_array(get_post_format(), array( 'quote' , 'aside' , 'status' , 'link' )) ? 'format-icon':'';
ob_start();
?>
' ?>
→' , 'customizr' ) ); ?>
'' ) ); ?>
post_type || 'attachment' == $post -> post_type || !is_singular() )
return;
if ( !is_singular() )
return;
tc__f('rec' , __FILE__ , __FUNCTION__, __CLASS__ );
ob_start();
?>