CINXE.COM
WordPress › Support » Display posts over multiple pages
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"><head profile="http://gmpg.org/xfn/11"><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://wordpress.org:80/support/topic/display-posts-over-multiple-pages","20110502163048","https://web.archive.org/","web","/_static/", "1304353848"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <!-- <meta property="fb:page_id" content="6427302910" /> --> <title>WordPress › Support » Display posts over multiple pages</title> <style type="text/css"> @import url("https://web.archive.org/web/20110502163048cs_/http://s.wordpress.org/style/wp4.css?12"); </style> <link media="only screen and (max-device-width: 480px)" href="https://web.archive.org/web/20110502163048cs_/http://s.wordpress.org/style/iphone.css" type="text/css" rel="stylesheet"/> <link rel="shortcut icon" href="https://web.archive.org/web/20110502163048im_/http://s.wordpress.org/favicon.ico?3" type="image/x-icon"/> <link rel="alternate" type="application/rss+xml" title="t" href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/rss/topic/display-posts-over-multiple-pages"/> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://web.archive.org/web/20110502163048/https://ssl." : "https://web.archive.org/web/20110502163048/http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-52447-1"); pageTracker._initData(); pageTracker._trackPageview(); </script> <!--[if lt IE 8]> <style type="text/css"> @import url("http://s.wordpress.org/style/ie.css"); </style> <![endif]--> <style type="text/css"> @import url("https://web.archive.org/web/20110502163048cs_/http://s.wordpress.org/style/forum-wp4.css?10"); </style> <!--[if IE 7]> <style type="text/css"> @import url("http://s.wordpress.org/style/forum-ie7.css?9"); </style> <![endif]--> <meta name="generator" content="bbPress 1.1-alpha-2855"/> <script type="text/javascript" src="https://web.archive.org/web/20110502163048js_/http://wordpress.org/bb-plugins/bb-quicktags.js?ver=1.1-alpha-2855"></script> <script type="text/javascript" src="https://web.archive.org/web/20110502163048js_/http://wordpress.org/bb-plugins/_bb-quicktags.php?ver=1.1-alpha-2855"></script> <style type="text/css"> #ed_toolbar input { background:#FFFFFF url(https://web.archive.org/web/20110502163048im_/http://wordpress.org/support/bb-images/fade-butt.png) repeat-x scroll 0pt -2px; background:#F4F4F4 none repeat scroll 0%; border:1px solid #B2B2B2; color:#000000; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:13px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal; line-height:normal; margin:3px 2px 2px; padding:3px; } #ed_toolbar #ed_strong { font-weight: bold; } #ed_toolbar #ed_em { font-style: italic; } #ed_toolbar #ed_link {color:blue;text-decoration:underline;} #ed_toolbar #ed_pre {font-family:'Courier New',Courier,mono;margin-bottom:3px;} </style><style type="text/css">input#custom_postalzip, input#custom_blogs { width: 150px!important; text-transform: uppercase; } #pagebody tr.form-field td { width: 300px!important; }#userinfo dd .checkbox { visibility: hidden; }</style><script type="text/javascript" src="https://web.archive.org/web/20110502163048js_/http://s.wordpress.org/wp-includes/js/jquery/jquery.js"></script> </head> <body id="wordpress-org"> <div id="header"> <div class="wrapper"> <h1><a href="https://web.archive.org/web/20110502163048/http://wordpress.org/">WordPress.org</a></h1> <form action="https://web.archive.org/web/20110502163048/http://wordpress.org/search/do-search.php" method="get" id="head-search"> <input class="text" name="search" type="text" value="Search WordPress.org" maxlength="150" onfocus="this.value=(this.value=='Search WordPress.org') ? '' : this.value;" onblur="this.value=(this.value=='') ? 'Search WordPress.org' : this.value;"/> <input type="submit" class="button" value="Go"/> </form> <ul> <li><a href="/web/20110502163048/http://wordpress.org/" title="Home is where the heart is.">Home</a> </li> <li><a href="/web/20110502163048/http://wordpress.org/showcase/" title="See some of the sites built on WordPress.">Showcase</a> </li> <li><a href="/web/20110502163048/http://wordpress.org/extend/" title="Taking WordPress beyond your wildest imagination.">Extend</a> <ul class="nav-submenu"> <li><a href="/web/20110502163048/http://wordpress.org/extend/plugins/" title="Plugins can extend WordPress to do almost anything you can imagine.">Plugins</a></li> <li><a href="/web/20110502163048/http://wordpress.org/extend/themes/" title="Find just the right look for your website.">Themes</a></li> <li><a href="/web/20110502163048/http://wordpress.org/extend/mobile/" title="Take your website on the go!">Mobile</a></li> </ul></li> <li><a href="/web/20110502163048/http://wordpress.org/about/" title="About the WordPress Organization, and where we're going.">About</a> </li> <li><a href="https://web.archive.org/web/20110502163048/http://codex.wordpress.org/Main_Page" title="Documentation, tutorials, best practices.">Docs</a> </li> <li><a href="/web/20110502163048/http://wordpress.org/news/" title="Come here for the latest scoop.">Blog</a> </li> <li><a class="current" href="/web/20110502163048/http://wordpress.org/support/" title="Support and discussion forums.">Forums</a> </li> <li><a href="/web/20110502163048/http://wordpress.org/hosting/" title="Find a home for your blog.">Hosting</a> </li> <li id="download"><a href="/web/20110502163048/http://wordpress.org/download/" title="Get it. Got it? Good.">Download</a> </li> </ul> </div> </div> <div id="headline"> <div class="wrapper"> <h2>Forums</h2> <form class="login" method="post" action="https://web.archive.org/web/20110502163048/http://wordpress.org/support/bb-login.php"> <p><label><span class="hide-if-placeholder">Username</span> <input class="text" name="user_login" type="text" id="user_login" placeholder="username" size="13" maxlength="40" value=""/> </label> <label><span class="hide-if-placeholder">Password</span> <input class="text" name="password" type="password" id="password" placeholder="password" size="13" maxlength="40"/> </label> <input name="remember" type="checkbox" id="remember" title="Remember me" value="1" tabindex="3"/> <input name="re" type="hidden" value=""/> <input type="submit" class="button-secondary" name="Submit" id="submit" value="Log in"/> (<a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/bb-login.php">forgot?</a>) <a class="button" href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/register.php">Register</a></p> </form> <script type="text/javascript"> /* <![CDATA[ */ (function() { if ( document.getElementsByClassName && document.getElementById( 'user_login' ).placeholder ) { var hideThese = document.getElementsByClassName( 'hide-if-placeholder' ) for ( var i = 0; i < hideThese.length; i++ ) { hideThese[i].style.display = 'none'; } } })(); /* ]]> */ </script> </div> </div> <div id="pagebody"> <div class="wrapper topicnav"> <div class="col-8"> <p class="bbcrumb"><a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/">WordPress › Support</a> » <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/forum/how-to-and-troubleshooting">How-To and Troubleshooting</a></p> <div id="ajax-response"></div> </div> <div class="col-4"> <p id="pages"></p> </div> </div> <div class="wrapper topictitle"> <div class="col-12"> <h2>[resolved] Display posts over multiple pages <small>(3 posts)</small></h2> </div> </div> <div class="wrapper"> <div class="col-10"> <ol id="thread" start="1"> <li id="post-1804990" class="postitem "> <div class="threadauthor col-3"> <p><img alt="" src="https://web.archive.org/web/20110502163048im_/http://www.gravatar.com/avatar/63bc89bfa09f6b3c534e3afc08fc840e?s=48&d=monsterid&r=g" class="photo avatar avatar-48" style="height:48px; width:48px;"/><strong><a href="https://web.archive.org/web/20110502163048/http://www.dynedrewett.com/">duck__boy</a></strong><br/> <small><span class="authortitle"><a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/profile/duck_boy">Member</a></span><br/> Posted 5 months ago <a href="#post-1804990">#</a> </small> </p> </div> <div class="threadpost col-7"> <div class="post"><p>Hey all,</p> <p>I have had to create a custom select query to display the exact content that is required, but I'm wondering if anybody knows how I can display the results over multiple pages (5 results a page), such as can be achieved by using the 'posts_per_page' argument of the <code>query_posts()</code> function?</p> <p>Thanks, </p></div> </div> </li> <li id="post-1806981" class="postitem "> <div class="threadauthor col-3"> <p><img alt="" src="https://web.archive.org/web/20110502163048im_/http://www.gravatar.com/avatar/4a7c08f19b225ef76e586aa205c7a559?s=48&d=monsterid&r=g" class="photo avatar avatar-48" style="height:48px; width:48px;"/><strong>vtxyzzy</strong><br/> <small><span class="authortitle"><a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/profile/vtxyzzy">Member</a></span><br/> Posted 5 months ago <a href="#post-1806981">#</a> </small> </p> </div> <div class="threadpost col-7"> <div class="post"><p>This <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/topic/archive-posts-by-tag-or-meta-value-plus-add-pagination?replies=4">thread</a> gives an example of using the paginate_links() function to paginate an array. </p></div> </div> </li> <li id="post-1816689" class="postitem "> <div class="threadauthor col-3"> <p><img alt="" src="https://web.archive.org/web/20110502163048im_/http://www.gravatar.com/avatar/63bc89bfa09f6b3c534e3afc08fc840e?s=48&d=monsterid&r=g" class="photo avatar avatar-48" style="height:48px; width:48px;"/><strong><a href="https://web.archive.org/web/20110502163048/http://www.dynedrewett.com/">duck__boy</a></strong><br/> <small><span class="authortitle"><a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/profile/duck_boy">Member</a></span><br/> Posted 5 months ago <a href="#post-1816689">#</a> </small> </p> </div> <div class="threadpost col-7"> <div class="post"><p>Thanks so much, been trying to sort that for ages. Will learn to play to amend the styling of the pagination, but functionally it's perfect.</p> <p>Thanks again. </p></div> </div> </li> </ol> <div id="topic-paging" class="col-3"> <p id="pages"></p> </div> <h2 class="post-form">Reply</h2> <p>You must <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/bb-login.php">log in</a> to post.</p> </div> <div class="col-2 topicmeta"> <h4>About this Topic</h4> <ul> <li><a class="rsslink" href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/rss/topic/display-posts-over-multiple-pages">RSS feed for this topic</a></li> <li>Started 5 months ago by duck__boy</li> <li><a href="https://web.archive.org/web/20110502163048/http://wordpress.org/support/topic/display-posts-over-multiple-pages#post-1816689">Latest reply</a> from duck__boy</li> <li id="resolution-flipper">This topic is resolved</li> <li>WordPress version: 3.0.1</li> </ul> <div class="tags"> <h4>Tags</h4> <p>No <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/tags/">tags</a> yet.</p> </div> </div> </div> </div> <br class="clear"/> <script type="text/javascript"> //<![CDATA[ document.write('<scr'+'ipt src="https://web.archive.org/web/20110502163048/http://crazyegg.com/pages/scripts/23144.js?'+(new Date()).getTime()+'" type="text/javascript"></'+'script>'); //]]> </script> <div id="footer"> <div class="wrapper"> <p> <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/about/privacy/">Privacy</a> | <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/about/license/">License / GPLv2</a> See also: <a href="https://web.archive.org/web/20110502163048/http://wordpress.com/?ref=wporg-footer" title="Hassle-free WP hosting">WordPress.com</a> | <a href="https://web.archive.org/web/20110502163048/http://wordpress.tv/" title="Videos, tutorials, WordCamps">WordPress.TV</a> | <a href="https://web.archive.org/web/20110502163048/http://central.wordcamp.org/" title="Find a WordPress event near your home">WordCamp</a> | <a href="https://web.archive.org/web/20110502163048/http://jobs.wordpress.net/" title="Find or post WordPress jobs">WP Jobs</a> | <a href="https://web.archive.org/web/20110502163048/http://ma.tt/" title="Co-founder of WordPress, an example of what WordPress can do">Matt</a> | <a href="https://web.archive.org/web/20110502163048/http://wordpress.org/news/feed/" class="rsslink">Blog RSS</a> </p> <iframe src="https://web.archive.org/web/20110502163048if_/http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FWordPress&layout=standard&show_faces=true&width=450&action=like&font=lucida+grande&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;"></iframe> <h6>Code is Poetry</h6> </div> </div> <script type="text/javascript">_qoptions={qacct:"p-18-mFEk4J448M"};</script> <script type="text/javascript" src="https://web.archive.org/web/20110502163048js_/http://edge.quantserve.com/quant.js"></script> <noscript><img src="https://web.archive.org/web/20110502163048im_/http://pixel.quantserve.com/pixel/p-18-mFEk4J448M.gif" style="display: none;" border="0" height="1" width="1" alt=""/></noscript> <!-- 10 queries, 0.371 seconds --> <script type="text/javascript" src="https://web.archive.org/web/20110502163048js_/http://s.gravatar.com/js/gprofiles.js"></script> </body> </html> <!-- web11.luv.wordpress.org --><!-- FILE ARCHIVED ON 16:30:48 May 02, 2011 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 13:22:57 Dec 04, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 1.201 exclusion.robots: 0.046 exclusion.robots.policy: 0.027 esindex: 0.021 cdx.remote: 64.512 LoadShardBlock: 104.506 (3) PetaboxLoader3.datanode: 128.882 (4) load_resource: 149.909 PetaboxLoader3.resolve: 57.685 -->