Support

Account

Home Forums General Issues woocommerce wc_get_template_part fetching page title instead of product title Reply To: woocommerce wc_get_template_part fetching page title instead of product title

  • when you use setup_postdata() the variable name must be $post and it must be called in a way that affect the global $post.

    If you are in a template that is loaded using get_template_part() then the global $post is already set up. If not the you must set it up using

    
    global $post;
    

    And you code needs to look like

    
    $post = get_sub_field('selected_product');
    setup_postdata($post);