paginate - Paginating wordpress custom queries -


How do I get it? This is a code in the WordPress template that I use to get through my first letter. I only want 10 in one page.

  $ postids = $ wpdb- & gt; Get_col ($ wpdb- & gt; ready ("select $ wpdb-> from the ID for posts where SUBSTR ($ wpdb-> posts.post_title, 1,1) =% S command $ wpdb- & gt; Posts.post_title ", $ first_char)); = (1) "Post", 'Post_Status' = & gt; 'Publish', 'post_page_page' = & gt; -1, '$ postids' {$ args = array (' post__in '= & gt; $ postids,' post_type '= & gt; Caller_get_posts' = & gt; 1); $ My_query = null; $ My_query = New WP_Query ($ Args); If ($ my_query- & gt; is_paus ()) {'Title of the post title' starting with the letter 'echo' $ First_char; While ($ my_query- & gt; is_pause ()): $ my_query- & gt; The_post (); ? & Gt; & Lt; P & gt; & Lt; A href = "& lt ;? php the_permalink ()? & Gt;" Rel = "bookmark" title = "Permanent link & lt ;? php the_title_attribute () ;? & gt;" & Gt; & Lt ;? Php the_title (); ? & Gt; & Lt; / A & gt; & Lt; / P & gt; & Lt ;? Php timeline; } Wp_reset_query (); // restore the global post data stomped by the_post (). }? & Gt;  

I know that we can control the number of posts. But how to paginate? Typically in the usual loops inside the WordPress template, it

  & lt ;? Php works like ($ wp_query-> max_num_pages & gt; 1):? & Gt; & Lt; Div id = "nav-above" category = "navigation" & gt; & Lt; Div class = "new-previous" & gt; & Lt ;? Php next_posts_link (__ ('& lt; span class = "meta-nav" & gt; and & lt; & amp; lift;   & gt; twenty-ten'}); ? & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - #Navy-Up - & gt; & Lt ;? Php endif; ? & Gt;  

But it works in this case.

Here's one example should help:

  & lt ;; Php $ paged = (get_query_var ('paged'))? Get_query_var ('paged'): 1; $ Sticky = get_option ('sticky_posts'); $ Args = array ('cat' = & gt; 3, 'caller_get_posts' => 1, 'post__not_in' => $ chimp, 'paged' => $ paged,); Query_posts ($ args); ? & Gt;  


Comments