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
  • 10:24 (UTC +01:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / remove-unwanted-slashes-from-access-plan-description.php
Last active May 27, 2019 09:56
Remove unwanted slashes added to the access plan description
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
$unslash_iterarions = 2; //at least 2 times
for ( $i = 1; $i <= $unslash_iterarions; $i++ ) {
add_filter( 'llms_access_before_save_plan', 'wp_unslash', $i );
}
@eri-trabiccolo
eri-trabiccolo / llms-focus-mode.css
Last active April 18, 2019 18:05 — forked from actual-saurabh/llms-focus-mode.css
LifterLMS Distraction Free Fullscreen mode
body.llms-is-focused .content-area {
background: #fff none;
padding:0;
overflow-y: auto;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
bottom:0;
@eri-trabiccolo
eri-trabiccolo / disable_dropdown_placement.php
Created October 7, 2016 08:38
Disable dropdown placement js feature in the Customizr(-PRO) theme
add_filter( 'tc_disabled_front_js_parts', 'pc_disable_dropdown_placement_script' );
function pc_disable_dropdown_placement_script( $_parts ){
return array_merge( $_parts, array('Czr_DropdownPlace' => array()) );
}
@eri-trabiccolo
eri-trabiccolo / use_woocommerce_breadcrumbs.php
Last active May 17, 2016 14:17
Use woocommerce breadcrumbs
add_action( 'wp', 'tc_woocommerce_breadcrumb', 100 );
function tc_woocommerce_breadcrumb() {
//do nothing if we're not in the wc context
if ( ! ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) )
return;
//turn off the theme's breadcrumb
add_filter( 'tc_opt_tc_breadcrumb', '__return_false' );
//display woocommerce breadcrumb before the main container
@eri-trabiccolo
eri-trabiccolo / archive-listing.php
Created February 17, 2016 08:41
Customizr - WP_Listings: Archive template
<?php
/**
* The template for displaying Listing Archive pages
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WP Listings
* @since 0.1.0
*/
@eri-trabiccolo
eri-trabiccolo / single-listing.php
Created February 17, 2016 08:35
Customizr - WP_Listings: Single template
<?php
/**
* The Template for displaying all single listing posts
*
* @package WP Listings
* @since 0.1.0
*/
add_action('wp_enqueue_scripts', 'enqueue_single_listing_scripts');
function enqueue_single_listing_scripts() {
@eri-trabiccolo
eri-trabiccolo / smartload_in_one_page.php
Created February 3, 2016 08:00
Customizr: smartload enabled in one specific page
add_filter('tc_opt_tc_img_smart_load', 'smartload_in_one_page');
function smartload_in_one_page() {
//is_page parameter : Page ID, title, slug, or array of such
return is_page('A') ? true : false;
}
@eri-trabiccolo
eri-trabiccolo / mini_header_mobile.css
Last active January 10, 2016 18:28
Mini header in mobile devs
@media (max-width: 979px) {
.tc-header {
border-bottom: none;
}
header.tc-header {
min-height: 40px;
}
.tc-header .brand {
@eri-trabiccolo
eri-trabiccolo / custom_post_types_no_customizr_mb.php
Created January 7, 2016 14:58
Remove Customizr meta boxes from custom post types
//remove customizr metaboxes from custom post types edit screen
add_action( 'add_meta_boxes', 'remove_customizr_metaboxes', 20 );
function remove_customizr_metaboxes() {
//array of custom post types
$custom_post_types = get_post_types( array( '_builtin' => false ) );
$current_post_type = get_post_type();
if ( in_array( $current_post_type, $custom_post_types ) ) {
remove_meta_box('layout_sectionid', $current_post_type, 'normal' );
remove_meta_box('slider_sectionid', $current_post_type, 'normal' );
}
@eri-trabiccolo
eri-trabiccolo / pl_fl_text_plus_thumbnails.php
Created January 6, 2016 20:42
Post list: Full length text along with post thumbnails
//first of all disable the grid in the contexts where we want the full length
add_filter('tc_is_grid_enabled', 'show_post_in_full_length' );
//force showing the full length text
add_filter('tc_show_excerpt' , 'show_post_in_full_length');
//force showing the thumb (if it exists)
add_filter('tc_show_thumb' , 'show_thumb_in_post_list_full_length');
function show_post_in_full_length($bool) {
if ( ! is_home() )
return $bool;//<= if current context is not home
//then use the global option set in Appearance > Customize > Pages & Posts layout