• I wonder if is possible to put a slider with pages, instead of posts. I read the WP Query but i found nothing. Thanks

    $sl_args = array(
                'posts_per_page' => $sl_num,
                'category_name' => esc_attr(of_get_option('sl_category')),
                'ignore_sticky_posts' => 1
            );
            $slider_query = new WP_Query( $sl_args );
            $checkthumb = 0;
            while ( $slider_query->have_posts() ) : $slider_query->the_post();
                if(has_post_thumbnail( $post->ID )){
                    $checkthumb = 1;
                }
            endwhile;
            if( $slider_query && ( 1 == $checkthumb ) ){

Viewing 1 replies (of 1 total)
  • Just a guess, but I think all you need to do is add ‘post_type’ to the query args:

    $sl_args = array(
                'post_type' => 'page',
                'posts_per_page' => $sl_num,
                'category_name' => esc_attr(of_get_option('sl_category')),
                'ignore_sticky_posts' => 1
            );
Viewing 1 replies (of 1 total)
  • The topic ‘Put a page in slider’ is closed to new replies.