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 | |
// copy function into functions.php | |
function dpb_all_post_types( $post_types ) { | |
$args = array( | |
'public' => true, | |
'_builtin' => true | |
); | |
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 | |
if ( !function_exists( 'fb_browser_warning' ) ) { | |
function fb_browser_warning() { | |
?> | |
<style> | |
.fb_browser_warning { | |
position: relative; | |
background: #3B5998; | |
padding: 20px 20px 20px 80px; |
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 | |
function ClearLocalCacheButton() { ?> | |
// Create Button | |
<a href="#" onclick="ClearLocalCache()" class="et-pb-layout-buttons et-pb-layout-buttons-cache" title="Clear Cache"> | |
<span>Clear Cache</span> | |
</a> | |
<script type="text/javascript"> | |
// Move Button to Divi Tabs | |
jQuery(window).load(function(){ |
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 | |
function limit_wc_stock() { | |
global $product; | |
if ( $product->stock ) { | |
if ( number_format($product->stock,0,'','') < 100 ) { // If stock is less than 100 | |
/* Limit Quantity */ | |
function limit_wc_stock_quantity_args( $args, $product ) { | |
$args['max_value'] = 10; // Max value | |
return $args; | |
} |
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 to functions.php in child theme | |
function e_collapse_sections(){ | |
?> | |
<!-- Scripts and styles should enqueued properly but for the sake of having it all in one function...--> | |
<script> | |
if ( self !== top ) { // Check if we're in a preview window / iframe | |
jQuery(document).ready(function($){ |
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
/* example of use */ | |
h1:before { | |
font-family: 'etModules'; | |
content: "\24"; | |
} | |
/* codes */ | |
.arrow_up:before { | |
content: "\21"; |
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
function special_divi_header(){?> | |
<ul id="new-top-menu"> | |
<?php echo wp_nav_menu( array( 'theme_location' => 'secondary-menu' ) ); ?> | |
</ul> | |
<script> | |
jQuery(document).ready(function ($) { | |
$("<ul id='new-menu'></ul>").insertAfter("#et-top-navigation"); | |
$("#mobile_menu_slide .outside").clone().appendTo("#new-menu"); | |
$("#top-menu").insertBefore("#main-header .container"); |