This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$my_home_slider_height = '250'; /*in pixels*/ | |
function is_home_slider(){ | |
$tc_front_slider = TC_utils::$inst->tc_opt( 'tc_front_slider' ); | |
return ( tc__f('__is_home') && $tc_front_slider && method_exists('TC_slider', 'tc_slider_display') ); | |
} | |
add_action('template_redirect', 'my_home_slider_in_content', 100); | |
function my_home_slider_in_content(){ | |
if ( ! is_home_slider() ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* will not work with the expanded post in post list grid */ | |
add_action('__before_content_title', 'show_date_before_title'); | |
function show_date_before_title(){ | |
$method_exists = ( array_product( array( | |
method_exists('TC_post_metas', 'tc_get_meta_date'), | |
method_exists('TC_post_list', 'tc_post_list_controller'), | |
method_exists('TC_post_list_grid', 'tc_is_grid_enabled'), | |
))); | |
if ( $method_exists && ( TC_post_list_grid::$instance -> tc_is_grid_enabled() || TC_post_list::$instance -> tc_post_list_controller() ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'tc_show_slider' , '__return_true' ); | |
add_filter( 'tc_slider_active_status' , '__return_true' ); | |
//display in full width ? | |
add_filter( 'tc_slider_layout' , '__return_true' ); | |
//force the slider name to the front page slider name | |
add_filter( 'tc_slider_name_id', 'force_slider_name'); | |
function force_slider_name() { | |
return method_exists('TC_utils', 'tc_opt') ? TC_utils::$inst->tc_opt( 'tc_front_slider' ) : ''; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'tc_no_result_content', 'add_something_below_search_box' ); | |
function add_something_below_search_box( $_html){ | |
$html = 'something'; | |
return str_replace('</form>', '</form>'.$html, $_html); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('pre_get_posts', 'pagination_home'); | |
function pagination_home( $query ){ | |
if ( $query -> is_main_query() && is_page() && $query->get( 'page_id' ) == get_option( 'page_on_front' ) && $query->get('page') ) | |
$query -> set('paged', $query->get('page') ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('pre_get_posts', 'show_two_selected_posts_in_home_blog'); | |
function show_two_selected_posts_in_home_blog($query){ | |
if ( ! is_admin() && $query -> is_main_query() && is_home() && 'posts' == get_option('show_on_front') ){ | |
$query->set('post__in', array(183, 94) ); //put your post IDs in that array | |
$query->set('ignore_sticky_posts', 1 ); //don't show sticky posts | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('pre_get_posts', 'show_two_posts_in_home'); | |
function show_two_posts_in_home($query){ | |
if ( ! is_admin() && $query -> is_main_query() && tc__f('__is_home') && ! tc__f('__is_home_empty') ){ | |
$query->set('posts_per_page', 2); | |
// remove pagination | |
add_filter('tc_show_post_navigation', '__return_false', 999); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Runs before the posts are fetched | |
add_action( 'pre_get_posts' , 'specific_category_reverse_post_order' ); | |
function specific_category_reverse_post_order( $query ) { | |
// Alter only the primary query and only if we are in post lists context | |
// How to use is_category -> http://codex.wordpress.org/Function_Reference/is_category | |
if( ! ( $query->is_main_query() && is_category('3') ) ) | |
return; | |
$query->set( 'order' , 'ASC' ); |