Dynamically add image to a slider in wordpress

I am new to wordpress. Basically implemented a slider which works perfectly. Now Main thing is that I want the images that I used to be uploaded by admin user. I don’t have idea to achieve this. Please help me. Amy help is heartly appreciated.

Here is my code :-

<aside class="portfolio-right">
  <ul class="mybxslider">
     <li><img src="<?php bloginfo('template_url'); ?>/images/acc-thumbnail-1.jpg" /></li>
     <li><img src="<?php bloginfo('template_url'); ?>/images/acc-thumbnail-2.jpg" /></li>
     <li><img src="<?php bloginfo('template_url'); ?>/images/acc-thumbnail-3.jpg" /></li>
  </ul>
 <script>
    $('.mybxslider').bxSlider({
          adaptiveHeight: true,
          mode: 'fade'
     });
 </script>
</aside>

Related posts

Leave a Reply

1 comment

  1. Create custom post type Slider Images & add slider image as feature image in that post type..

    for display that images in slider use

    <ul class="mybxslider">
    <?php
    $args = array(  
                'post_type' => 'slider_post', //Post type
                'posts_per_page' => 10                     
                );
    $the_query = new WP_Query( $args );
    if ( $the_query->have_posts() ) {
        while ( $the_query->have_posts() ) {
        $the_query->the_post();
    
        $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    ?>
        <li><img src="<?=$url?>" width="350" height="350" /></li>
    <?php } } ?>
    </ul>