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
  • 02:50 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / wp_visual_slidebox_builder_compatibility.php
Created August 19, 2015 10:07
WP Visual slidebox builder compatibility
/* WP Visual slidebox builder compatibility */
// don't load wp-visual-slidebox plugin bootstrap js
add_action('wp_print_scripts', 'remove_bootstrap_js');
function remove_bootstrap_js(){
if ( is_admin() ) return;
wp_dequeue_script('bootstrap_js');
}
// don't load wp-visual-slidebox plugin bootstrap.css
add_action('wp_print_styles', 'remove_bootstrap_css');
function remove_bootstrap_css(){
@eri-trabiccolo
eri-trabiccolo / exclude_skins.php
Last active January 10, 2016 13:05
Exclude skins from random skins
add_filter('tc_skins_to_randomize', 'exclude_skins');
function exclude_skins( $_skins ){
$_my_excluded = array(
'grey.css',
'grey2.css'
);
foreach ( $_my_excluded as $key )
if ( array_key_exists( $key, $_skins ) )
unset( $_skins[$key] );
@eri-trabiccolo
eri-trabiccolo / replace_post_author_label_comments.php
Created August 17, 2015 15:33
Replace "Post author" label in comments
add_filter('tc_comment_callback', 'replace_post_author');
function replace_post_author( $html ){
$_my_replace = 'admin';
return str_replace('Post author', $_my_replace, $html);
}
@eri-trabiccolo
eri-trabiccolo / prevent_creation_unwanted_imagesizes.php
Created August 11, 2015 15:39
Prevent creation of unwanted image sizes
add_action('after_setup_theme', 'prevent_creation_unwanted_imagesizes', 20);
function prevent_creation_unwanted_imagesizes(){
remove_image_size('slider-full'); /* full slider */
remove_image_size('tc-thumb'); /* post list alternate layout and featured pages */
remove_image_size('tc-rectangular-thumb'); /* alternate layout rectangular thumbs and post featured image */
remove_image_size('tc-grid'); /* grid for more than one column */
}
@eri-trabiccolo
eri-trabiccolo / html_after_fp_home.php
Last active August 29, 2015 14:27
Customizr-Pro: Html after the featured pages in home
add_filter('fpc_block_display' , 'html_after_fpc');
function html_after_fpc( $html) {
$_my_html = 'some html here';
return $html . $_my_html . '<hr class="featurette-divider">';
}
@eri-trabiccolo
eri-trabiccolo / widget_area_after_fp_home.php
Last active August 29, 2015 14:27
Customizr-Pro: Widget area after the featured pages in home
add_filter( 'tc_default_widgets' , 'add_featured_page_widget' );
function add_featured_page_widget( $defaults ) {
$defaults['fp_widgets'] = array(
'name' => __( 'Featured Pages Widget' , 'customizr' ),
'description' => __( 'Above the featured pages area on home' , 'customizr' )
);
return $defaults;
}
add_filter('fpc_block_display' , 'display_my_fp_widget');
@eri-trabiccolo
eri-trabiccolo / pages_in_home_blog.php
Created August 7, 2015 10:27
Display pages in home blog
add_action('pre_get_posts', 'display_pages_in_home');
function display_pages_in_home( $query ){
if ( ! ( $query -> is_main_query() && $query -> is_home() ) )
return;
//do not show sticky post, since we display pages
add_filter('tc_grid_expand_featured', '__return_false');
$query-> set('post_type' , 'page' );
}
@eri-trabiccolo
eri-trabiccolo / temp_fancybox_inline_fix.php
Created August 3, 2015 17:14
Temporary fix for fancybox inline bug
add_action('wp_footer', 'fancybox_inline_iframe');
function fancybox_inline_iframe(){
?>
<script type="text/javascript">
( function($){
"use strict";
if ( 1 != TCParams.FancyBoxState || 'function' != typeof($.fn.fancybox) )
return;
@eri-trabiccolo
eri-trabiccolo / home_widget_area_after_posts.php
Created August 3, 2015 12:51
Home widget area after posts
add_filter( 'tc_default_widgets' , 'add_my_hap_widget_area' );
function add_my_hap_widget_area( $defaults ) {
$defaults['hap-widget-area'] = array(
'name' => 'Home Widget Area',
'description' => 'Extra widget area after posts',
'before_widget' => '<div class="widget my-hap-widget">',
'after_widget' => '</div>',
);
return $defaults;
}
@eri-trabiccolo
eri-trabiccolo / customizr_wp_page_navi.php
Last active January 5, 2017 09:11
Replace Customizr navigation with wp_page_navi
add_filter('tc_post_nav', 'my_post_nav');
function my_post_nav( $nav ){
if ( !function_exists('wp_pagenavi') )
return $nav;
wp_pagenavi();
}