skip to Main Content

I am building my custom theme and my single.php displays woocommerce single product page with

if ( have_posts() ) {
    while( have_posts() ) {
          the_post();
          the_content();
    }
} 

enter image description here

Why is the page missing – title, reviews & breadcrumbs?

3

Answers


  1. Chosen as BEST ANSWER

    I was missing

    add_theme_support('woocommerce');
    

    in my functions.php file


  2. Woocommerce has its own templates for their pages. A single product should be showing on single-product.php. You would create a woocommerce folder inside your custom theme and copy the directories and files you want to edit over to your theme.

    How to override single-product.php

    If you want to custimize the single-product.php, you would create a woocommerce folder in your theme and copy the single-product.php over into it. So the directory would be yourtheme/woocommerce/templates/single-product.php. This way you have all the actions hooking in the functionality you are missing.

    Here are the docs:
    https://woocommerce.com/document/template-structure/

    Login or Signup to reply.
  3.  function mytheme_add_woocommerce_support() {
            add_theme_support( 'woocommerce' );
        add_theme_support( 'wc-product-gallery-zoom' );
        add_theme_support( 'wc-product-gallery-lightbox' );
        add_theme_support( 'wc-product-gallery-slider' );
        }
        
        add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
    

    Please add this one in the functions.php file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search