Comments sourav started the conversationJune 3, 2024 at 2:56amHi , is it possible to add some custom data some text with a link on the single product page for a specific product or category. I have attached an image below that indicates the place where i would like to add the custom text.I want to add it just before the product description areasourav repliedJune 3, 2024 at 2:57amSorry , I forgot to attach the image in the previous message , i have attached it hereAttached files: custom content.png 2,609PenciDesign repliedJune 3, 2024 at 5:27amHi,You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/ add_action( 'woocommerce_single_product_summary', function(){ ?> add your content at this area <?php}, 45 );Regards,PenciDesign.sourav repliedJune 3, 2024 at 6:53amI did but its not showing anything 2,609PenciDesign repliedJune 3, 2024 at 8:37amHi,Please modify this content: add_action( 'woocommerce_single_product_summary', function(){ ?> add your content at this area <?php }, 30 );Regards,PenciDesign.sourav repliedJune 3, 2024 at 8:47amHow can i add the text for a specific product or category and also include links in it 2,609PenciDesign repliedJune 3, 2024 at 11:17amHi,To modify the code as per your request, you need to have knowledge about WordPress code. Let's check this topic: https://stackoverflow.com/questions/47330471/add-custom-content-for-a-specific-product-on-woocommerce-single-product-pagesRegards,PenciDesign.sourav repliedJune 3, 2024 at 11:23amOk , but i need to move the position of the content , I want the content to appear just before the start of the the description.I have attached an image below for better understand of the content position.Attached files: custom content 2.png 2,609PenciDesign repliedJune 3, 2024 at 4:06pmHi,If you want to modify the content position, please change the number "30" to "50". add_action( 'woocommerce_single_product_summary', function(){ ?> add your content at this area <?php }, 50 ); // change position at this lineRegards,PenciDesign. Sign in to reply ...
Hi , is it possible to add some custom data some text with a link on the single product page for a specific product or category.
I have attached an image below that indicates the place where i would like to add the custom text.
I want to add it just before the product description area
Sorry , I forgot to attach the image in the previous message , i have attached it here
Attached files: custom content.png
Hi,
You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/
Regards,
PenciDesign.
I did but its not showing anything
Hi,
Please modify this content:
Regards,
PenciDesign.
How can i add the text for a specific product or category and also include links in it
Hi,
To modify the code as per your request, you need to have knowledge about WordPress code.
Let's check this topic: https://stackoverflow.com/questions/47330471/add-custom-content-for-a-specific-product-on-woocommerce-single-product-pages
Regards,
PenciDesign.
Ok , but i need to move the position of the content , I want the content to appear just before the start of the the description.
I have attached an image below for better understand of the content position.
Attached files: custom content 2.png
Hi,
If you want to modify the content position, please change the number "30" to "50".
Regards,
PenciDesign.