WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
How to implement in Twenty Twelve? (4 posts)

  1. Chris Andersen
    Member
    Posted 1 year ago #

    Plz post how to implement it in WordPress' theme Twenty Twelve.
    Thx :-)

    http://wordpress.org/extend/plugins/wp-paginate/

  2. chuxstir
    Member
    Posted 1 year ago #

    I would like to know how to this to. I tried to put the line of code in my template file, and it crashed the site until I took the line of code back out. I don't see any settings panel in the dashboard or anything, so I don't know how to do it either.

  3. Antena
    Member
    Posted 1 year ago #

    I have the same question. Try everything, but without result.

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the plugin gives an example for Twenty Eleven - the coding and procedure is actually very similar for Twenty Twelve; http://wordpress.org/extend/plugins/wp-paginate/installation/

    if this is not enough info:

    the code for the 'next/prev posts nav' is in functions.php of Twenty Twelve;

    function twentytwelve_content_nav( $html_id ) {
    etc.....

    start by creating a child theme of Twenty Twelve; http://codex.wordpress.org/Child_Themes

    then add a functions.php file into the child theme;

    get a copy of the function twentytwelve_content_nav( $html_id ), paste it into functions.php (make sure if the file is new, to have <?php in the first line), and edit it to include the code for the plugin;

    different example:

    function twentytwelve_content_nav( $html_id ) {
    	global $wp_query;
    
    	$html_id = esc_attr( $html_id );
    
    	if ( $wp_query->max_num_pages > 1 ) : ?>
    		<nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
    			<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
    <?php if ( function_exists( 'wp_paginate' ) ) {
       wp_paginate();
    } else { ?>
    
    			<div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
    			<div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
    
    <?php } ?>
    		</nav><!-- #<?php echo $html_id; ?> .navigation -->
    	<?php endif;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.