I tried to get posts from wordpress sql, I want get posts where post_type = 'post' and where post_type = 'page'
My code:
$wpdb->get_row( " SELECT * FROM $wpdb->posts WHERE post_type = 'post' and post_type = 'page' AND post_status = 'publish' ORDER BY RAND() " );
This code is correct
$wpdb->get_row( " SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY RAND() " );
but only post_type = 'posts' i want both! post and page.
Thanks.