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 | |
/** | |
* | |
* Create Shortcode for WooCommerce Basket Item and WooCommerce Account Item | |
* @link https://wpbeaches.com/add-woocommerce-cart-icon-to-menu-with-cart-item-count/#just-icon | |
*/ | |
function mic_woo_cart_but() { | |
ob_start(); | |
$cart_count = WC()->cart->cart_contents_count; // Set variable for cart item count |
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 | |
/** | |
* | |
* Prevent update notification for plugin | |
* | |
*/ | |
function ns_disable_plugin_updates( $value ) { | |
$pluginsToDisable = [ | |
'plugin-folder/plugin.php', |
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
/** | |
* | |
* Redirect all users that are not in the users array to the wp-admin dashboard page if trying to access the pages below declared | |
* | |
*/ | |
if ( ! function_exists( 'ns_redirect_users_by_role' ) ) : | |
function ns_redirect_users_by_role() { | |
global $pagenow; |
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 | |
/** | |
* | |
* Default/fallback post thumbnail image. | |
* | |
*/ | |
function aoa_filter_thumbnail_id( $thumbnail_id, $post = null ) { | |
if ( ! $thumbnail_id ) { |
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_shortcode( 'wp-nav-slider', 'nav_slider' ); | |
function nav_slider( $atts ) { | |
if(empty($atts['id'])){ | |
echo 'enter menu id'; | |
return; | |
}?> | |
<div class="nav-slider-main"> | |
<div class="nav-slider-inner swiper-container"> |
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
SELECT | |
p.ID as 'Subscription ID', | |
p.post_status as 'Subscription Status', | |
pm1.meta_value as 'Billing First Name', | |
pm2.meta_value as 'Billing Last Name', | |
pm3.meta_value as 'Billing Email', | |
oitems.order_item_name as 'Product', | |
pm4.meta_value as 'Order Total', | |
pm5.meta_value as 'Order Tax' | |
FROM wp_posts p |
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
SELECT | |
p.ID as 'Subscription ID', | |
p.post_status as 'Subscription Status', | |
pm1.meta_value as 'Billing First Name', | |
pm2.meta_value as 'Billing Last Name', | |
pm3.meta_value as 'Billing Email', | |
oitems.order_item_name as 'Product', | |
pm4.meta_value as 'Order Total', | |
pm5.meta_value as 'Order Tax' | |
FROM wp_posts p |
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 | |
/** | |
* | |
* Shortcode to show post title truncated | |
* | |
* [posttitle] | |
* | |
*/ | |
function ns_post_title_shortcode(){ | |
return wp_trim_words( get_the_title(), 10 ); |
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 | |
/** | |
* | |
* Shortcode to show parent category | |
* | |
* [postcat] | |
* | |
*/ | |
function ns_post_cat_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
<?php | |
/** | |
* | |
* Post estimated reading time shortcode | |
* | |
*/ | |
function ns_reading_time_shortcode() { | |
$content = get_post_field( 'post_content', $post->ID ); |
NewerOlder