colap Posted July 1, 2015 Share Posted July 1, 2015 (edited) <?php /** * @package createtags */ /* Plugin Name: createtags Plugin URI: Description: Creating tags from title of posts Version: 1.0 Author: php-coder Author URI: */ function my_plugin_menu() { add_options_page('My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options'); } function my_plugin_options() { if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } echo '<div class="wrap">'; echo '<p>Here is where the form would go if I actually had options.</p>'; echo '</div>'; global $current_user; echo '<pre>'; global $current_user; $user_roles = $current_user->roles; $user_role = array_shift($user_roles); //var_dump($user_role); $the_query = new WP_Query("select * from wp_posts"); // The Loop if ($the_query->have_posts()) { echo '<ul>'; while ($the_query->have_posts()) { $the_query->the_post(); echo '<li>' . get_the_title() . '</li>'; } echo '</ul>'; } else { echo "no posts found"; } echo '</pre>'; } add_filter('admin_menu', 'my_plugin_menu'); How can i add pagination here? This is wordpress-4.2.2 Edited July 1, 2015 by php-coder Quote Link to comment Share on other sites More sharing options...
maxxd Posted July 1, 2015 Share Posted July 1, 2015 Did you check the Pagination section of the codex? Quote Link to comment Share on other sites More sharing options...
colap Posted July 2, 2015 Author Share Posted July 2, 2015 Did you check the Pagination section of the codex? Yes, i have checked, but could not understand what to do and how to do. Can you please post code? Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 2, 2015 Share Posted July 2, 2015 That page tells you in pretty good detail how to add pagination. We're not here to write it for you. Where are you having trouble specifically? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.