Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
- <?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();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement