larethian
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Developing with WordPress
In reply to: Custom Post Type / page-parentsFixed it. I had to add a filter:
add_filter('page_attributes_dropdown_pages_args', 'my_attributes_dropdown_pages_args', 1, 1); function my_attributes_dropdown_pages_args($dropdown_args) { $dropdown_args['post_status'] = array('publish','draft'); return $dropdown_args; }This way drafts will be added to the list as well.
I tried this now in my loop:
$querystr = " SELECT $wpdb->posts.* FROM $wpdb->posts WHERE $wpdb->posts.post_type = 'ai1ec_event' AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'revision') INNER JOIN rwf_ai1ec_events ON (rwf_ai1ec_events.post_id = $wpdb->posts.ID) ORDER BY rwf_ai1ec_events.end DESC "; $pageposts = $wpdb->get_results($querystr, OBJECT);This doesn’t work – as soon as I try to join, I get no results in $pageposts.
Well, I tried to work around learning twig by trying to use the loop in my template to iterate through the events.
This works, but I can’t seem to get the events into the right order, because ai1ec stores the dates and times in an extra table in the database.
Which should work with a post_orderby filter.
Viewing 3 replies - 1 through 3 (of 3 total)