Paginate Wordpress $wpdb Query?

后端 未结 4 1869
说谎
说谎 2021-01-16 14:38

I have this query:

    posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id A         


        
4条回答
  •  借酒劲吻你
    2021-01-16 15:03

    prepare( $query, $author->id );
    $allPosts = $wpdb->get_results($numRowsQuery); 
    $wp_query->found_posts = $wpdb->num_rows;
    $wp_query->max_num_pages = ceil($wp_query->found_posts / $post_per_page); 
    
    $dataQuery = $wpdb->prepare( $postsQuery, $author->id );
    $posts = $wpdb->get_results($dataQuery); 
    
    ?> 
    
    
        
           
        
    
    
    
    

提交回复
热议问题