0

I am trying to make a query of a custom post type that searches the next 3 posts alphabetical order after a specific title. A snippet of the args wp_query is

$vars = array(
    'paged' => $page, 
    'posts_per_page' => intval($posts), 
    'order' => 'asc', 
    'offset' => ($offset ? $offset : ''), 
    'orderby' => 'title' 
); 

but have no clue how to query posts where title > specific title.

1
  • 1
    And what is your question and where is your code. Please visit How to Ask and help center and learn what a good question should look like, then come back and file an edit with your code and a proper explanation of your problem, and remember, doesn't work is not a failure/problem description. Thank you :-) May 4, 2015 at 8:33

1 Answer 1

0

You can use get_page_by_title to match the title of the required post.

$post_name = get_page_by_title( 'Post Title' );

$vars = array(
   'name' => $post_name,
   'paged' => $page, 
   'posts_per_page' => intval($posts), 
   'order' => 'asc', 
   'offset' => ($offset ? $offset : ''), 
   'orderby' => 'title' 
 ); 
1
  • This is returning me one post, i need the next 3 posts after this one in alphabetic order. May 4, 2015 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.