Advertisement
shakil97bd

Drop Down blog post viewer

Feb 21st, 2015
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.99 KB | None | 0 0
  1. ************************How to add a Drop Down blog post viewer in your website ********************************
  2.  
  3. //First paste the bellow code where you want to add drop down post view
  4.  
  5.  
  6.  
  7. <div class="drop_post_view">
  8.          
  9. <pre>
  10. <h2 id="title_drop">Use Our Quick Viewer</h2>
  11. <form action="<? bloginfo('url'); ?>" method="get">
  12.  
  13. <select name="page_id" id="page_id">
  14.  
  15. <?php
  16.  
  17. global $post;
  18.  
  19. $args = array( 'numberposts' => -1);
  20.  
  21. $posts = get_posts($args);
  22.  
  23. foreach( $posts as $post ) : setup_postdata($post); ?>
  24.  
  25.     <option value="<? echo $post->ID; ?>"><?php the_title(); ?></option>
  26.  
  27. <?php endforeach; ?>
  28.  
  29. <input type="submit" name="submit" value="view" id="Drop_view_action" />
  30. </select>
  31. </form></pre>
  32. </div>
  33.  
  34.  
  35.  
  36. //Than using with css you can design this drop down box as you want.
  37.  
  38. Tutorial Details Here : http://www.techtunes.com.bd/wordpress/tune-id/335135
  39.  
  40.  
  41. ****************************************************** THANK YOU *************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement