• <?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?

The topic ‘How can i add pagination ?’ is closed to new replies.