pagination - How to paginate the user result page in Wordpress -


Is this my code that can anyone please help me to add paging to the user's results page?

  if (! Empty ($ user)) {foreach ($ user $ user) {$ user = get_userdata ($ user-> ID); & Lt; Div class = "wg_rec_dashboard_img" & gt; & Lt ;? Php $ wg_front_dp = get_user_meta ($ user-> id, 'wg_dp', true) ;? & Gt; & Lt; Img src = "& lt ;? php echo $ wg_front_dp ;? & gt;" & Gt; & Lt; / Div & gt; & Lt; Div class = "wg_rec_username" & gt; & Lt ;? Php echo $ user- & gt; first name; ? & Gt; & Lt; / Div & gt;   

I have tried Wordpress's underlying paging , but it is not working here.

You can use the following;

  & lt ;? Php $ number = 50; // Update it according to your needs user $ paged = per page (get_query_var ('paged'))? Get_query_var ('paged'): 1; $ Offset = ($ paged - 1) * $ number; $ User = get_users (); $ Query = get_users ('and offset =' offset. '& Amp; number ='. $ Number); $ Total_users = count ($ user); $ Total_query = count ($ query); $ Total_pages = intval ($ total_users / $ numeral) + 1; // Intert Paper Users Forex Currency ($ query as $ q) {$ user = get_userdata ($ q-> ID); ? & Gt; & Lt; div class = "wg_rec_dashboard_img" & gt; & Lt ;? Php $ wg_front_dp = get_user_meta ($ user-> id, 'wg_dp', true) ;? & Gt; & Lt; Img src = "& lt ;? php echo $ wg_front_dp ;? & gt;" & Gt; & Lt; / Div & gt; & Lt; div class = "wg_rec_username" & gt; & Lt ;? Php echo $ user- & gt; first name; ? & Gt; & Lt; / Div & gt; & Lt ;? Php}? & Gt; // Endorsement Issue & lt ;? Php if ($ total_users> $ total_query) {? & Gt; & Lt; div id = "pagination" class = "cleanfix" & gt; & Lt; Span class = "pages" & gt; Page: & lt; / Span & gt; & Lt ;? Php $ current_page = maximum (1, get_query_var ('paged')); 'Page =% #' / ',' current '= & gt; $ Current_page, 'total' = '% e', 'total' = '& gt; $ total_pages, 'prev_next' = & gt; False, 'type' = & gt; 'List',)); ? & Gt; & Lt; / Div & gt;    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -