WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
[resolved] MultiPart Pages - Magazeen Theme Has No Navigation (15 posts)

  1. Jennifer
    Member
    Posted 2 years ago #

    hi all, i am using the magazeen theme, which has no navigation on it's home/blog page, so i am not sure where to put the navigation code. magazeen is a multipart home page theme and i am unsure how/where to proceed on getting it hooked up with wp-pagenavi, since there was no navigation to replace.

    the theme's query is:

    <?php
    	query_posts( 'showposts=3' );
    	if (have_posts()) :
    		while (have_posts()) : the_post(); $category = get_the_category();
    ?>

    and then there is a second part:

    <?php
    	query_posts( 'showposts=2&offset=3' );
    	if (have_posts()) : $counter = 0;
    		while (have_posts()) : the_post(); $category = get_the_category();
    
    		if( $counter % 2 == 0 )
    			$end = "";
    		else
    			$end = "last";
    ?>

    i am following the instructions here, but i'm still not sure where the multipart page fix code should go, since i didn't have a navigation to begin with. for example, does it go inside the while loop? if so, which one?

    some of the code fixes were a little confusing to me because they seem to deal with category or tag pages; however, my multipart home page is not filtered by a category or tag.

    my wp-pagenavi is version 2.80. thank you!

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

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    A "multipart page" is a page that has one or more "<!--nextpage-->" comments in it's content.

    Your home page is not a "multipart page". It just displays multiple distinct posts.

    Try adding these lines after the last endwhile;:

    wp_reset_query();
    
    	wp_pagenavi();
  3. Jennifer
    Member
    Posted 2 years ago #

    thanks so much for your reply. that makes sense.

    the code you gave almost worked. i do have 2 pages showing up now, but the content repeats on the second page, vs. showing the one/oldest post on page 2.

    it's a new blog, so i just realized my theme had no navigation lol.

    http://www.fabfatale.com/

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    That is going to be trickier to fix. You're basically going to need two template files:

    front-page.php (with your current code)

    home.php (with code to handle all pages except the front page)

    I would contact the theme author.

  5. Jennifer
    Member
    Posted 2 years ago #

    i'll try, but it was a free smashing magazine download that doesn't offer much, if any support. it was the magazeen theme, but i redesigned the HTML and CSS. thanks for your help though.

  6. Jennifer
    Member
    Posted 2 years ago #

    I'm still at a loss for getting this to work :( The theme author is not responding, but basically it may be looked at as a theme from scratch, as it had no navigation.

    I'm not sure why pagenavi isn't working for me (content from page 1 repeating on page 2) if my home page is not a multipart page and I have used the reset query function before my pagenavi.

    http://www.fabfatale.com/

    Thanks again!

  7. scribu
    Member
    Plugin Author

    Posted 2 years ago #

  8. Jennifer
    Member
    Posted 2 years ago #

    hey scribu, i appreciate all of your help so much! thank you for taking the time.

    ive actually already seen that article. that's where i started my research (linked to it in this thread above); however, i was confused as that tutorial deals with category, and i am not filtering by a category. this is just my home page that shows all posts/categories.

    so far i have

    wp_reset_query();
    wp_pagenavi();

    and i do have 2 pages; however the content is repeating on both pages.

    thanks again for your time!

  9. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    It's not the category aspect which is important, but the 'paged' => get_query_var( 'paged' ) part.

  10. Jennifer
    Member
    Posted 2 years ago #

    sorry, my confusion is on how to combine the query i have (there are two):

    query_posts( 'showposts=2&offset=2' );

    query_posts( 'showposts=3' );

    with the query in the example:

    query_posts( array( 'cat' => 8, 'paged' => get_query_var('page') ) );

    my attempt below caused an error:

    query_posts( 'showposts=2&offset=2', array( 'paged' => get_query_var('page') );

    also, do i add pagination to both queries?

    thank you again and again!

  11. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    query_posts( array(
      'showposts' => 2,
      'offset' => 2,
      'paged' => get_query_var('page'),
    ) );

    I will ignore any further questions. Sorry.

  12. Jennifer
    Member
    Posted 2 years ago #

    that didn't work, but thank you so much for your help. if i have any further questions, please don't feel like you have to respond. i use your pagenavi at my other blog and love it :) i appreciate your time and thanks anyways.

  13. Jennifer
    Member
    Posted 2 years ago #

    still posting in case someone (anyone) is able to help, or maybe someone else is having the same trouble?

    i tried creating a custom page template (a page of posts) and no luck with the navigation. i also created a front-page.php (copied code from index.php into front-page.php, with a few changes to make sure i was indeed viewing front-page.php), and still no luck.

    the code above should have said get_query_var('paged') instead of get_query_var('page'). now "all" of my posts are not repeating on the second page, just the last two posts due to my offset. here is my code, without the html:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    i also have "Reading" set to show 4 blog posts for now to test everything. the code above also shows 4 posts, 2 per section. i have 5 posts total, so i am hoping to see the 1 extra post only on the next page, vs. the last two posts repeating on page 2.

    thanks in advance to anyone that is able to help. i love my template, but i need navigation. i also love pagenavi, so i'm hoping i can get this resolved using this plugin.

  14. Jennifer
    Member
    Posted 2 years ago #

  15. Jennifer
    Member
    Posted 2 years ago #

    solved - please see post marked "Updated Version" in this thread:

    http://wordpress.org/support/topic/query_posts-offset-and-pagination?replies=12

    my results - http://www.fabfatale.com

    now i can finally get back to blogging. it's been since monday and i just launched this site! excited to get it worked out and move on! i hope this helps someone else.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic