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
  • 18:02 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / css_my_nav_menu_search.css
Created March 11, 2015 17:41
Search box in navbar CSS
/* my-nav-menu-search menu item created in functions.php. Move it way over to the right */
.navbar .nav .my-nav-menu-search {
float: right;
}
.navbar .nav {
width: 100%;
}
/*Stop the display of the Search button*/
.my-nav-menu-search .search-submit {
@eri-trabiccolo
eri-trabiccolo / mobile_slider.php
Last active August 29, 2015 14:16
different slider on mobile + centering slider feature disabled
add_action('template_redirect', 'mobile_slider');
function mobile_slider(){
if ( ! ( tc__f('__is_home') && wp_is_mobile() ) )
return;
// remove the following filter if you wanna keep the slider centering feature
add_filter('tc_customizr_script_params', 'no_center_slides');
function no_center_slides($params){
$params['centerSliderImg'] = 0;
return $params;
}
@eri-trabiccolo
eri-trabiccolo / menu_below_logo.php
Last active August 29, 2015 14:16
menu below the logo
/*Menu below the logo */
$navbar_wrapper_class = '';
add_action('wp', 'menu_below_logo');
function menu_below_logo(){
if ( ! method_exists('TC_menu', 'tc_menu_display') )
return;
global $navbar_wrapper_class;
$navbar_wrapper_class = implode( " ", apply_filters( 'tc_navbar_wrapper_class', array('navbar-wrapper', 'navbar-wrapper-below', 'clearfix', 'span12')));
@eri-trabiccolo
eri-trabiccolo / custom_post_lists_comp.php
Last active August 29, 2015 14:16
Customizr > 3.3.11 <? custom post lists
<?php /*Add the following code at the very beginning of your template file, just after the Template declarative block */ ?>
<?php
// strangely you have to set this to false, typo in the core code.
// useful just when you display the page which uses this template in home as static page
// consider that the navigation will not work properly (and not because of customizr :P)
add_filter('tc_display_customizr_headings', '__return_false');
add_filter('tc_post_list_controller', '__return_true');
@eri-trabiccolo
eri-trabiccolo / nav_title_off.php
Created March 6, 2015 15:15
disable navigation title with php
add_filter( 'tc_singular_nav_title', '__return_empty_string' );
add_filter( 'tc_list_nav_nav_title', '__return_empty_string' );
@eri-trabiccolo
eri-trabiccolo / czr-rtm_comp.php
Created March 6, 2015 08:51
Customizr - RTmedia plugin compatibility
add_filter('rtmedia_main_template_include', 'tc_rtmedia_comp', 20);
function tc_rtmedia_comp() {
global $wp_query;
$wp_query->is_singular = true;
}
/*DO NOT COPY THE FOLLOWING IN YOUR CHILD THEME FUNCTIONS.PHP */
/* The following css must be put in your child-theme style.css or in your custom css box */
/*
body.media {
@eri-trabiccolo
eri-trabiccolo / replace_socials_with_site_title_in_header.php
Last active August 29, 2015 14:16
replace socials with site title in header
add_action('wp_head', 'replace_socials_with_title');
function replace_socials_with_title(){
if ( ! ( class_exists('TC_header_main') &&
method_exists('TC_header_main', 'tc_title_view') &&
method_exists('TC_header_main', 'tc_social_in_header') ) )
return;
remove_action('__navbar', array(TC_header_main::$instance, 'tc_social_in_header'), 10 );
add_action('__navbar', 'site_title', 10);
function site_title(){
add_filter('tc_logo_class','__add_logo_classes', 30);
@eri-trabiccolo
eri-trabiccolo / rel_nofollow_to_elements.php
Last active September 1, 2018 07:00
Add rel nofollow to tags, author, date, thumbnails
add_filter('tc_display_post_thumbnail', 'strip_and_nofollow');
add_filter('tc_tag_list', 'strip_and_nofollow');
add_filter('tc_date_meta', 'strip_and_nofollow', 9999);
add_filter('tc_show_link_to_post_after_metas', 'strip_and_nofollow', 9999);
add_filter('tc_author_meta', 'strip_and_nofollow', 9999);
function strip_and_nofollow($text){
$text = stripslashes($text);
$text = preg_replace_callback('|<a (.+?)>|i', 'strip_and_nofollow_callback', $text);
return($text);
@eri-trabiccolo
eri-trabiccolo / change_footer_widgets_classes.php
Created February 25, 2015 08:57
Change footer widgets classes
@eri-trabiccolo
eri-trabiccolo / different-menu.php
Created February 20, 2015 15:26
Different menu
add_filter('tc_menu_args', 'my_menus');
function my_menus($args){
$page_menu = array(
//page_id => menu_id
'19' => '14',
'2' => '2'
);
if ( is_page() && array_key_exists(tc__f('__ID'), $page_menu) )
$args['menu'] = $page_menu[tc__f('__ID')];
return $args;