WordPress.org

Forums

Slider not working with query_posts on Home Page (5 posts)

  1. goddesskarla
    Member
    Posted 2 years ago #

    Slider not working with the addition below..

    Testing server: http://zoomdesign.com/paraklete/

    addition to home page:

    <br class="clear" />
    <table width="100%" border="0" cellpadding="75" cellspacing="0">
    <tr>
    <td width="50%">
    
    <h3>News</h3>
    
    <?php query_posts( array( 'category__and' => array(4), 'posts_per_page' => 3, 'orderby' => 'title', 'order' => 'DESC' ) ); ?>
    
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><b><?php the_title(); ?></b></a></li>
    
    <a href="<?php the_permalink() ?>">Read More</a>
    <?php endwhile;?></td>
    <td>
    <h3>Blog</h3>
    
    <?php query_posts( array( 'category__and' => array(3), 'posts_per_page' => 3, 'orderby' => 'title', 'order' => 'DESC' ) ); ?>
    
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><b><?php the_title(); ?></b></a></li>
    
    <a href="<?php the_permalink() ?>">Read More</a>
    <?php endwhile;?></td>
    </tr>
    </table>
    
    </div>

    This code works great without the slider..

    If I change the second category to:

    <?php query_posts (query_string . 'cat=3' ); ?>

    The slider works but it pulls from all categories.. and I just need it to pull from cat 3..

    Sadly the client wants this updated by 2pm today.

    Any help would greatly be appreciated.

  2. wprock
    Member
    Posted 2 years ago #

    wp_reset_query();
    query_posts( array( 'cat' => 3, 'posts_per_page' => 3, 'orderby' => 'title', 'order' => 'DESC' ) );

  3. goddesskarla
    Member
    Posted 2 years ago #

    Thank you for the updated code .. It works great without the slider..

    however, when I enable the slider even with the updated code.. It still isn't working properly.

    Any other insights would be very much appreciated. Karla

    http://zoomdesign.com/paraklete/

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

    generally, better use WP_Query() for secondary loops, and end each loop with wp_rest_postdata().
    from your posted code, it is not clear how this interacts with the slideshow, and what the intended output is.

    for details, you will need to contact elegantthemes for support;

    this forum does not support commercial themes.

  5. goddesskarla
    Member
    Posted 2 years ago #

    I have contacted them.. and without much support so far. ~fingers crossed~

    As my deadline is quickly approaching I was really hoping for any insight from anyone that might have experienced a problem like this..

    Thank you for your input.

Topic Closed

This topic has been closed to new replies.

About this Topic