• Resolved DaveFE

    (@davefe)


    Hi. I’m trying to use the hack here to set a custom posts per page value for a particular category:

    It works and sets a posts-per-page value of 12 for this particular category vs the usual 6. However, it sets the value of posts to show in the recent posts extended widget that’s in my left column to 12 as well. I have that set to 3 and need it that way. Any idea how I can achieve this without messing up the widget?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Ben Sibley

    (@bensibley)

    I’m actually having trouble recreating this issue. The snippet in the link you’ve shared looks good, and I was able to use it successfully when testing.

    In the “if statement,” there is a function is_main_query() that should prevent the code from affecting any “loops” besides the main post loop, and that is the behavior I saw when testing. Can you double-check the snippet in your theme and make sure is_main_query() is present?

    Thanks!

    Thread Starter DaveFE

    (@davefe)

    I’m an idiot. While the link I posted has is_main_query() in there, I ended up using a similar snippet from another page that didn’t have it. With that in, it works fine without messing with any widgets.

    Thanks again for the quick replies on here and for making a great theme!

    Dave.

    Theme Author Ben Sibley

    (@bensibley)

    No worries! I’m glad it’s working now ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing category pagination messes up recent posts widget’ is closed to new replies.