• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to show single Woocommerce Product on Homepage?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to show single Woocommerce Product on Homepage?

This topic is: not a support question

Tagged: templates, WooCommerce

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 2 months ago by kelmom.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 3, 2013 at 10:04 am #76800
    kelmom
    Member

    Hello! I am currently learning PHP & how to customize WordPress from the server side aspect of things. I'm currently using a sample Genesis child theme.

    I have a shop that I set up on WordPress using the Woocommerce plugin. The shop holds only a single item. Since I only have 1 item to sell, I would like to show the product on my homepage in such a fashion where the complete product page is shown on the homepage.

    Here is some code i've been trying to get to work (this is placed in the home.php file):

    '$prodpage = array(
    'post_type' => 'product',
    'posts_per_page' => 1,
    ‘taxonomy’ => ‘banner’,
    ‘term’ => ‘banner’
    );
    $featured_query = new WP_Query( $prodpage );

    if ($featured_query->have_posts()) :

    while ($featured_query->have_posts()) :

    $featured_query->the_post();

    $product = get_product( $featured_query->product->ID );

    // Product Info Output Here

    endwhile;

    endif;

    wp_reset_query(); // Query Reset

    I have also tried using query_posts in this manner:

    if ( is_home() ) {
    query_posts( 'p=31' );
    }'

    The good news is that I don't get flagged for any syntax errors. The bad news is that I am afraid my logic is off somewhere as I get a page with only the WP header and footer. The mid section where the product should show up is not showing up. I'm wondering if there is any Genesis-specific thing that I need to do in order to make this work?

    I really appreciate any guidance you guys are able to give! 🙂


    ~Kellie~

    http://diocesan.com/bannerstore
    December 12, 2013 at 5:57 am #78533
    bluesteelesolutions
    Member

    I may be over simplifying this, but could you not just use the shortcode? [product id="99"]


    Offering full service marketing solutions; print, marketing strategy, CRM, and (duh!) Genesis web design/development.
    Blue Steele Solutions

    December 12, 2013 at 8:21 am #78546
    kelmom
    Member

    [product id="99"] (where 99 is the product id number) only pulled up the thumbnail and add-to-cart button. I needed the full product page.

    So, I discovered there were two ways to go about this (both really easy).

    1st -- plugin shortcode [product_page id="99"] -- this will give the FULL product page.

    OR

    in your home.php file insert this manual shortcode:

    <?php echo do_shortcode('[product_page id="31"]'); ?>

    You would be surprised how long it took me to get what was in reality a super simple answer! I think I was over-complicating things... because I couldn't find what I needed within the first few Google searches.


    ~Kellie~

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble