WordPress.org

Ready to get started?Download WordPress

Forums

changing posts_where string for custom post type (1 post)

  1. christian_gnoth
    Member
    Posted 3 years ago #

    hello,
    I am using a custom post type "ticket" and I am showing 10 on a page. At the bottom of the page I have the

    next_posts_link('Next Tickets »');

    call for the next tickets page. Unfortunately it returns the same tickets.

    I tried to use $query_strings and $wp_query, but it too returns the same entries.

    if I use the filter hook posts_where

    add_filter( 'posts_where', 'stm_ticket_get_previous_next_post_where');

    I get the following date from the where clause:

    AND (wp_posts.ID = '879')
    AND wp_posts.post_type = 'page'"

    string(97)
    "
    WHERE
    p.post_date < '2011-06-06 14:59:36'
    AND
    p.post_type = 'page' AND
    p.post_status = 'publish' "

    string(97) "
    WHERE
    p.post_date > '2011-06-06 14:59:36'
    AND
    p.post_type = 'page' AND p.post_status = 'publish' "

    How I can change it so that it returns the custom posts type ticket and to the next entries?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by christian_gnoth
  • This topic is not resolved
  • WordPress version: 3.2.1