Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Vokrik on "Generate Loop with Custom Post type query problem"

$
0
0

Hi, I am having a problem with generating loop for my custom post type.

I am adding a post type "coffee_break" to a custom made theme by external developer.

For adding the Custom Post Type I used a plugin called "WCK - Custom Fields and Custom Post Types Creator"... All is hunky dory until I try to create a loop in the UI using a loop builder in the pagebuilder. The problem is that the proper query should look like this (it's generated when using old post type 'testimonial')
SELECT wp_posts.* FROM wp_posts JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_testimonial','post_attachment')...

With the coffee_break I get this

SELECT wp_posts.* FROM wp_posts JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_attachment') ...

The difference is that in the first case, t.element_type contains ('post_testimonial','post_attachment'), the coffee_break only ('post_attachment') and therefore it finds nothing.

Do you know how can this happen? Is there a problem with initialization of a custom post type?


Viewing all articles
Browse latest Browse all 8245

Trending Articles