Query more than 750 posts
-
Hello,
I had a sidebar widget working on my website. I use a php code plugin to use php on the sidebar. Anyway, I used the following code to list all the posts on my website in a dropdown menu. However, ever since the number of posts reached 750, the query will return an error:“Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0”
When I lower the number of posts to show, the code will work. So is 750 a wordpress limit to help lower the site load? Is there a way to increase that? Thanks very much in advance.
The code:
<form action="<? bloginfo('url'); ?>" method="get"> <select style="border-width:15pxborder-color:#c6c6c6; width: 77mm; background-color: #fff; font-family:Open Sans; font-size: 9pt;" onchange='this.form.submit()' name="page_id" id="page_id"> <OPTION SELECTED value=""><b>--Tüm Destinasyonlar (Alfabetik)--</b> <?php global $post; $args = array( 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' ); $posts = get_posts($args); foreach( $posts as $post ) : setup_postdata($post); ?> <option value="<? echo $post->ID; ?>"><?php the_title(); ?></option> <?php endforeach; ?> </select> </form> <br> <center> <span style="font-size: 12px;">?u anda sitede <b><?php $published_posts = wp_count_posts(); echo $published_posts->publish; ?></b> destinasyon yer almaktad?r.</span></center>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Query more than 750 posts’ is closed to new replies.