misterdc Posted January 3, 2013 Share Posted January 3, 2013 Not sure if this is the right place to come, but I need a little help. A wordpress theme I'm using has a blog page that loads howver many posts are set in the WP Reading settings. There is a Load More posts bar at the end of the list that, when clicked, only loads as many posts as are set in the WP Reading settings. I'd like to arrange it that it loads all posts. I've contacted the theme maker, but his advice doesn't work. The blog page in question: http://www.dcdouglas...c-douglas-blog/ The original code: /*-----------------------------------------------------------------------------------*/ # Load More posts /*-----------------------------------------------------------------------------------*/ add_action('wp_ajax_nopriv_tie_load_more', 'tie_home_load'); add_action('wp_ajax_tie_load_more', 'tie_home_load'); function tie_home_load(){ $exc_home_cats = tie_get_option( 'exc_home_cats' ); if( $_REQUEST["isHome"] == 1 && $exc_home_cats ){ foreach($exc_home_cats as $cat) $string .= '-' .$cat.","; $string = substr($string, 0, -1); if( !empty( $string )) $exc_home = '&cat='.$string; } query_posts($_REQUEST['query'].$exc_home.'&post_status=publish&paged='.$_REQUEST['page']); get_template_part( 'loop', 'index' ); die; } His suggestion: query_posts($_REQUEST['query'].$exc_home.'&post_status=publish&posts_per_page=-1&paged='.$_REQUEST['page']); It doesn't affect it at all. Any ideas? thank you! Quote Link to comment https://forums.phpfreaks.com/topic/272630-wordpress-show-all-posts/ Share on other sites More sharing options...
Jessica Posted January 3, 2013 Share Posted January 3, 2013 find the query_posts function. Quote Link to comment https://forums.phpfreaks.com/topic/272630-wordpress-show-all-posts/#findComment-1402900 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.