Problems to disable the comments for my statics pages

First of all, thanks to Ian Stewart for the codes here- In functions.php paste the following codes: // Template for comments and pingbacks. if ( ! function_exists( ‘my_comment’ ) ) : function my_comment( $comment, $args, $depth ) { $GLOBALS[‘comment’] = $comment; switch ( $comment->comment_type ) : case ‘pingback’ : case ‘trackback’ : // Display trackbacks … Read more

MultiSite: new Sites not showing up

It appears your sites are not under the same network, and you have network 1 and network 3. Normally this would never happen on an average multisite unless plugins are installed that can change this. Yes 1 WordPress multisite instance can run multiple networks of blogs, you have accidentally stumbled onto this feature, wordpress.com being … Read more

Create WordPress posts from JSON array using plugin in admin

Here I assume your json is an array of object where properties are named like wp_insert_post arguments: ‘post_title’, ‘post_content’ and so on. function process_ajax() { if ( ! isset($_POST[‘nonce’]) || ! wp_verify_nonce($_POST[‘nonce’], ‘mynonce’) ) die(‘error on checking nonce’); if ( ! isset($_POST[‘filepath’]) die(‘no file given’); if ( ! file_exists($_POST[‘filepath’]) ) die(‘invalid file given’); $posts = … Read more