I’m not sure if you can add styles in filters.
I tested the below code in wp_head action and worked perfectly:
function show_outlet_msg(){
$term = get_term( 40, 'product_cat' );
$total_products=$term->count;
if ($total_products>0){
$html="<style> #txt_outlet_zero{ display: none; } </style>";
} else {
$html="<style> #txt_outlet_head{ display: none; } </style>";
}
echo $html;
}
add_action('wp_head','show_outlet_msg');
Related Posts:
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- CSS change in woo commerce Place Order Text [closed]
- PHP function for horizontal Woocommerce thumbnails and badges
- How to hide a div section when user is logged in, in single product woocommerce
- Add Shortcode to ::before class
- Hot to edit WooCOmmerce dashboard?
- Display specific main Sub Nav on Woocommerce product pages
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- How to remove image on single product and get product to span page?
- How to add margin underneath woocommerce total price amount -> productpages
- How to create a container in php then customise it in CSS
- WooCommerce Checkout Cart [closed]
- Adding first / last CSS classes to menus
- WordPress Admin Bar pushed Sticky Footer off the bottom of the page
- How to get Woocommerce Variation ID? [closed]
- functions.php not adding css to website?
- Add product tag names to WooCommerce new order email subject
- How to display product cropped thumbnail (150×150) for WooCommerce product categories
- Add to checkout total lines an additional line below shipping in WooCommerce
- How To Change The Html of Products filtration sidebar in Woocommerce?
- How To add custom radio boxes to WooCommerce Billing page and change total price by this field?
- WooCommerce: update custom fields after checkout validation failure
- Trigger Woocommerce New User Email
- Woocommerce – remove product from category
- How Display Posts on category
- Parent theme CSS overriding child CSS rules
- Theme Options Page – User Updates Logo
- Dynamic Stylesheet loads but doesn’t finish
- How to add date to navigation bar
- Woocommerce product variation backorder
- Status 400 for AJAX POST Request with admin-ajax.php
- WooCommerce Webhooks not firing because of error in wp-includes/meta.php
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- Sum the total amount of a specific product purchased per user and display in table
- Incorrect MIME type for assets with Valet
- Customize position of social icons in upme plugin [closed]
- How to remove coupon dropdown feature
- Styling the second sidebar
- How to add drag and drop functionalities to a div inside option panel
- Add html link in functions.php files of the theme
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- Seo Friendly Filter URLs
- how can i add class or span tag at sprintf?
- Display attribute on shop page after the title
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- Have Woocommerce show product price if id, when not logged in
- Need help removing […] after excerpt
- jQuery accordion menu
- Twentyfifteen style author comment
- Custom reduce stock code affecting date_modified – How to bypass?
- Background image no longer fits to screen now that project is in php files
- WooCommerce Query Product Titles
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- How to add a shortcode which runs a .php file for the current post
- Variant Item SKU as Product Code
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- I want to fusion the product columns in email table order
- WooCommerce is_product_category() not working
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Best way to use variables in multiple functions?
- Display all categories including sub categories under a list ul
- Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Get product price in a different currency using WooCommerce Currency Switcher
- Hide author from search results meta, still display date and categories
- How to locate parent theme functions and add functions to my wordpress child theme?
- Adding product permalink on admin order page throwing error
- How to get total gross revenue for current month in the woocommerce dashboard status widget
- Add custom attribute to product’s HTML to woocommerce cart page
- Change WooCommerce template for PDF – access to custom field
- Get all woocommerce product names with price and show using core php
- Add custom ID attribute to all woocommerce products on archive pages
- How to properly create multiple conditions to redirect users roles to different pages
- How can i put php code on the wordpress page?
- How to detect if a revision was made by woocommerce or wordpress?
- How do I prevent a folder from reappearing in my home directory?
- jQuery doesn’t work in my php snippet
- Use WP_Query Data In Cookie
- Styling admin page rows in order of importance (checkboxes)
- featured post as div background
- Combining fancybox with multiple thumbnail plugin
- Show Nav Link To Users Signed In
- PHP Puzzle: Unique Styles with PHP loop
- How to add custom checkout field in user details mail template
- How to use plugins_url() inside PHP stylesheet file [duplicate]
- Add specific phrase after every product title including the discounted price? [closed]
- Display Sale Price Before Regular Price (WooCommerce)
- Setting WooCommerce currency programmatically
- WP_Query not returning results
- How do I link the side images?
- Show button in header when product custom field is not empty
- WordPress 6.1.1 UTF8 Slug Limit Increase
- How to change shipping method title based on cart amount?
- How to add SKU and remove product title from WooCommerce url?
- Product Search in search.php
- using custom pages for myaccount in woocommerce
- How to create different templates for woocommerce single-product.php?
- How do I make a shortcode to display Dokan seller badge list?
- Calling a PHP function from a menu item