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
  • 09:50 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / post_title_featured_image.php
Last active August 29, 2015 14:23
Display the post title on post featured image
add_filter('tc_render_single_post_view', 'title_in_featured_image');
function title_in_featured_image( $_html ){
global $post;
$title = $post -> post_title;
if ( $title )
return str_replace('</section>', '<h2>'.$title.'</h2></section>', $_html);
return $_html;
}
add_filter('tc_user_options_style', 'title_in_featured_image_style');
function title_in_featured_image_style( $_css ){
@eri-trabiccolo
eri-trabiccolo / disable_breadcrumb_in_woocommerce_shop.php
Created June 19, 2015 07:38
Disable breadcrumb in woocommerce's shop page
add_filter('tc_show_breadcrumb', 'tc_display_shop_breadcrumb');
function tc_display_shop_breadcrumb( $bool ){
return ( function_exists('is_woocommerce') && is_woocommerce() && function_exists('is_shop') && is_shop() ) ? false : $bool;
}
@eri-trabiccolo
eri-trabiccolo / fp_4_5_span6.php
Created June 18, 2015 10:07
Featured pages 4 and 5 span6
add_filter('fpc_block_display', 'fp_four_five_span6');
function fp_four_five_span6( $_html ){
return str_replace( array('fpc-span4 fp-4', 'fpc-span4 fp-5'), array('fpc-span6 fp-4', 'fpc-span6 fp-5'),$_html);
}
@eri-trabiccolo
eri-trabiccolo / split_socials_css.css
Created June 17, 2015 15:00
Split socials part: css
.navbar-wrapper .inside.site-description { float: left;}
.inside.site-description + .social-block { text-align: right;}
@media (max-width: 979px){
.inside.site-description + .social-block { display: none;}
.outside .social-block {width: 100%; margin-left:0;}
}
add_filter('tc_tagline_display', 'display_default_socials');
function display_default_socials( $_tagline){
if ( ! method_exists('TC_header_main', 'tc_social_in_header') )
return;
ob_start();
TC_header_main::$instance -> tc_social_in_header();
$socials = ob_get_contents();
if ( $socials ) ob_end_clean();
add_filter('tc_default_socials', 'add_new_socials', 20);
function add_new_socials($socials){
global $wp_current_filter;
$new_socials = array(
//tc_yoursocial => array
'tc_delicious' => array(
'link_title' => __( 'Find me on Delicious'),
'option_label' => __( 'Delicious profile url' ),
'default' => "http://delicious.com/"
),
@eri-trabiccolo
eri-trabiccolo / before_logo_widget_area.php
Created June 17, 2015 12:41
Before logo widget area
add_filter( 'tc_default_widgets' , 'add_before_logo_widget' );
function add_before_logo_widget( $defaults ) {
$defaults['bl_widgets'] = array(
'name' => __( 'Before logo widget' , 'customizr' ),
'description' => __( 'Above the header\'s logo' , 'customizr' ),
);
return $defaults;
}
add_action('__header' , 'display_before_logo_warea');
function display_before_logo_warea() {
@eri-trabiccolo
eri-trabiccolo / customizr_full_boxed.php
Created June 16, 2015 07:33
Customizr full-boxed
/* BOXING */
add_action('after_setup_theme', 'tc_boxed');
function tc_boxed(){
// wrap header elements in a container
add_action('__header', 'tc_container_wrapper_start', 0);
add_action('__header', 'tc_container_wrapper_end', 100);
//wrap fpu elments in a container
if ( class_exists('TC_front_fpu') ){
@eri-trabiccolo
eri-trabiccolo / remove_no_effect_class.php
Created June 13, 2015 15:30
Thumbnail: Remove no-effect class
add_filter('tc_thumbnail_link_class', 'remove_no_effect_class');
function remove_no_effect_class( $_class ){
return str_replace('no-effect', '', $_class);
}
@eri-trabiccolo
eri-trabiccolo / hide_sticky_margin_active_slider.php
Created June 11, 2015 17:28
Hide sticky header reset margin when slider active
add_filter('tc_slider_active_status', 'hide_header_margin', 100);
function hide_header_margin( $bool ){
if ( $bool && method_exists('TC_menu', 'tc_reset_margin_top_after_sticky_header') )
remove_action('__after_header', array(TC_menu::$instance, 'tc_reset_margin_top_after_sticky_header'), 0);
return $bool;
}