This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Main column width */ | |
.wp-block { | |
max-width: 900px; | |
} | |
/* Width of "wide" blocks */ | |
.wp-block[data-align="wide"] { | |
max-width: 1100px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action("wp_footer", "ct_footer_script_hook", 20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function( $ ){ | |
var element = $( ".element-class" ); | |
function fade_element() { | |
window_scroll = $(this).scrollTop(); | |
element.css({ | |
'opacity' : 1-(window_scroll/300), | |
'transform' : "translate(0,"+ +(window_scroll/2) + "px)" }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_print_styles', 'lit_deregister_editor_styles', 100 ); | |
/** | |
* Removes WP block editor styles | |
*/ | |
function lit_deregister_editor_styles() { | |
if ( !is_singular('post') ) { // If isn't a single post, remove excess block libary CSS | |
wp_dequeue_style( 'wp-block-library' ); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Filter the WP Rest API URL. | |
add_filter('rest_url', function($url) { | |
$url = str_replace(home_url(), site_url(), $url); | |
return $url; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'allowed_block_types', 'lit_allow_these_block_types' ); | |
function lit_allow_these_block_types( $allowed_blocks ) { | |
// Below is the array of blocks that ARE allowed, so comment out to remove from the editor. | |
return array( | |
'core/image', | |
'core/paragraph', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove default Oxygen.css | |
add_action( 'oxygen_enqueue_scripts', 'lit_dequeue_scripts' ); | |
function lit_dequeue_scripts() { | |
wp_dequeue_style("oxygen"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'enqueue_block_editor_assets', 'lit_add_gutenberg_styles' ); | |
/** | |
* Add backend styles for Gutenberg | |
*/ | |
function lit_add_gutenberg_styles() { | |
wp_enqueue_style( 'custom-gutenberg-editor-styles', plugin_dir_url( __FILE__ ) . '/editor-styles.css'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form role="search" method="get" id="searchform" class="searchform" action="https://yoursite.com/"> | |
<div> | |
<label class="screen-reader-text" for="s">Search for:</label> | |
<input type="text" value="" name="s" id="s"> | |
<input type="hidden" value="product" name="post_type" /> | |
<input type="submit" id="searchsubmit" value="Search"> | |
</div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('wp_oxy_reusable_block', 'lit_reusable_block_sc'); | |
/** | |
* Add a shortcode to allow resuable blocks, that are created in WP editor, to be inserted in Oxygen templates using their IDs | |
* | |
* Sample usage: [wp_oxy_reusable_block id='2543'] | |
*/ | |
function lit_reusable_block_sc( $atts ) { | |
$attributes = shortcode_atts( | |
array( |
OlderNewer