Skip to content

Instantly share code, notes, and snippets.

View eri-trabiccolo's full-sized avatar
❤️
@thomasplevy is my buddy

Rocco Aliberti eri-trabiccolo

❤️
@thomasplevy is my buddy
  • Pinerolo (TO), Italy
  • 17:08 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / term_description_below_post_navigation.php
Last active January 22, 2016 10:53
Display term description below the post navigation
$term_description_filters = array(
'cat',
'tag',
'tax'
);
//do not automatically show term descriptions below the title
foreach ( $term_description_filters as $filter )
add_filter( "tc_show_{$filter}_description", "__return_false");
//show term description after the posts navigation
@eri-trabiccolo
eri-trabiccolo / taxo_desc_first_page.php
Created September 23, 2015 16:17
Display taxonomies descriptions only in the first page
foreach ( array( 'tc_show_cat_description', 'tc_show_tax_description', 'tc_show_tag_description') as $filter )
add_filter( $filter , 'taxos_description_first_page_only');
function taxos_description_first_page_only( $bool ){
return $bool && ! is_paged();
}
@eri-trabiccolo
eri-trabiccolo / fc_custom.php
Created September 23, 2015 16:00
Footer credits, custom
//don't display the designer credits in the colophon
add_filter('fc_show_designer_credits', '__return_false');
//add new string to the footer credits
add_filter('tc_credits_display', 'new_credits_string', 50);
function new_credits_string( $html ){
$new_string = 'All rights reserved';
return str_replace( '</div>', '<p>'.$new_string.'</p></div>', $html);
}
//needs social links displayed in the footer, they will be replaced.
add_filter('tc_colophon_left_block', 'designer_credits');
@eri-trabiccolo
eri-trabiccolo / disable_sticky_header_in_mobiles.php
Created September 23, 2015 11:53
Disable sticky header in mobiles
add_filter('tc_opt_tc_sticky_header', 'disable_sticky_in_mobiles');
function disable_sticky_in_mobiles( $bool ){
return $bool && ! wp_is_mobile();
}
@eri-trabiccolo
eri-trabiccolo / home_blog_title.php
Created September 22, 2015 08:01
Print "Blog" title in home page showing recent posts
add_action('__before_loop', 'print_blog_title', 0);
function print_blog_title(){
$blog_title = 'Blog';
if ( ! ( tc__f('__is_home') && get_option('show_on_front') == 'posts' ) )
return;
?>
<header class="entry-header">
<h1 class="entry-title"><?php echo apply_filters('tc_the_title', $blog_title ); ?></h1>
<hr class="featurette-divider __home_blog">
@eri-trabiccolo
eri-trabiccolo / replace_3d_fp_with_widget_area.php
Created September 21, 2015 12:13
Featured Pages Unilimited: replace third fp with a widget area
add_filter( 'tc_default_widgets' , 'add_my_custom_widget_areas' );
function add_my_custom_widget_areas( $defaults ) {
$defaults['fp_three'] = array(
'name' => __( 'Third featured page' , 'customizr' ),
'description' => __( 'Replace the third featured page with a widget area'),
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title fp-title">',
'after_title' => '</h2>',
);
@eri-trabiccolo
eri-trabiccolo / change_slide_title_tag.php
Created September 21, 2015 09:00
Change slide title tag
add_filter('tc_slide_title_tag', 'my_slide_title_tag');
function my_slide_title_tag(){
return 'h5';
}
@eri-trabiccolo
eri-trabiccolo / rtl_header_layout_test.php
Created September 18, 2015 14:55
RTL - header layout test
add_filter('tc_opt_tc_header_layout', 'my_rtl_layout');
add_filter('tc_opt_tc_menu_position', 'my_rtl_layout');
add_filter('tc_opt_tc_second_menu_position', 'my_rtl_layout');
function my_rtl_layout( $layout ) {
if ( ! is_rtl() ) return $layout;
$find_replace = array(
'find' => array( 'left', 'right', '_swap_' ),
'replace' => array( '_swap_', 'left', 'right' )
);
@eri-trabiccolo
eri-trabiccolo / slies_auto_width.css
Created September 16, 2015 14:24
Slides auto width and centered
div[id*=customizr-slider] .carousel-inner {text-align: center;}
div[id*=customizr-slider] .carousel-caption {margin-left: 0; /*centers the caption*/}
div[id*=customizr-slider] img { width: auto; display: inline-block; }
@eri-trabiccolo
eri-trabiccolo / different_logos_pages_cats.php
Last active September 11, 2015 17:14
Different logos on pages, categories
add_filter('tc_logo_attachment_img', 'my_logos');
function my_logos( $original_logo ){
$logo_where = array(
//id attachment => array ( pages, categories)
'630' => array( 'page' => array(10, 323, 13) , 'cat' => array('hollywood-events') ),
'562' => array( 'page' => array(18, 12, 586) , 'cat' => array('rockstar-events') ),
'561' => array( 'page' => array(8, 14, 580) , 'cat' => array('rocvenus-events') )
);
$logo = null;