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
/* Allows focus on sub menu items by tabbing menu | |
------------------------------------------------ */ | |
.oxy-nav-menu:not(.oxy-nav-menu-open) .menu-item .sub-menu { | |
right: 5000px; | |
visibility: visible; | |
} | |
.oxy-nav-menu:not(.oxy-nav-menu-open).menu-item .sub-menu .sub-menu { | |
right: auto; |
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
var hash = window.location.hash.substr(1); | |
if (hash == '%%ELEMENT_ID%%') { | |
setTimeout(function(){ | |
jQuery([document.documentElement, document.body]).animate({ | |
scrollTop: jQuery('#' + '%%ELEMENT_ID%%').offset().top - 100 | |
}, 1000); | |
jQuery('#' + '%%ELEMENT_ID%%').trigger('click'); |
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
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( |
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( 'admin_bar_menu', 'lit_resign_adminbar_item', 1002 ); | |
/** | |
* Adds "Resign" menu item in the WordPress admin bar. | |
* | |
* @param WP_Admin_Bar $admin_bar WP_Admin_Bar instance, passed by reference. | |
*/ | |
function lit_resign_adminbar_item( $admin_bar ) { | |
if( !class_exists( 'CT_Component' ) ) { | |
return; |
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
<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_theme_support( 'responsive-embeds' ); |
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_head', 'lit_no_favicon'); | |
function lit_no_favicon() { | |
echo '<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />'; | |
} |
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
// Removes all CSS classes & ID's from menu items (only allows those listed) | |
add_filter('nav_menu_css_class', 'lit_strip_nav_menu'); | |
add_filter('nav_menu_item_id', 'lit_strip_nav_menu'); | |
function lit_strip_nav_menu($var) { | |
return is_array($var) ? array_intersect($var, array( | |
'current-menu-item', | |
'menu-item', | |
'menu-item-has-children', | |
'sub-menu' | |
) |