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
  • 05:18 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / flex_map_after_header.php
Created May 6, 2015 07:05
Add wp flexible map before below the header in a Customizr page
add_action('__after_header', 'my_map', 20);
function my_map(){
/* use page slug or name or id */
if ( ! is_page('sample-page') )
return;
/* Shortcode example from https://wordpress.org/plugins/wp-flexible-map/installation/ */
$map = '[flexiblemap center="-34.916721,138.828878" width="100%" height="400px" zoom="9" title="Adelaide Hills" description="The Adelaide Hills are repleat with wineries."]';
echo do_shortcode($map);
}
@eri-trabiccolo
eri-trabiccolo / fp_pages.php
Last active June 14, 2016 09:06
different featured pages in different pages
$page_fpc = array(
'2' => array(
'per_row' => 3,
'fp' => array(
'one' => '8',
'two' => '9',
'three' => '10',
'4' => '12',
'5' => '7'
),
@eri-trabiccolo
eri-trabiccolo / tb_single_selected_posts.php
Created May 4, 2015 17:19
Thumbnails in single selected posts
add_filter('tc_opt_tc_single_post_thumb_location', 'show_post_thumb');
function show_post_thumb( $opt ){
//posts id
$my_posts = array(
1,
2,
3,
);
return is_single( $my_posts ) ? $opt : false;
@eri-trabiccolo
eri-trabiccolo / featured_image_in_pages.php
Last active April 27, 2019 21:51
Show featured image in pages
@eri-trabiccolo
eri-trabiccolo / custom_featured_pages_imgs.php
Created April 27, 2015 14:15
Custom images for featured pages
@eri-trabiccolo
eri-trabiccolo / swap_h1_h2_tagline_slider.php
Last active August 29, 2015 14:19
Swap h1 and h2 in tagline (destkop mode, in home) and slider
add_filter('tc_slide_title_tag', 'swap_h1_h2');
add_filter('tc_tagline_tag', 'swap_h1_h2');
function swap_h1_h2( $tag ){
global $wp_current_filter;
$search_replace = array(
'h1' => 'h2',
);
if ( current_filter() == 'tc_tagline_tag' ){
if ( tc__f('__is_home') && in_array('__navbar', $wp_current_filter ) )
@eri-trabiccolo
eri-trabiccolo / center_menu_full_width.css
Last active August 29, 2015 14:19
Center menu and full width
/* CENTER NAVBAR */
.tc-no-sticky-header .tc-header .navbar-inner,
.sticky-disabled .tc-header .navbar-inner {
padding: 0 !important;
margin: 0 !important;
}
.tc-no-sticky-header .tc-header .navbar-wrapper,
.sticky-disabled .tc-header .navbar-wrapper {
width: 100%;
}
@eri-trabiccolo
eri-trabiccolo / custom_tax_archive_title_patch.php
Created April 22, 2015 15:54
Custom tax archive title patch
add_filter('tc_display_customizr_headings', 'display_headings_in_archives', 20);
function display_headings_in_archives( $bool ){
return is_archive() ? false : $bool;
}
add_filter('tc_archive_header_class', 'my_tax_header_class', 100 );
function my_tax_header_class( $_title ){
return is_archive() ? array('archive-header') : $_title;
}
add_filter('tc_headings_archive_html', 'my_tax_title_description', 100 );
function my_tax_title_description( $_title ){
@eri-trabiccolo
eri-trabiccolo / grid-one-category.php
Created April 21, 2015 07:55
Grid in one category
add_action('template_redirect', 'grid_one_category');
function grid_one_category(){
if ( ! is_category('test') )
return;
/* Enable the grid */
add_filter('tc_is_grid_enabled', '__return_true');
/* Enable the Pro grid effects */
add_filter('tc_is_grid_customizer_enabled', '__return_true');
}
@eri-trabiccolo
eri-trabiccolo / menu-items.css
Created April 21, 2015 07:34
Menu items selectors
/* 1st level */
.navbar .nav > li > a {
color: red;
}
/* 1st level hover/focus */
.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus {
color: green;
}
/* 1st level current page and parent */