Use an image as thumbnail instead of slider(wordpress)

Hi I am making an wordpress website where I am going to upload amount of pictures.
Problem is if I upload more than 1 image on the same post or page, wordpress makes a slideshow automatically ‘and makes a slider thumbnail also’.
I don’t want any slidershows on the post or page and thumbnail also shouldn’t slide.

this is my slider code:

function rowling_flexslider($size) {

if ( is_page()) :
    $attachment_parent = $post->ID;
else : 
    $attachment_parent = get_the_ID();

if($images = get_posts(array(
    'post_parent'    => $attachment_parent,
    'post_type'      => 'attachment',
    'numberposts'    => -1, // show all
    'post_status'    => null,
    'post_mime_type' => 'image',
            'orderby'        => 'menu_order',
            'order'           => 'ASC',
))) { ?>

    <?php if ( !is_single() ) : // Make it a link if it's an archive ?>

        <a class="flexslider" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">

    <?php else : // ...and just a div if it's a single post ?>

        <div class="flexslider">

    <?php endif; ?>

        <ul class="slides">

            <?php foreach($images as $image) { 
                $attimg = wp_get_attachment_image($image->ID,$size); ?>

                    <?php echo $attimg; ?>
                    <?php if ( !empty($image->post_excerpt) && is_single()) : ?>

                        <p class="post-image-caption"><span class="fa fw fa-camera"></span><?php echo $image->post_excerpt; ?></p>

                    <?php endif; ?>

            <?php }; ?>


        if ( !is_single() )
            echo '</a>';
            echo '</div>';


How should I do? I tried to delete php codes but it wasn’t a good way.

Read more here: Use an image as thumbnail instead of slider(wordpress)

Leave a Reply

Your email address will not be published. Required fields are marked *