Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom post type namely "Slider" for a banner slideshow on the website. I run a custom loop query to get the slides from the custom post type. I have put the code on every template file (index, page, search, 404) and it works fine. The issue is only in archive.php page. The query loop does not work and consequently there is no slider in my archive page.

Here is the query loop I use.

$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$loop = new WP_Query(array(
'post_type' => 'Slider',
'cat' => 'myslider-category-id',
'posts_per_page'=>-1,
'paged' => $paged,
'order'=>'DESC'
));
while ( $loop->have_posts() ) : $loop->the_post();
// my slider images here

What is the wrong in my code to work on archive.php page? Please suggest.

share|improve this question
1  
Please add debug information to your question to make answers possible. –  toscho May 7 '13 at 3:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.