Previous post:

Next post:

Remove Paging From WordPress Archives

by Stephanie Booth on 24.02.2007

in Wordpress

[fr]

Pour supprimer les "pages" de vos archives WordPress, utilisez le code ci-dessous dans le fichier functions.php du thème que vous utilisez.

[en]

Thanks a lot to Matt for giving me the code which allows me to remove paging from the archives on this blog. I’ve been wanting to do that for a long time, but didn’t know where to start.

Just add the following code to the functions.php file of your theme.

function yay_nopaging($query) {
if ( !is_home() && !is_feed() && '' === $query->get('nopaging') )
    $query->set('nopaging', 1);
}

add_action('parse_query', 'yay_nopaging');

Unfortunately, this breaks the Recent Posts widget, which starts displaying… all the posts (that’s a lot of them, here). I removed the widget, but if you have a solution, I’d be happy to hear it.

Similar Posts:

{ 3 trackbacks }

Weblog Tools Collection » Blog Archive » Remove Paging from WordPress Archives
24.02.2007 at 13:09
WeblogToolsCollection DE » Blog Archive » Paging aus dem WordPress Archiv entfernen
24.02.2007 at 16:34
ThemePress » Weblog Tools Collection: Remove Paging from WordPress Archives
04.03.2007 at 7:50

{ 14 comments… read them below or add one }

1 Gerard @ Interweb World 24.02.2007 at 13:50

Hi Stephanie! You didn’t say much about your reasons for wanting to remove paging, which I’d be interested to hear. My initial reaction would be that this might end up orphaning a lot of your old posts and having them excluded from indexing.

2 Stephanie 24.02.2007 at 14:16

Gerard: I like having all the posts for one month on one page. I wasn’t really concerned about indexing. It’s also because sometimes, I’m looking for a post which I know is during a certain month, and having that month split on many pages means I can’t do a simple text search on the page to find the post.

3 patung 24.02.2007 at 15:09

Easier to use this plugin – http://mattread.com/projects/wp-plugins/custom-query-string-plugin/

Set the archives to display at -1, which means list all posts.

4 Gerard @ Interweb World 24.02.2007 at 12:50

Hi Stephanie! You didn't say much about your reasons for wanting to remove paging, which I'd be interested to hear. My initial reaction would be that this might end up orphaning a lot of your old posts and having them excluded from indexing.

5 Stephanie 24.02.2007 at 13:16

Gerard: I like having all the posts for one month on one page. I wasn't really concerned about indexing. It's also because sometimes, I'm looking for a post which I know is during a certain month, and having that month split on many pages means I can't do a simple text search on the page to find the post.

6 patung 24.02.2007 at 14:09

Easier to use this plugin – http://mattread.com/projects/wp-plugins/custom-...>

Set the archives to display at -1, which means list all posts.

7 Jon Tillman 25.02.2007 at 2:26

I have always done it by inserting

$posts_per_archive_page = -1;

in index.php just before

require(‘./wp-blog-header.php’);

8 Lorelle 25.02.2007 at 5:39

Which Related Posts?

And welcome back to the fold. We’ve been missing you! ;-)

9 Jon Tillman 25.02.2007 at 1:26

I have always done it by inserting

$posts_per_archive_page = -1;

in index.php just before

require('./wp-blog-header.php');

10 Lorelle 25.02.2007 at 4:39

Which Related Posts?

And welcome back to the fold. We've been missing you! ;-)

11 Stephanie 26.02.2007 at 0:54

The wordpress widget one.

12 Stephanie 25.02.2007 at 23:54

The wordpress widget one.

13 Danny 28.02.2007 at 0:49

I use the Smart Archive plugin which shows you the titles of all your posts. I have a lot, so it takes a couple of seconds, but it’s not unbearable. Very handy. I like it a lot.

You can see what it looks like at my site here (though for other, non-technical reasons, I have the link temporarily disabled from my site).

14 Danny 27.02.2007 at 23:49

I use the Smart Archive plugin which shows you the titles of all your posts. I have a lot, so it takes a couple of seconds, but it's not unbearable. Very handy. I like it a lot.

You can see what it looks like at my site here (though for other, non-technical reasons, I have the link temporarily disabled from my site).

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

« Back to text comment

Additional comments powered by BackType