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
  • 04:23 (UTC +02:00)
View GitHub Profile
add_action('__before_body', 'html5shiv', -1);
function html5shiv(){?>
<!--[if lte IE 8]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php
}
@eri-trabiccolo
eri-trabiccolo / swap_logo_navbar.php
Created April 19, 2015 12:09
Swap logo and navbar
add_action('wp_head', 'swap_logo_navbar');
function swap_logo_navbar(){
if ( ! ( method_exists('TC_header_main', 'tc_prepare_logo_title_display') &&
method_exists('TC_header_main', 'tc_navbar_display') ) )
return;
remove_action('__header', array(TC_header_main::$instance, 'tc_prepare_logo_title_display'), 10 );
remove_action('__header', array(TC_header_main::$instance, 'tc_navbar_display'), 30 );
add_action('__header', array(TC_header_main::$instance, 'tc_prepare_logo_title_display'), 30 );
@eri-trabiccolo
eri-trabiccolo / move_customizr_breadcrumb.php
Created April 17, 2015 17:22
Move Customizr breadcrumb from __before_main_container to _after_main_container
add_action('template_redirect', 'move_breadcrumb');
function move_breadcrumb(){
remove_action('__before_main_container', array(TC_breadcrumb::$instance, 'tc_breadcrumb_display'), 20 );
add_action('__after_main_container', array(TC_breadcrumb::$instance, 'tc_breadcrumb_display'), 10 );
}
@eri-trabiccolo
eri-trabiccolo / colophon_center_widget_area_credits_right.php
Created April 13, 2015 17:34
Replace credits block with a widget area, move credits right
add_filter( 'tc_default_widgets' , 'add_credits_widget');
function add_credits_widget( $defaults ) {
$defaults['credits_widgets'] = array(
'name' => __( 'Colophon Credits Widget' , 'customizr' ),
'description' => __( 'In the central colophon block' , 'customizr' )
);
return $defaults;
}
add_filter('tc_credits_display' , 'display_my_credits_widget', 20);
@eri-trabiccolo
eri-trabiccolo / center-menu.css
Last active August 29, 2015 14:19
Center menu
.navbar-inner{
padding-right: 5px;
}
.tc-header .nav-collapse{
float: none;
}
.navbar .nav {
width: 100%;
text-align: center;
-webkit-box-sizing: border-box;
@eri-trabiccolo
eri-trabiccolo / slider_wrapper.php
Created April 10, 2015 06:50
Slider wrapper div
add_filter('tc_slider_display', 'my_slider_wrapper');
function my_slider_wrapper( $_slider ){
return '<div id="my-slider-wrapper">' . $_slider . "</div>";
}
@eri-trabiccolo
eri-trabiccolo / sticky-enabled-header-no-changes.css
Created April 9, 2015 16:22
Sticky enabled header no changes
/* Center logo/title and navbar when sticky enabled */
.sticky-enabled .logo-centered .navbar-wrapper{
float: none;
margin: auto;
clear: both;
}
.sticky-enabled .logo-centered .brand{
width: 100%;
}
@eri-trabiccolo
eri-trabiccolo / img_tagline.php
Created April 9, 2015 08:06
Image in tagline
add_filter( 'tc_tagline_display' , 'my_image_in_tagline');
function my_image_in_tagline() {
global $wp_current_filter;
$image_src = 'http://presscustomizr.com/wp-content/uploads/2015/04/press-customizr-logo1.png';
$image_alt = 'My image';
$img = "<img src='$image_src' alt='$image_alt' class='my-img-tagline'>";
?>
<?php if ( !in_array( '__navbar' , $wp_current_filter ) ) :?>
<div class="container outside">
@eri-trabiccolo
eri-trabiccolo / replace_credits_block_with_widget_area.php
Created April 8, 2015 07:28
Replace credits block with a widget area
// Disable customizr-pro credits
/* You can achieve the same by unchecking "Enable the footer copyrights and credits" in the Footer options*/
add_action('after_setup_theme', 'disable_pro_credits', 40);
function disable_pro_credits(){
if ( method_exists('TC_fc', 'fc_custom_credits') ){
remove_filter( 'tc_credits_display', array(TC_fc::$instance, 'fc_custom_credits') );
}
}
add_filter( 'tc_default_widgets' , 'add_credits_widget');
@eri-trabiccolo
eri-trabiccolo / change_header_social_block_class.php
Created April 3, 2015 07:41
Change header's social block class
add_filter('tc_social_header_block_class', 'my_social_header_block_class', 20);
function my_social_header_block_class( $classes ){
return str_replace('span5', 'span1', $classes); /* From 5 columns to 1 column*/
}