0

I am having an issue with a theme, and I am unable to get conventional support. The theme is real estate oriented and seems to be driven by WooCommerce "Products".

enter image description here

I have them all set as "Featured" but only the products that were made via the "Dummy Data Import" seem to show up. Any "new" products will not show up in the proper area, and I am stumped. At least six "Featured" products should show up.

The ones I have starred seem to show up, the others do not...no idea

Here is a link to the site to help explain, The "Recent" and "Featured" products should look the same, as all are set to "Featured".

http://www.tjwoodruff.com/main/

Here is the code for the "Featured" products.

<?php 

/** * The Template for displaying content of product left section on homepage . * * @author Tokokoo * @package joglo * @version 1.0 * @dev Alispx */ ?>

    <h4 class="title-wrap">
        <?php _e( 'Featured Properties', 'tokokoo' ); ?>
        <?php $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); ?>
        <a href="<?php echo $shop_page_url; ?>" class="product-type"><?php _e( 'View All Properties', 'tokokoo' ); ?></a></h4>

    <?php 
        $left_args = array(
            'post_type'         => 'product',
            'post_status'       => 'publish',
            'posts_per_page'    => 6,
            'meta_key'          => '_featured',
            'meta_value'        => 'yes'
            ); 

        $featured_left = new WP_Query( $left_args ); ?>

    <?php if ( $featured_left->have_posts() ) : ?>

    <ul class="products item-wrap">

        <?php while ( $featured_left->have_posts() ) : $featured_left->the_post(); ?>

        <li class="product the-items">

            <figure class="item-img">
                <?php 
                    if ( current_theme_supports( 'get-the-image' ) ) 
                    get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'tokokoo-featured-product', 'link_to_post' => true ) ); 
                ?>
            </figure>

            <div class="item-data">
                <div class="data-top">
                    <?php woocommerce_template_loop_price(); ?>
                </div>

                <div class="data-bottom">
                    <div class="inner">

                        <?php tokokoo_display_property_meta(); ?>

                        <div class="item-title">
                            <h3 class="title-product"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                        </div>

                        <?php woocommerce_template_loop_rating(); ?>

                    </div>
                </div>

            </div>

        </li>

        <?php endwhile; ?>

    </ul>

        <?php else :  ?>

            <?php woocommerce_get_template( 'loop/no-products-found.php' ); ?>

    <?php endif; wp_reset_postdata(); ?>

</div>

Working Featured Product Working Featured Product Not Working Featured Product enter image description here Products Page enter image description here Can't Figure It Out... enter image description here

  • Based on your description, it sounds like there's a custom field on the post type that isn't being set. Can you post screenshots for the edit pages of (A) one of the featured posts that do show in the block on the page and (B) one of the posts that should but doesn't? – Anson W Han Jan 28 '18 at 5:03
  • Thank you for attempting to help, I have edited the original post with the requested images. – user3255145 Jan 30 '18 at 1:24
  • Based on the screenshots provided, I'd suggest further comparing the settings in the "Attributes" and "Advanced" sections on both posts. You could also manually inspect the wordpress database using a MySQL Graphical Interface application such as phpmyadmin or sequel pro. Based on the code, it suggests that the "_featured" meta value isn't being set. That meta property could be different from the built-in featured setting on wordpress posts and should be identifiable in one of the configuration tabs of the edit post form, if not a custom widget's settings included in the theme. – Anson W Han Jan 30 '18 at 3:31
  • I fixed it, and your suggestion helped me stumble into it. IN Dec Woocommerce changed a few things...I found a blog post that saved me. here "Note the query arguments meta_key and meta_value? They’re the cause of your problem. Those values are no longer valid. The query arguments above should now be replaced with a new tax_query argument, which would look like the following:" – user3255145 Jan 31 '18 at 0:25
0

The problem was a change in Woocommerce at the end of 2017 and this old theme. While I am answering my own post, I want to credit the creator of this blog that really helped

"I fixed it, and your suggestion helped me stumble into it. IN Dec Woocommerce changed a few things...I found a blog post that saved me.

here

"Note the query arguments meta_key and meta_value? They’re the cause of your problem. Those values are no longer valid.

The query arguments above should now be replaced with a new tax_query argument, which would look like the following:""

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.