How do I output a database option that is an array into a get_posts array?

You could use wp_parse_id_list() to sanitize your comma seperated list of post IDs. It’s defined as: function wp_parse_id_list( $list ) { if ( !is_array($list) ) $list = preg_split(‘/[\s,]+/’, $list); return array_unique(array_map(‘absint’, $list)); } where we can see that it returns unique array values as well. Note that absint() is defined in core as abs( intval() … Read more

Show post only if match all categories

Here’s an updated version of your code that will get posts that have the Post Format Video and that have the same Categories as the current post in the loop. You’ll call wpse_get_video_posts_with_matching_categories() to execute the function. function wpse_get_video_posts_with_matching_categories() { $categories = get_the_category( get_the_ID() ); if ( empty ( $categories ) ) { return; } … Read more

attachments with tags and get_posts

From this page in the codex, i see that this parameter requires an array so i’d try this way: $vidArgs = array( ‘tag__in’ => array(5), ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_mime_type’=>’video/quicktime’, ‘posts_per_page’=>20 ); $videos = get_posts($vidArgs); foreach ($videos as $vid) { ///….

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)