Custom download page

Finally I solve the problem. Here the code bellow for download button. Put this code into your post loop it will show a download button.

     <form action="<?php echo esc_url( home_url( '/your_redirected_page_slug' ) ); ?>" method="GET" id="form1">
    <?php  global $post;
         //$post_slug=$post->post_name;

    ?>
    <input id="myButton" type="submit" name="a" value="Download" class="single-download-button" />
     <input type="hidden" name="appk" id="mkval" value="<?php echo get_the_ID(); ?>" />                                                  
 </form>

When someone click on that button it will redirect to download page. Then put the code bellow to that page:

<?php
$id = $_GET['appk']; // get form data 
$popularpost = new WP_Query( array('post_type' => 'your_cusom_post_name',
     'posts_per_page' => 9, 
     // 'meta_key' => 'wpb_post_views_count', 
     //'orderby' => 'meta_value_num',                               
     'order' => 'DESC',
     'p' => $id, 
      ) );


    while ( $popularpost->have_posts() ) : $popularpost->the_post();
    $id = get_the_ID();

    ?>


    <!-- Your Code Function here -->

<?php
    endwhile;
    // Reset Post Data
        wp_reset_postdata();
    ?> 

Thats it…… enjoy