Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For some reason the page nav doesn't work correctly. It's styled odd on the home page, then if you go to a page you'll see it really looks odd.

I can't figure out what's happening. If anyone has any ideas I'd appreciate it. Thanks.

Here is the code from my pagination.php

<?php if( is_single() ) { ?>

    <div id="single-post-nav" class="row">

        <?php $pagination_width = 'full_width_layout' == $options['layout'] ? 'span6' : 'span4'; ?>

        <?php previous_post_link( '<span class="' . $pagination_width . ' previous-page">%link</span>', _x( '&larr; %title', 'standard' ) ); ?>

        <?php if( '' == get_previous_post() ) { ?>
            <?php next_post_link( '<span class="' . ( $options['layout'] == 'full_width_layout' ? 'span12' : 'span8' ) . ' no-previous-page-link next-page">%link</span>', _x( '%title &rarr;', 'standard' ) ); ?>
        <?php } else { ?>
            <?php next_post_link( '<span class="' . $pagination_width . ' next-page">%link</span>', _x( '%title &rarr;', 'standard' ) ); ?> 
        <?php } // end if/else ?>

    </div><!-- /#single-post-nav -->

<?php } elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) { ?>

    <div id="post-nav">
        <ul class="pager">

            <?php if( get_next_posts_link() ) { ?>
                <li class="previous">
                    <?php wp_pagenavi(); ?>     
            <?php } // end if ?>

            <?php if( get_previous_posts_link() ) { ?>
                <li class="next">
                    <?php wp_pagenavi(); ?>
            <?php } // end if ?>

        </ul><!-- /.pager -->
    </div><!-- /#post-nav -->

<?php } // end if/else ?>
share|improve this question

closed as off-topic by gmazzap, kaiser Nov 17 '14 at 16:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 0 down vote accepted

You don't have a code issue, just CSS. In your default.css, just at the end, add this:

#menu-under-header .navbar-inner ul{clear:both !important; width:1000px;}
.menu-header-container{clear:both !important;}
#social-networking{clear:both !important;}

and that's it. You may want to add a position for social networking. IN that case, replace the last line with this:

#social-networking{clear:both !important; position:relative; left:760px;}


first of all, it seems like you're calling you pagenavi twice. And yes, you still have CSS issues, see below to correct:

.wp-pagenavi span.pages{clear:both !important; text-align:left !important; margin:5px !important;}
.wp-pagenavi a.larger, .smaller, .previous, .last, .nextpostslink, .previouspostslink{width:auto !important; padding:20px !important;margin-top:15px;}

so, just check your page template for that additional call to page navi, add the CSS fix and lmk if it works out

share|improve this answer
Thanks for your help. But this is with the top nav. I'm talking about the page nav (at the bottom.) – Rick Smith Jun 21 '12 at 22:02
I included the page template in my code above and I can't see the additional call to page navi. Am I missing something? (I replaced the previous and next with the page nai) Should that only be there once? Also the css you left above is different than the first css. Do I insert both? (thanks for your help by the way.) (Nevermind I see one of those is for the page nav and the other is for the menu) – Rick Smith Jun 21 '12 at 22:24
the thing is that the code you added isn't related to what you're looking for, so really don't know what to tell you without seeing it. Could you paste your index.php code? You can use if needed . My bet is you'll have a conditional for home page and a faulty code for the remaining pages – Devin Jun 21 '12 at 22:31
thanks for your help. It looks like the wp_pagenavi is in there twice. (it replaced the next and previous post link.) I'm assuming I need to take one of those out, right? Here's the pastbin to the index.php. – Rick Smith Jun 21 '12 at 22:35
by the way, here is what the pagenation.php looked like before i replaced it with the call to wp_pagenavi – Rick Smith Jun 21 '12 at 22:36

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