Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been searching all around the web for the API of the wp_pagenavi plugin, but seems that I can't find one.

I just want to know: In examples that I found, the wp_pagenavi function has from 0 to 3 parameters. What are those parameters and what do they change?

Also, what I've been meaning to do is, with WPML, translate my Page 1 of 5 in french (Page 1 de 5). Will these parameters help me translate that sentence, or is there another parameter/option to find to translate that.

By the way, with WPML I can call different functions for different languages, so if it needs a parameter to change the language of the "Page 1 to 5" sentence, I'll be ok.

share|improve this question
    
Close-voted as not a real question, because you're asking two different questions here. But this also possibly borders on off topic, as the questions are entirely Plugin-specific. –  Chip Bennett Feb 23 '12 at 17:09

1 Answer 1

up vote 1 down vote accepted

Why do you dont use the default functions from WP. As example the follow class, there you can use.

class fb_pagination_example {

    public function content_nav( $nav_id, $pag_bar = TRUE ) {

        if ( $GLOBALS['wp_query'] -> max_num_pages > 1 ) : ?>
            <nav id="<?php echo $nav_id; ?>">
                <h1 class="assistive-text"><?php _e( 'Post navigation', WP_BASIS_TXTD ); ?></h1>
                <?php 
                if ( $pag_bar ) {
                    self :: get_paginate_bar();
                } else { ?>
                    <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', WP_BASIS_TXTD ) ); ?></div>
                    <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', WP_BASIS_TXTD ) ); ?></div>
                <?php } ?>
            </nav>
        <?php endif;
    }

    public function get_paginate_bar( $args = FALSE ) {
        global $wp_rewrite, $wp_query;

        $wp_query -> query_vars['paged'] > 1 ? $current = $wp_query -> query_vars['paged'] : $current = 1;
        if ( empty($rules) ) {
            $rulestouse = @add_query_arg( 'paged','%#%' );
        } else {
            $rulestouse = @add_query_arg( 'page','%#%' );
        }

        if ( ! $args ) {
            $args = array(
                'base'         => $rulestouse,
                'format'       => '',
                'total'        => $wp_query -> max_num_pages,
                'current'      => $current,
                'show_all'     => TRUE,
                'prev_next'    => TRUE,
                'prev_text'    => __( '« Previous', WP_BASIS_TXTD ),
                'next_text'    => __( 'Next »', WP_BASIS_TXTD ),
                'end_size'     => 1,
                'mid_size'     => 2,
                'type'         => 'plain',
                'add_args'     => false, // array of query args to add
                'add_fragment' => '',
                'show_total'   => TRUE,
                'display'      => TRUE
            );
        }

        if ( $wp_rewrite -> using_permalinks() ) {
            $args['base'] = user_trailingslashit( 
                trailingslashit( remove_query_arg( 's', get_pagenum_link(1) ) ) . 'page/%#%/', 'paged' );
        }
        if ( ! empty( $wp_query -> query_vars['s'] ) ) {
            $args['add_args'] = array( 's' => get_query_var('s') );
        }

        $pagination = paginate_links( $args );

        if ( $args['show_total'] )
            $pagination .= __( ' (', WP_BASIS_TXTD ) . $wp_query -> max_num_pages . __( ')', WP_BASIS_TXTD );

        if ( $args['display'] )
            echo $pagination;
        else
            return $pagination;
    }

}
share|improve this answer
    
Because I'm working on an old website, And can't modify the plugins without risking loss of functionality. I know this plugin is not the best thing to have, but thats what they've got. –  Fredy31 Feb 23 '12 at 17:54
    
ah,ok - i understand. But can you read the plugin for the params? –  bueltge Feb 24 '12 at 8:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.