Custom Post Type not recognized in "have_posts() function"
-
Hi,
I have installed the plugin in my site and i’ve seen a problem with the custom post type. Explain more…
In the file taxonomy-(custom-taxonomy-).php i have a loop for the all object of custom-type…
if the result are found in DB (without Elasticsearch) the loop found all the result, having a normal behavior.
But if take the result from Elasticsearch in the $post variable not exist anyone object of the custom-type but all object are the default (post) type.
It is as wordpress not recorgnize the custom if the result come from Elasticsearch plugin.
For bypass this problem have add the next snippet before the loop$args = array(‘post_type’ => “my-custom-post-type”);
query_posts($args);//loop
if ( have_posts() ) :
…
…On this mode the loop return again the post for my scope.
This is a workaround. For optimal solution what’s the your’s advice
- The topic ‘Custom Post Type not recognized in "have_posts() function"’ is closed to new replies.