0

I am copying a clients site over, so I have exported and reinported the posts etc, and the theme into their new site. However, on the front page it has a pagination of the latest posts using a Widget Paginator plugin.

It looks as if they have built this theme around the core Twenty Twelve theme, so it using the following code to paginate the posts:

<?php while ( have_posts() ) : the_post(); ?>
    <?php if ( has_post_thumbnail() ) : ?>
        <div class="entry-page-image">
            <?php the_post_thumbnail(); ?>
        </div><!-- .entry-page-image -->
    <?php endif; ?>

    <?php get_template_part( 'content', 'page' ); ?>

<?php endwhile; // end of the loop. ?>

Can anyone advise why the posts wouldnt be paginating? Any advice is appreciated, as I've checked over the loop and it appears to be correct.

EDIT:

Here is the code I have

<?php
/**
 * The default template for displaying content. Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
?>
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
                        $category = get_the_category();
?>
                <?php if ( !is_category() && !is_archive() ) : ?>
                <h1 class="cog"><?php echo $category[0]->cat_name;?></h1>
                <?php endif; // is_single() ?>
                <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
                <div class="featured-post">
                        <?php _e( 'Featured post', 'Cycle Zone' ); ?>
                </div>
                <?php endif; ?>
                <header class="entry-header">
                        <?php the_post_thumbnail(); ?>
                        <?php if ( is_single() ) : ?>
                        <h1 class="entry-title"><?php the_title(); ?></h1>
                        <?php else : ?>
                        <h1 class="entry-title cog">
                                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'Cycle Zone' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
                        </h1>
                        <?php endif; // is_single() ?>
                        <span class="post-date"><?php echo get_the_date(); ?></span>
                        <?php if ( comments_open() ) : ?>
                                <div class="comments-link">
                                        <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'Cycle Zone' ) . '</span>', __( '1 Reply', 'Cycle Zone' ), __( '% Replies', 'Cycle Zone' ) ); ?>
                                </div><!-- .comments-link -->
                        <?php endif; // comments_open() ?>
                </header><!-- .entry-header -->

                <?php if ( is_search() ) : // Only display Excerpts for Search ?>
                <div class="entry-summary">
                        <?php the_excerpt(); ?>
                </div><!-- .entry-summary -->
                <?php else : ?>
                <div class="entry-content">
                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'Cycle Zone' ) ); ?>
                        <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'Cycle Zone' ), 'after' => '</div>' ) ); ?>
                </div><!-- .entry-content -->
                <?php endif; ?>
<?php
/**
 * The default template for displaying content. Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
?>
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
                        $category = get_the_category();
?>
                <?php if ( !is_category() && !is_archive() ) : ?>
                <h1 class="cog"><?php echo $category[0]->cat_name;?></h1>
                <?php endif; // is_single() ?>
                <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
                <div class="featured-post">
                        <?php _e( 'Featured post', 'twentytwelve' ); ?>
                </div>
                <?php endif; ?>
                <header class="entry-header">
                        <?php the_post_thumbnail(); ?>
                        <?php if ( is_single() ) : ?>
                        <h1 class="entry-title"><?php the_title(); ?></h1>
                        <?php else : ?>
                        <h1 class="entry-title cog">
                                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
                        </h1>
                        <?php endif; // is_single() ?>
                        <span class="post-date"><?php echo get_the_date(); ?></span>
                        <?php if ( comments_open() ) : ?>
                                <div class="comments-link">
                                        <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
                                </div><!-- .comments-link -->
                        <?php endif; // comments_open() ?>
                </header><!-- .entry-header -->

                <?php if ( is_search() ) : // Only display Excerpts for Search ?>
                <div class="entry-summary">
                        <?php the_excerpt(); ?>
                </div><!-- .entry-summary -->
                <?php else : ?>
                <div class="entry-content">
                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
                        <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
                </div><!-- .entry-content -->
                <?php endif; ?>
<?php
        /*
                <footer class="entry-meta">
                        <?php twentytwelve_entry_meta(); ?>
                        <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
                        <?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
                                <div class="author-info">
                                        <div class="author-avatar">
                                                <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
                                        </div><!-- .author-avatar -->
                                        <div class="author-description">
                                                <h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
                                                <p><?php the_author_meta( 'description' ); ?></p>
                                                <div class="author-link">
                                                        <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
                                                                <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
                                                        </a>
                                                </div><!-- .author-link -->
                                        </div><!-- .author-description -->
                                </div><!-- .author-info -->
                        <?php endif; ?>
                </footer><!-- .entry-meta -->
        */
?>
        </article><!-- #post -->

I did this paste, now what i think is, because it says twentytwelve in the content, rather than the theme name, its not pulling through. Can you clarify?

7
  • Pagination maybe built into the content.php file but you haven't pasted that code. There's none built into the loop code above. May 3, 2014 at 20:34
  • Hi Brad. If thats ok, can i find that code and post it? Thing is ive just copied this Theme over for my client, and i dont understand why it would be working. May 3, 2014 at 20:36
  • 2
    Sure, post it but take a look first to see if it includes pagination or a template tag for pagination. May 3, 2014 at 20:37
  • The widget paginator plugin appears to be doing its job, it is not broken. But since you have completely different content being displayed, and javascript errors in your themes front end, I suggest you correct those first before attempting to debug this issue.
    – Tom J Nowell
    May 3, 2014 at 21:09
  • HI Tom, Thanks for the advice. Unfortunately the problem being that this is not my theme, im copying it over for a client and its displaying correctly on their old site on a lower version of wordpress :( May 3, 2014 at 21:11

1 Answer 1

0

I am copying a clients site over, so I have exported and reinported the posts etc, and the theme into their new site.

Unfortunately the problem being that this is not my theme, im copying it over for a client and its displaying correctly on their old site on a lower version of wordpress

For some reason your jquery is broken as @TomJNowell suggested. The question here is, you said that everything is exactly the same on the old site and the new site and you have copied everything excatly to the new site.

Here are a couple of things to try here

One, flush your permalink by visiting the permalinks page and just clicking update

Secondly, it might be that you missed url paths in the db. Download and install Velvet Blues Update URL's, add

http://www.cyclezoneuk.com/

in the old URL field and

http://www.griffscyclelab.co.uk/

in the new url field, select all options and update. BUT PLEASE, make a back-up of your db first before attempting this. There is no roll back. A good idea here is to flush your permalinks again when you are done

Thirdly, have a look in the theme if they did not hard code any URL's in to some of the templates. Apart from that, everything should work on the new site. I really don't think that worpress version will have any effect here, you are only upgrading from 3.6 to 3.9, so I would see no issue here

because it says twentytwelve in the content, rather than the theme name, its not pulling through.

That would make no difference. This is only the text domain name which is actually used for localization of strings. The only effect this will have is that your translations won't work, ie, your translation for a string won't be returned. You should always have this the same as the text domain specified in style.css though. But like I said, this has got nothing to do with your actual problem here

EDIT

I've tested the widget plugin pagination plugin, and there is a bug in the plugin. Deactivate the plugin. It is also compatible up to v3.4.2. So deactivate and delete the plugin. I would also deactivate all plugins, and reactivate them one by one to check if this problem is plugin related

6
  • Hi Pieter, unfortunately the above didnt work. The only thing i could think of is that it is using a child of the twenty twelve theme :S May 4, 2014 at 10:49
  • Ive had a look and its exactly the same, the only thing i could think of is the above. Ive just recopied the file over from Twenty Twelve theme and nope, nothing :( May 4, 2014 at 10:57
  • I've tested the widget plugin pagination plugin, and there is a bug in the plugin. Deactivate the plugin. It is also compatible up to v3.4.2. So deactivate and delete the plugin May 4, 2014 at 11:40
  • 1
    Hi Pieter, thankyou so much for the advice... honestly it is very much appreciated :) May 4, 2014 at 11:43
  • @KirstyHarris where you able to resolve your issue. If you did, please post your solution as an answer. It would be great and constructive to the site to know what was causing the error. If my answer did the trick, you can always accept my answer by clicking on the checkmark next to the answer. May 5, 2014 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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