I am working on a project where I need to add table for custom post type. Please see this image: http://puu.sh/bOvtP/401d0f2f46.png

I have picked up a half-done project, and the client is willing not to see the WP interface. So, they already have it customized to a vast extent.

I have successfully created the admin pages in the back-end for three different custom post, for all three of them I need to create the table as shown int the image above.

The fourth column in the table in the above image is for "Region", which is actually name of states(which are sub-sites in the Multi-site network), I don't know how will I know to which sub-site the custom post is posted in.

The images shows that this is like admin screen of a custom post. But, the client don't want to use the default display of post in List tables in WordPress.

My problem is that I am not able to get the "custom posts" at that screen, and don't know how will I identify to which sub-site the custom post is posted too?

Please, view and suggest something. Thanks.

  • It was resolved.
    – OmAk
    Apr 29, 2015 at 3:19

1 Answer 1


It was resolved. This question was specific to some particular project and it's requirements. And, it was fulfilled at that time with a multisite function for WordPress.

What I did:

The task was done using a sub-class of WP_Query named WP_Query_Multisite. This class provides us arguments to use for which site to grab the info from.

What I used is:

    if( ($taxonomy != '') AND ( $taxonomy_term_slug != '' ) ) {
        $is_taxonomy_query = TRUE; 
        // This is a call with taxonomy so set those args
        $args = array( 
            'post_type'     => $post_type,
            'post_status'   => array( 'pending', 'draft', 'future' ),
            $taxonomy       => $taxonomy_term_slug
    else {
        $args = array( 
            'post_type'     => $post_type,
            'post_status'   => array( 'pending', 'draft', 'future' )

    // Run Our MultiSite Query 
    $query = new WP_Query_Multisite( $args ); 

And, then using the global variable blog_id in the loop:

    global $blog_id; 
    echo get_blog_details( $blog_id )->blogname;
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
    – cybmeta
    Oct 2, 2015 at 7:16
  • Answer added properly.
    – OmAk
    Oct 2, 2015 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.