0

This blog page is pulling from a Page Template called full-width-blog.php. The left of the content is where the supposed general posts should appear. On the right is the sidebar.

How could you make the main left area pulling from Recent Articles and not from Testimonials?

See image for an example: https://i.sstatic.net/83SyI.png

full-width-blog: http://pastebin.com/R6BD1R8u

7
  • sidebar.php: pastebin.com/YDGuR8GH Commented Aug 20, 2012 at 17:45
  • Is this a simple thing to do? Do I need to add other php files to pastebin? Commented Aug 20, 2012 at 18:21
  • should be simple and your code is fine except you are using query_posts over and over on the same page(sidebar) use either get_posts or wp_query instead and reset the Query after each one using wp_reset_query
    – Bainternet
    Commented Aug 20, 2012 at 18:23
  • @Bainternet - I don't know how to do that. Commented Aug 20, 2012 at 18:27
  • here you go codex.wordpress.org/Class_Reference/WP_Query
    – Bainternet
    Commented Aug 20, 2012 at 18:29

1 Answer 1

0

This is an attempt to fix your sidebar code :

<div id="rightcolumn-wrapper">
  <div class="rightcolumn-inner">

    <?php   /* Widgetized sidebar */

        if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar') ) : ?>


     <?php /* If a title has been provided, we'll use that. */
             $NewsTitle=get_option('NewsTitle');
            if ($NewsTitle) { 
            echo ' <h3 class="news">';            
             echo $NewsTitle;
            echo '</h3>';
            // Otherwise we'll use a generic message.
            } else { ?>
      <h3>Recent News</h3>
      <?php } ?>

    <?php 
                $News=get_option("News");
                $news_Query =  new WP_Query(array(
                  'cat' => $News,
                  'posts_per_page' => get_option("newspostlimit"),
                  'post_type' => 'post'
                )); 
    ?><ul class="news">
    <?php while ($news_Query->have_posts()) : $news_Query->the_post(); ?>
      <li> 
        <strong><?php the_time('F jS, Y') ?> : </strong>
        <br />
        <?php the_title(); ?> :
        <a href="<?php the_permalink() ?>"> 
        <?php the_content_rss('cut', TRUE, '', 20); ?>
        </a>
        <a href="<?php the_permalink() ?>" class="view-more">&nbsp;</a>
      </li>      
    <?php endwhile;
    wp_reset_query(); ?>
    </ul>

    <?php /* If a title has been provided, we'll use that. */
    $TestimonialTitle=get_option('TestimonialTitle');
    if ($TestimonialTitle) { 
      echo ' <h3 class="news">';            
      echo $TestimonialTitle;
      echo '</h3>';
    // Otherwise we'll use a generic message.
    } else { ?>
      <h3>Testimonial</h3>
    <?php 
    }
    $Testimonial=get_option("Testimonial");
    $testi_Query = new WP_Query(array('cat'=> $Testimonial, 'posts_ter_page' =>  get_option("Testimonialpostlimit"))); 
    ?>
    <ul class="testimonial">
    <?php while ($testi_Query->have_posts()) : $testi_Query->the_post(); ?>
      <li> 
        <?php the_content_rss('cut', TRUE, '', 20); ?>
        <br />
        <strong>
          <?php the_title(); ?>
        </strong>
        <a href="<?php the_permalink() ?>" class="view-more">&nbsp;</a>
      </li>
    <?php endwhile;
    wp_reset_query(); ?>
    </ul>


    <ul>
      <li>
        <?php /* If a title has been provided, we'll use that. */
          $ContactInfoTitle=get_option('ContactInfoTitle');
          if ($ContactInfoTitle) { 
            echo ' <h3 class="contact-info">'.$ContactInfoTitle.'</h3>';
             // Otherwise we'll use a generic message.
          } else { ?>
            <h3 class="contact-info">Contact Info</h3>
          <?php 
          }
          $ContactInfo=get_option('ContactInfo');
          if ($ContactInfo) { 
            echo stripslashes($ContactInfo);           
            // Otherwise we'll use a generic message.
          } else { ?>
            <p>Mauris a libero metus, vel blandit lectus. Praesent egestas ultrices turpis eget vestibulum. Pellentesque ligula sem, porta nec venenatis vel, volutpat non tortor. </p>
          <?php } ?>
    </li>
  </ul>



    <ul>
    <li>
      <?php /* If a title has been provided, we'll use that. */
             $SocialTitle=get_option('SocialTitle');
            if ($SocialTitle) { 
              echo ' <h3 class="news">'.$SocialTitle.'</h3>';
            // Otherwise we'll use a generic message.
            } ?>
      <div class="socil-book-marks">
      <?php 
      $TwitterID=get_option('TwitterID');
     $FacebookID=get_option('FacebookID');
      $FlickrID=get_option('FlickrID');
     $DeliciousID=get_option('DeliciousID');
     $TechnoratiID=get_option('TechnoratiID');


      if($TwitterID) { ?>
      <a href="<?php echo get_option('TwitterID'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/twitter.png" alt="twitter" /></a> 
      <?php }       
    if($FacebookID) { ?>
      <a href="<?php echo get_option('FacebookID'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/facebook.png" alt="myspace" /></a>
         <?php }       
    if($FlickrID) { ?>
       <a href="<?php echo get_option('FlickrID'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/flicker.png" alt="flickr" /></a>
           <?php }       
    if($DeliciousID) { ?>
        <a href="<?php echo get_option('DeliciousID'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/delicious.png" alt="delicious" /></a> 
           <?php }       
    if($TechnoratiID) { ?>
        <a href="<?php echo get_option('TechnoratiID'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/technorati.png" alt="technorati" /></a>
        <?php } ?>
         </div>
    </li>
    </ul>
    <?php endif; ?>
  </div>
</div>

<!-- End Main section #main  -->
<div class="clear"></div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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