fetch all post from wp multisite network and sort all the post in descending order on the basis of “Created by ” term

So you first want to order them by author and then by date for every author? You should use the orderby argument in your query, where you can pass an array. $custom_query_args = array( ‘post_type’ => ‘post’, ‘meta_key’ => ‘xyz’, ‘meta_value’ => ‘yes’, ‘orderby’ => array( ‘author’ => ‘ASC’, ‘date’ => ‘DESC’ ) ); This … Read more

How to add a link of “one” website in posts of “second” website in multisite WordPress

if you want to display the One website url in other site’s posts at bottom. you can use below code. it will display all other site links excepts current site of multisite at end of post content of “post” post type. you can change post type as your need. add_filter(‘the_content’,’add_site_url_in_bottom’,10,1); function add_site_url_in_bottom($content) { global $post; … Read more

How to post same content on multisite?

Here’s a concept code (i.e. not tested, requires tweaking) that you could maybe use. With this example a post you create would get cloned to other subsites in your network. function copy_content( $post_id, $post, $update ) { // check for revision, autosave, etc. $args = array( ‘site__not_in’ => array( get_current_blog_id() ), ); $sites = get_sites( … Read more