wp_update_post to set post IDs to drafts not working

Well in your for loop, I think you’re missing the $postcount variable… also there’s a typo at $idss[$i] …. should be $ids[i] based on what you’ve shown. for ($i = 0; $i < $postcount; $i++) { wp_update_post(array(‘ID’ => $ids[$i], ‘post_status’ => ‘draft’)); } That being said I’d just go with a foreach loop. The mistake … Read more

Orderby post__in Not Working Correctly?

If you look at the source of the Ajax Load More plugin, you can see a number of filters you can use to modify the query. You’ll likely want to use the alm_modify_query_args filter like so: $in_array = [ 115, 123, 66, 64 ]; add_filter( ‘alm_modify_query_args’, function( $args ) use ( $in_array ) { $args[ … Read more

Make sticky post with FacetWP

Ok, I figured it out myself. So maybe I can help someone out with the same question. I made a custom field TRUE / FALSE called “featured”. In facet WP I created this query: <?php return array( ‘post_type’ => ‘custom_post_type’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( ‘is_featured’ => array( ‘key’ => ‘featured’, ‘compare’ => ‘EXISTS’ … Read more

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