Main site single-property.php design, as homepage of a multisite

You have two options; either bake into the theme (functions.php) or write a simple plugin that auto-creates the post based on hooking into after new site (blog) creation: https://codex.wordpress.org/Plugin_API/Action_Reference/wpmu_new_blog Use the insert post function to do the creation: https://developer.wordpress.org/reference/functions/wp_insert_post/ Then, set as the home page based on ID returned: update_option( ‘page_on_front’, $new_page->ID );

date_query won’t accept day parameter, but will accept month and year for a custom post

As said in comments, you should use meta_query. For help on how to query posts by ACF meta field, you can check the ACF documentation: https://www.advancedcustomfields.com/resources/query-posts-custom-fields/ $args = array( ‘numberposts’ => -1, ‘post_type’ => ‘event’, ‘meta_key’ => ‘location’, ‘meta_value’ => ‘Melbourne’ ); // query $the_query = new WP_Query( $args );

Order Posts By Youtube Views

https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters <ul> <?php $item=0; $attr = array( ‘post_type’ => ‘lyrics’, ‘date_query’ => array( array( ‘after’ => ‘1 month ago’ ) ), ‘post_status’=> ‘publish’, ‘meta_key’ => ‘youtube_views’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $attr ); while ( $loop->have_posts() ) : $loop->the_post(); $song_name = get_the_title(); /*YOUTUBE QUERY HERE*/ // … Read more

Bring a post to the top of the query if it’s in a certain category?

You will have to use 2 queries, where in the first loop you should use: $args = array( “post_type” => “post”, “post_status” => “publish”, “orderby” => “date”, “order” => “DESC”, “posts_per_page” => 20, ‘post__in’ => cat, ); (The Query) And in the second: $args = array( “post_type” => “post”, “post_status” => “publish”, “orderby” => “date”, … Read more

Add post class in custom loop (WP_QUERY)

As milo stated, I need to use the post_class function to use the post_class filter. By adding <?php post_class(); ?> to the div in my loop I was then able to successfully modify the post class. Below is my full code containing the post_class filter and the post_class function. Reference: https://codex.wordpress.org/Function_Reference/post_class <?php //Call in the … Read more

How to take parameters from a function and make them editable as attributes in a shortcode

Essentially you are asking how to pass parameters to a shortcode. This can be done with the function shortcode_atts, which has two required parameters: an array of valid parameters and their defaults, and the attributes of the shortcode that is being passed. You would use it like this: add_shortcode( ‘wpse232385_show_news’, ‘wpse232385_news_query’ ); function wpse232385_news_query ($atts) … Read more