How to solve duplicate posts in a LOOP? (2 posts)

  1. bonzaiya
    Posted 2 years ago #


    I have a problem when I use a custom to print a LOOP.

    I notice it was displayed duplicate in a right sidebar following an attach link.


    How can I solve it to display as a main post in left side with no duplicate?

    Besides, can I limit post in a right sidebar. I notice it print equal main post section.


  2. bonzaiya
    Posted 2 years ago #

    My code following:

    <?php get_header(); ?><?php if ( have_posts() ) : ?>

    <div id="later">

    <div class="content" style="padding-left: 5px;">

    <h1>Online Exclusive Deals</h1>

    <div id="productbox">

    <?php /* Start the Loop */ ?><?php while ( have_posts() ) : the_post(); ?>
    <div class="productwarp-feature">

    <div class="productimage"><div align="center">" title="<?php the_title(); ?>" rel="bookmark"><img src="<?php echo catch_that_image() ?>" style="width: 80px; max-height: auto !important; height: 80px; max-width: auto !important; margin-left: -30px;"></div></div>

    <div class="productinner">" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></div>

    <p class="amazonblurb" style="text-align: center;">" rel="nofollow" title="Go to Store" class="purelycss_fusion_button color_green" style="text-decoration: none; color: white;" target="_blank">Shop Now</p>

    <?php endwhile; ?>

    <?php twentytwelve_content_nav( 'nav-below' ); ?>
    <?php else : ?>
    <?php if ( current_user_can( 'edit_posts' ) ) : // Show a different message to a logged-in user who can add posts. ?>

    <div id="later">

    <div class="content" style="padding-left: 5px;">

    <h2 style="border: none;"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h2>

    <p><?php printf( __( 'Ready to publish your first post? Get started here.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>

    <?php else : // Show the default message to everyone else. ?><h1><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>

    <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
    <?php get_search_form(); ?>

    <?php endif; // end current_user_can() check ?>
    <?php endif; // end have_posts() check ?>


    <?php require_once("spin.php"); ?>
    <div class="sidebar">

    <h3>Most Wished For</h3>

Topic Closed

This topic has been closed to new replies.

About this Topic