Why not yield/iterable in posts interface?

Even though the recommendations have been updated to: To run WordPress we recommend your host supports: PHP version 5.6 or greater MySQL version 5.6 or greater OR MariaDB version 10.0 or greater the minimum requirements are not there yet: WordPress server requirements for Version 3.2+: PHP version 5.2.4 or greater MySQL version 5.0.15 or greater … Read more

Return only post(s) which have post_excerpt

Something along these lines should work, not tested for syntax errors though function random_post() { $args = array( ‘post_type’ => ‘post’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 1, ); $post = query_posts( $args ); } if(!$post->post_excerpt){ random_post(); } // Then down here you would do whatever with the $post object

Multisite – sort merged get_posts() queries

You can try the new (4.7+) wp_list_sort() utility function that’s a wrapper for WP_List_Util::sort() that uses usort() or uasort(). Example 1: Sort by descending post date $sorted_custom_posts = wp_list_sort( $custom_posts, ‘post_date’, ‘DESC’ ); Example 2: Sort by descending post date and ascending post title $sorted_custom_posts = wp_list_sort( $custom_posts, [ ‘post_date’ => ‘DESC’, ‘post_title’ => ‘ASC’, … Read more

How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?

Considering the requirements that you’ve outlined, custom post types are definitely an appropriate choice for managing resources within WordPress. You get a CRUD interface right out of the box (just in case you’d like to leverage it) and WP All Import works nicely with WordPress posts, meta data, and taxonomies. There are great APIs for … Read more

I don’t arrive to do order_by title when i have a conditionnal year in a request

I tried your code and is working fine for me $args = array( ‘post_type’ => ‘project’,’posts_per_page’ => -1,’year’ => date(‘Y’) – 2, ‘orderby’=> ‘title’,’order’ => ‘ASC’); $myposts = get_posts( $args ); The thing is as you can see he is only fetching the posts from 2015. If you don’t have any posts with the publish … Read more

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