This is what I have used to show the product category as a subtitle on my shop archive page
add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_shop_loop_item_subtitle', 20 );
function woocommerce_shop_loop_item_subtitle() {
global $post, $product;
$categ = $product->get_categories();
echo $categ;
}
and this is what I used to display it on the single product page
add_action( 'woocommerce_single_product_summary', 'woocommerce_single_item_subtitle', 5 );
function woocommerce_single_item_subtitle() {
global $post, $product;
$categ = $product->get_categories();
?>
<div class="cat-subtitle">
<?php
echo "by " ,$categ;
?>
</div>
<?php
}
You can change what is echoed to output the field you want.
Related Posts:
- Updating WooCommerce variable product stock issue
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Get product attribute for Simple product in WooCommerce
- Custom Shipping method not showing in checkout
- Sort products without thumbnail in WooCommerce shop page
- Create or Update thousands of woocommerce products via PHP
- Add multiple attributes to product from php
- Make specific products accessible only to a user role in WooCommerce
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How can I display a contact form for out of stock products in WooCommerce?
- woocommerce 3.2.1 not sending order notification emails
- WooCommerce Custom Product to checkout
- Automatically add attributes to woocommerce product?
- How to enable specific plugin only based around shop manager role?
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- Replacing a plugin function with a custom renamed function doesn’t work
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- WooCommerce specifc variations for specific user role [closed]
- Redirect to another page using contact form 7? [closed]
- PHP Error When a plugin is active
- Show icons or badges under title on product archives/category pages
- WordPress Stock Update Programatically
- Woocommerce Backend Search by Title and SKU
- WooCommerce Shopping Cart Not Initially Showing Products [closed]
- How to add a new column with text fields to WooCommerce Cart List?
- I am trying to make a field show and save from quickedit screen
- How to include a custom field in the woocommerce email?
- How to display registered customer list as dropdown in WooCommerce checkout?
- How to change WooCommece variation data programmtically [closed]
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- .php file for woocommerce edit category? [closed]
- Override a Plugin Function
- dynamically create callback functions inside a for loop
- Add key and value to an array in another file
- Custom search search does not work?
- How to change layout of shop page in wordpress? [closed]
- Get product categories and add them to a custom taxonomy
- woocommerce remove coupon link does not work
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- How to get brand children with woocommerce brands
- Display top level parent category as a single product body class (Woocommerce)
- Show prices with tax Inclusive in Minicart widget
- Woocommerce add products to cart
- Plugin which unlock free gift when you reach some amount in cart
- is there a way to display product gallery images via cdn
- Changing wordpress/woocommerce notices default message to other languages (text)
- How can I find related learndash course id from woocommerce product object?
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Google Maps for Woocommerce Checkout
- Easiest way to load/fire a handful of functions, IF checkbox is checked?
- my hook or my function wont run in the cronjob
- Add a WooCommerce Product Variant with attributes programmatically
- Change Woo Custom Endpoint Titles from a Plugin
- Woocommerce – Change variations output
- Configuring default woo commerce login with modal popup
- Woocommerce list variations that are added already to cart in Single Product
- Change (replace) word in metabox
- redirect to a custom page
- Change pricing in Woocommerce based on Category and Product [closed]
- How to change the product short description for each product with PHP?
- Problem with conditional woocommerce custom checkout field
- How to allow customers to input a text as a product variation *and* charge per character?
- Woocommerce: deleted single-product.php, everything still works. How is it possible?
- Unable to show 4 products in a row
- Move related products after product summary? [closed]
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- How to execute init or woocommerce_init only for checkout page
- Visual Composer Data Source?
- Woocommerce disable checkout on specific day
- Populate Woocommerce order notes with custom field value
- Woocommerce Product Add-ons – Auto-select first option
- Translate text for empty product
- Adding a script & php to functions.php
- How to add a text in the checkout page woocomerce?
- Shortcode inside a redirect [closed]
- How to add a static image inbetween the product tiles on main shoppage woocommerce?
- I want create woocommerec match products columns
- How to create different woocommerce single_product.php pages for each product? [closed]
- When unit testing a plugin, does the plugin need to be in the wp-content/plugins directory of the WordPress tests install?
- How Restrict access to admin dashboard by specific static ip?
- How to get images from EDD post?
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- wp_get_post_terms is difference obj model than the one in rest api response
- WordPress shows error related to allow_url_fopen
- Delete mobile menu button [closed]
- How to replace WordPress Media Upload Window with user’s device window?
- Product count in archive page Title in WooCommerce [closed]
- Pass user role to javascript code inside body
- Customize Menu | Styling LESS/SCSS code formats
- Woocommerce Export and import Orders
- How to get the custom field value using SQL query
- Add a Custom email notification to WC actions
- Possible way of having multiple Gutenberg instances for a page?
- I want add repository theme folder
- plugins_loaded action is not working properly
- I want to set a different banner for each product in the woocommerce plugin on my wordpress site
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- How to override plugin function in code snippets WordPress