For Woocommerce product categories, use
<?php if ( is_product_category() ) {
echo '<div id="prodcatdesc">';
if ( is_product_category( 'shirts' ) ) {
echo 'Hi! Take a look at our sweet tshirts below.';
} elseif ( is_product_category( 'games' ) ) {
echo 'Hi! Hungry for some gaming?';
} else {
echo 'Hi! Check our our products below.';
echo '</div>';
}
} ; ?>
Or, for just one,
<?php
if ( is_product_category( 'shirts' ) ) {
echo '<div id="prodcatdesc">';
echo 'Hi! Take a look at our sweet tshirts below.';
echo '</div>';
} ;
?>
See https://docs.woocommerce.com/document/conditional-tags/
Put your inline styles, i.e. <div style="padding-top:85px;"><hr><p>
in CSS.
Related Posts:
- retrieve thumbnail from post ID of best selling product in category
- Woocommerce – remove product from category
- combine Code 1 with Code 2
- get current product name in functions.php
- Issue adding sub category programmatically
- Pass Category Name, Description and Photo into variables to pass to jQuery
- get taxonomy thumbnail and use it as a variable in code
- Only show size attributes in product box woocommerce when available
- WooCommerce: Display product categories to make IF statement
- Display Sibling WooCommerce Product Categories on Archive Page
- Woocommerce. Get a list of products in the current category on the archive page and product page
- Add Custom Category Description When Empty
- Add a product category to a specific product via a button
- random woocommerce categories are not showing when count enabled?
- WordPress using get_term to retreive slug not working as expected
- Product Category Page in Full Width
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Woocommerce get selected shipping zone id for the current user
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- How to show order data by multiple ID?
- Problem with Woocommerce REST API Authentication
- Categories Template Assistance
- Remove General Tab and Plugin Tab in Settings in Woocommerce
- WooCommerce – Display variation custom field value [closed]
- Woocommerce HTML email option unavailable
- Use template for posts with a particular category grandparent
- How to add SVG icon above product tab title
- How to change / delete product short description in Woocommerce
- How to trash multiple post/product programmatically
- OrderItem get_total() returns lower value than $order_item->get_product()->get_price() * quantity
- Custom category code not showing all posts
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- WooCommerce – Reset quantity input field when variation changes
- Custom Text in WooCommerce Order Processing Email Based on Products
- Automatically remove a canceled order in Woocommerce
- How can I apply_filters from inside a function?
- Different Minimum Order Amounts based on Shipping Zone [closed]
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Displaying Woocommerce Product Category in WordPress
- Displaying custom taxonomy on WooCommerce product page
- Change “add to cart” button color based on Woocommerce product category [closed]
- Add to cart function not working for first product when cart is empty [closed]
- Woocommerce : Can’t get product info in loop
- Let Users Choose Post Categories
- Display most popular posts of category
- Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?
- Single Quotes in .php file doesn’t load website
- How to upload WP user avatar on woocommerce account page [closed]
- How to relocate paypal button gateway on checkout page in woocommerce
- Argument for if term-> have child?
- How do I run code every 24 hours?
- Woocommerce Product_cat for current category page
- Echoing a CSS class based on category of post in a list
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- WooCommerce “Checkout Now” button [closed]
- WordPress custom taxonomy
- Finding and removing duplicates within WP Arrays
- Compare current post Category in select menu
- Get the list of post categories
- How can I enter on the Thank you page in woocommerce the discount code I assigned to the product category?
- How to show categories and date on posts
- Woocommerce append shipping method form
- Add a “custom field” to a category that can be retrieved when viewing the category page with get_post_meta
- Allow two posts (from different categories) to have the same slug
- How do I check if a product is in two categories?
- php code for outputting a custom page in my account
- Hide specific shipping methode depending on day and time of day
- Adding custom field to product category and show it to shop/category shop page
- How to hide a div section when user is logged in, in single product woocommerce
- Remove span tags from WooCommerce Downloads page
- How to enable HTML tags in category description without breaking the category page
- Global variable doesnt’t pass to another function
- Exclude category from woocommerce product category list
- Trying to show the category of a post in the post display
- How to empty price of simple and variable product when product changed into out off stock
- How to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- How to echo a PHP code into WooCommerce variation product?
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- Woocommerce custom attributes list help
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- Global filter not working
- How to list categories by page id in wordpress
- Can’t make product images clickable
- Showing the project type in HREF
- WooCommerce – Print Processing orders [closed]
- Front end post submissions do not get submitted in the category
- Hide cart when empty [closed]
- Trying to exclude posts from a category on the home page
- Showing Subcategory’s Name and Link Instead of Parent Category’s
- Order woo products, but first products must be with acf fields
- Remove /category/ from category (archive) page URLs (without using a plugin)
- Warning: Attempt to read property “term_id” on int – Woocommerce
- Remove Woocommerce product from cart with ajax/fetch
- Automatically change insurance quantity based on cart total [closed]
- Why does WordPress not send the user the email to add a password?
- WooCommerce Modal Fly cart on add to cart – With AJAX
- Hide ‘Downloadable’ and ‘Virtual’ checkbox options from Woocommerce Variations?