• Resolved NickNack27

    (@nicknack27)


    Below is my code for my sidebar. I have two issues then it will work perfectly the way I am wanting it to. This set of Code is WooCommerces code found here: https://github.com/woothemes/woocommerce/blob/master/templates/single-product/up-sells.php
    I reworked it to well work in my site, the only kicker is for some reason at the bottom of my page another box pops up with the same information. Check this page out to see what I’m talking about: http://www.poulosenergy.com/product/wind-energy-work-truck/
    I dont know how to get rid of the bottom section and just leave the section in my sidebar. Your thoughts? Also, the second issue that I’m trying to solve is this: <div class=”right_sidebar”; background-color: “#FFFFFF”>
    I’m trying to put a solid white background behind my sidebar.

    <!– sidebar starts –>
    <div class=”right_sidebar”; background-color: “#FFFFFF”>
    <?php
    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }
    global $product, $woocommerce_loop;
    $upsells = $product->get_upsells();
    if ( sizeof( $upsells ) == 0 ) {
    return;
    }

    $meta_query = WC()->query->get_meta_query();
    $args = array(
    ‘post_type’ => ‘product’,
    ‘ignore_sticky_posts’ => 1,
    ‘no_found_rows’ => 1,
    ‘posts_per_page’ => $posts_per_page,
    ‘orderby’ => $orderby,
    ‘post__in’ => $upsells,
    ‘post__not_in’ => array( $product->id ),
    ‘meta_query’ => $meta_query
    );
    $products = new WP_Query( $args );
    $woocommerce_loop[‘columns’] = $columns;

    if ( $products->have_posts() ) : ?>

    <div class=”upsells products”>

    <h2><?php _e( ‘You may also like…’, ‘woocommerce’ ) ?></h2>

    <?php woocommerce_product_loop_start(); ?>

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

    <?php wc_get_template_part( ‘content’, ‘product’ ); ?>

    <?php endwhile; // end of the loop. ?>

    <?php woocommerce_product_loop_end(); ?>
    </div>

    <?php endif;
    wp_reset_postdata();
    ?></div>

Viewing 1 replies (of 1 total)
  • weblizar

    (@weblizar)

    Hello,

    Do you want to remove SIDEBAR or You want to REMOVE FOOTER of that Page ?

    Make it Clear..

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Need help with the sidebar’ is closed to new replies.