Call post from a specific category to slider.

  • Unknown's avatar

    Good day! Looking a lot in forums I found almost the solution to what I was looking for, create a slider that calls the thumbnail images of each post.

    And it works very well, but now I need it to call only the posts of a specific category and it doesn’t work.

    This is the code:

    
                <section id="slider">
                    <div class="flexslider">
                        <ul class="slides">
                            <?php query_posts(array('post_type' => 'post','orderby' => 'rand')); if(have_posts()) : while(have_posts()) : the_post();?>
                                <li class="slide">
                                <?php the_excerpt(); ?>
                                <?php the_post_thumbnail(); ?>
                                </li>
                            <?php endwhile; endif; wp_reset_query(); ?>
                        </ul>
                    </div>
                </section>
    

    I am occupying the flexslider woocommerce, take the code from this link:
    https://stackoverflow.com/questions/23180837/custom-post-type-slider.

    I hope you can help me, I am still new to php code and wordpress functions.

  • Hi there,

    We do not offer plugins on WordPress.com (unless you have purchased our Business plan) so it sounds like you are referring to a self-hosted WordPress site, which are sites that you create on a “traditional web host” like Bluehost, GoDaddy, etc.

    Please be aware that we are not able to support WordPress sites that you have with another provider, as the version of WordPress we use here on WordPress.com is different from the one that at most web hosts use. See http://support.wordpress.com/com-vs-org/ for more info.

    You can find support for your self-hosted WordPress site here: http://wordpress.org/support/

    You may also wish to contact your host’s support team for more assistance.

    Hope that points you in the right direction!

  • Unknown's avatar

    It is understood! Thanks for the help.

  • The topic ‘Call post from a specific category to slider.’ is closed to new replies.