How to implement in Twenty Twelve? (4 posts)

  1. Chris Andersen
    Posted 3 years ago #

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


  2. chuxstir
    Posted 3 years 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
    Posted 3 years ago #

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

  4. Michael
    Forum Moderator
    Posted 3 years 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 ) {

    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' ) ) {
    } 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

  • WP-Paginate
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.