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 a custom field to order line item | |
* @param $item_id | |
* @param $item | |
*/ | |
function add_order_item_custom_field($item_id, $item ) { | |
// Targeting line items type only | |
if ($item->get_type() == 'line_item') { |
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 | |
//Hide categories from WordPress category widget | |
function exclude_widget_categories($args){ | |
$exclude = "1,4,8,57,80"; | |
$args["exclude"] = $exclude; | |
return $args; | |
} | |
add_filter("widget_categories_args","exclude_widget_categories"); | |
?> |
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 | |
// Define list of ACF fields you want to search through - do NOT include taxonomies here | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array( | |
"main_title", | |
"buttons", | |
"section_title", | |
"policies", | |
"latest_press", |
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
//IE-10 | |
if (jQuery.browser.msie && jQuery.browser.version == 10) { | |
jQuery("html").addClass("ie10"); | |
} | |
// IE 11 | |
if(navigator.userAgent.match(/Trident.*rv:11\./)) { | |
jQuery('body').addClass('ie11'); | |
} |
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 echo "<script>console.log('" . json_encode($links) . "');</script>"; ?> |
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 a shortcode for search form in WordPress | |
* @url | |
*/ | |
function search_form_shortcode( ) { | |
get_search_form( ); | |
} | |
add_shortcode('search_form', 'search_form_shortcode'); |
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
if(isMobile || isTablet) { | |
$('.wow').addClass('wow-removed').removeClass('wow'); | |
} else { | |
$('.wow-removed').addClass('wow').removeClass('wow-removed'); | |
} |
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
@media screen and (max-width: 767px) { | |
.wpb_animate_when_almost_visible { | |
opacity: 1; | |
filter: alpha(opacity=100); | |
-webkit-animation: none; | |
-moz-animation: none; | |
-o-animation: none; | |
animation: none; | |
} | |
} |
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 filter_attributes_dropdown_pages_args($dropdown_args) { | |
$dropdown_args['post_status'] = array('publish','draft', 'private'); | |
return $dropdown_args; | |
} | |
add_filter('page_attributes_dropdown_pages_args', __NAMESPACE__ . '\\filter_attributes_dropdown_pages_args', 100, 1); | |
add_filter( 'quick_edit_dropdown_pages_args', __NAMESPACE__ . '\\filter_attributes_dropdown_pages_args', 100, 1); |
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
First: | |
Here’s an example of what you need to use for a 301 Redirect in OpenCart .htaccess file: | |
Redirect 301 /the-old-file.htm http://www.yourdomain.com/new-product-url? | |
or | |
Redirect 301 /the-old-file.htm http://www.yourdomain.com/new-product-url/? | |
Second: | |
just add below line in .htaccess file: | |
RewriteRule ^the-old-file.htm$ http://www.yourdomain.com/new-product-url [R=301,L] |