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
  • 03:37 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / llms_quiz_question_show_ui.php
Last active June 20, 2019 07:13
Show LLMS quiz and question post type UI
<?php //<- don' copy this whole line!
// Copy from under this line and paste into your child theme's functions.php or in the LifterLMS Customization plugin
add_filter( 'register_post_type_args', 'my_llms_show_quiz_questions_ui', 10, 2 );
function my_llms_show_quiz_questions_ui( $args, $post_type ) {
if ( in_array( $post_type, array( 'llms_quiz', 'llms_question' ) ) ) {
$args['show_ui'] = true;
}
return $args;
}
@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 / featured_image_in_pages.php
Last active April 27, 2019 21:51
Show featured image in pages
@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 / tagline_below_logo.php
Last active September 1, 2018 07:36
Tagline below the logo
add_action('wp_head', 'move_tagline_below_logo');
function move_tagline_below_logo(){
if ( ! method_exists('TC_header_main', 'tc_tagline_display') )
return;
remove_action('__navbar', array(TC_header_main::$instance, 'tc_tagline_display'), is_rtl() ? 10 : 20 );
add_action('__after_logo', array(TC_header_main::$instance, 'tc_tagline_display') );
add_filter('tc_tagline_class', 'span7_to_12');
function span7_to_12( $_class){
@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 / 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();
}
@eri-trabiccolo
eri-trabiccolo / pp_donate_menu_item.php
Created February 10, 2015 17:25
Add paypal donate button in the menu
function get_ppdonate_form( $echo = true ){
ob_start();
// replace value="XXXX" with your button id
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXX">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
</form>
<?php
@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 / current_category_posts_no_children.php
Last active September 18, 2016 00:03
Show posts of the current category - no children
add_action('pre_get_posts', 'only_parent_category');
function only_parent_category( $query ){
if ( is_admin() || ! $query -> is_main_query() || ! is_category() )
return;
$query->set('category__and', get_queried_object_id());
//or with the same effect
//$query->set('category__in', get_queried_object_id());
//see https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters
}