Support » Fixing WordPress » JS slider function not selecting featured category

  • Resolved Amy55


    Hello, Experts,
    I’m using a modification of Akylas theme (based, I think on Tauri), which has a built in js slider (not a plugin, unfortunately). The slider itself works great, but it doesn’t select the content based on category. The code is this:

    <!-- BEGIN featured -->
    <div id="featured">
    	<div class="container">
    		$tmp_query = $wp_query;
    	query_posts('showposts=4&cat=' . get_cat_ID(dp_settings('featured')));
    		if (have_posts()) :
    		while (have_posts()) : the_post();
    		<div class="item">
    			<a class="thumb" href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'medium', 'alt="' . $post->post_title . '"'); ?></a>
    			<p class="date"><?php the_time('F j, Y') ?></p>
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    			<?php the_excerpt(); ?>
    		$wp_query = $tmp_query;
    	<a href="#" class="previous">Previous</a>
    	<a href="#" class="next">Next</a>
    <!-- END featured -->

    It seems that if I select the “featured” category for each of the posts I want to feature, they should show up in the slider. However, I only get the most recent X posts (4 in this case).

    Short of routinely changing the dates of the posts I want to feature (as, essentially, static content for the sliders), I don’t know how to get the slider to either a) select the category properly, or b) simply insert some code (don’t know what) that would hard code the pages I wanted to feature into the slider.

    Does anyone have any advice?

    The site, is live but the theme I’m changing to isn’t live yet.

    Many thanks,

Viewing 1 replies (of 1 total)
  • I figured it out. The settings.php called “featured1” not “featured” as the name of the field. So I changed that in the code above


    query_posts('showposts=4&cat=' . get_cat_ID(dp_settings('featured')));
    query_posts('showposts=4&cat=' . get_cat_ID(dp_settings('featured1')));

    Now I can sort by category. Very frustrating, but fixed now.

Viewing 1 replies (of 1 total)
  • The topic ‘JS slider function not selecting featured category’ is closed to new replies.