How would I target a specific Woocommerce template file in my Child Theme?

[ad_1]

Hello Everyone,

I am currently trying to write a if-statement based on my current template. In QueryMonitor it shows that my current template is the Woocommerce plugin’s ‘templates/single-product’. The issue is when I call get_page_template() in my child themes functions.php it returns ‘page.php’ as my current page template.

My end goal is to write the following conditional for my product page.

`if ( single-product ) { // enqueue scripts }

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer