$nopages = "AND $wpdb->posts.post_type = 'post'";
In addition to the post post type, I'd like to add a couple more (i.e. 'projects' and 'videos'). I'm not much of a coder so I'm not sure where to begin. Can开发者_StackOverflow中文版 I add something like 'post_type' => array( 'post','videos','projects' ), anywhere in there?
You'll have to use IN() in your SQL query :
"AND $wpdb->posts.post_type IN ('post','videos','projects')";
And, if you have those in a PHP array, like this :
$types = array('post','videos','projects');
You can use the implode() to concatenate them into a string that can be used in an SQL query :
$types_in = implode(', ', $types);
"AND $wpdb->posts.post_type IN ($types_in)";
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论