Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/272630-wordpress-show-all-posts/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.