LIMITED OFFER: Save $200 Today! - Get All Themes For $199 -- Learn More

Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

non-premiumpress custom post type taxonomies problem

  • Adnan
    Adnan
    Elite Member 459 points
    November 25, 2019 at 9:22 am

    I am using a plugin which has its own custom post type. Unfortunately, the Categories and Tags of this custom post type are not working.

    The error:

    [Unknown column 'wp_eo_events.EndDate' in 'where clause']
    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (8042) ) AND wp_posts.post_type = 'listing_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'confirmed' ) AND (wp_eo_events.EndDate > '2019-11-23' OR (wp_eo_events.EndDate = '2019-11-23' AND wp_eo_events.FinishTime > '00:19:42')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 12

    It looks like, a PP function/filter named _pre_get_posts is hooking to all post_types changing the WP Queries.

    I hope this issue can be resolved in the next update.

    The related ticket is : DRM-109-62861

  • Mark Fail
    Mark Fail
    Super Guru 12,885 points
    December 3, 2019 at 1:23 am

    file: new_class/ppt_5_search.php
    function _pre_get_posts()
    line: 115

    try editing the function there or simply adding;

    return $query;

  • Adnan
    Adnan
    Elite Member 459 points
    December 3, 2019 at 4:26 pm

    Hi Mark,

    in DT9 the function _pre_get_posts starts at line: 155

    so line: 115 can not be in my case. Which line should we add “return $query;” ?

  • JamesD
    JamesD
    Super Guru 1,350 points
    December 4, 2019 at 3:16 am

    Adnan,
    Yes, go with what you’re file is (starting line #155).

    If for some reason it’s incorrect then I’m guessing Mark must be referring to a newer file that hasn’t been released yet, otherwise that’s the location to place it.

  • Adnan
    Adnan
    Elite Member 459 points
    December 4, 2019 at 9:24 pm

    James,

    the function is huge, more than 1600 lines. I would like to know which line(s) to change in this function so that custom post type taxonomies are not affected.

Viewing 5 posts - 1 through 5 (of 5 total)