Support » Plugin: Premium Portfolio Features for Phlox theme » Setting pre_get_posts wrong

  • balwansingh2008


    This plugin causes a conflict with many other plugins/themes. More below:

    In the file ‘includes/general-hooks.php’ line number 3843.

    You are using action “pre_get_posts” and the callback function uses below code:
    $post_types = [ 'portfolio', 'post' ];

    You are setting post_type to include portfolio and post, but other plugins or themes can use a different post_type but this is overwriting them.

    Instead please use this code:

    $post_types = [ 'portfolio', $query->get('post_type') ];

    so it returns your post_type portfolio and the original post_type instead of post.

  • You must be logged in to reply to this topic.