custom template only for content

You can’t override template parts. Even if you could, you would have no way of knowing what template part you’d need to replace. A theme is only required to have an index.php file and there are no restrictions or naming convention for template parts. Your options are to create a full template and leave it … Read more

How do i get custom metabox data from each multisite blog?

For those who stumble upon this in the future, this was actually answered by the CMB2 author himself, Michael Beckwith: $sites = wp_get_sites(); $current_site = get_current_blog_id(); foreach ($sites as $site) { $details = get_blog_details($site[‘blog_id’]); $zSite = $details->blog_id; $mycolor=””; $mclass=””; if( $current_site == $zSite ) { $mclass=”active”; } switch_to_blog( $site[ ‘blog_id’ ] ); $mycolor = get_option( … Read more

Add new post using a page inside the website

You have never read the WP documentation? Create any template and form and when submitting the form it could be Example: $args = array(‘post_type’=>’post’, ‘post_title’=>’your title’, ‘post_status’=>’publish’, ‘post_content’=>’post content’); wp_insert_post ($args); This will allow any post page or custom post type to insert the post