2
Contributors
1
Reply
8
Views
2 Years
Discussion Span
Last Post by lps
0

Normally, when we deal with wordpress, we don't navigate to the folders ourselves. If you wish for a slider, maybe you should consider the custom post type named 'sliders' by adding these code into functions.php

<?php
    //add "slider" custom post
    add_action( 'init', 'create_slider_post_types' );
    function create_slider_post_types() {
       register_post_type( 'slider',
           array(
               'labels' => array(
               'name' => __( 'slider' ),
               'singular_name' => __( 'slider' ),
               'add_new' => __( 'Add New' ),
               'add_new_item' => __( 'Add new slider' ),
               'edit' => __( 'Edit' ),
               'edit_item' => __( 'Edit slider' ),
               'new_item' => __( 'New slider' ),
               'view' => __( 'View slider' ),
               'view_item' => __( 'View slider' ),
               'search_items' => __( 'Search slider' ),
               'not_found' => __( 'No slider found' ),
               'not_found_in_trash' => __( 'No slider found in Trash' )
               ),
               'public' => true,
               'show_ui' => true,
               'publicly_queryable' => true,
               'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
               'rewrite' => array("slug" => "slider"),
               'taxonomies' => array('post_tag')
           )
       );
    }
?>

Thus, add the slide images as the thumbnail of the posts in you 'slider'.
Then, when we wish to retrieve the data, just use the

<?php
    query_posts("what_to_show=posts&post_type=testimonial&post_status=publish&order=DESC");
    while(have_posts()):the_post()
?>
<li><?php the_post_thumbnail(); ?></li>

to loop for the posted thumbnails. For the images size customization, you can refer https://codex.wordpress.org/Post_Thumbnails.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.