Delete pages and Create default pages for all new network sites

I’m really not sure where your logic is failing and haven’t revised each one of your insert/delete hooks. But the code can be greatly simplified to only call each function once, thus making it easy to make it work. add_action( ‘wpmu_new_blog’, ‘setup_blog_wpse_114119’, 10, 2 ); function setup_blog_wpse_114119( $blog_id, $user_id ) { create_pages_wpse_114119( $blog_id, $user_id ); … Read more

Adding a class to tag list in a function

If you are passing the before parameter that you can simply add any class that you want. You then style that class in style.css. <?php if ( get_the_tag_list() ) { echo get_the_tag_list(‘<ul class=”tag-list”><li class=”tag-item”>’,'</li><li class=”tag-item”>’,'</li></ul>’); } ?>

Change comment_reply_link URL

The following gets called by WordPress while getting the reply link. apply_filters( ‘comment_reply_link’, $before . $link . $after, $args, $comment, $post ); Use a custom filter to provide your own link. I don’t believe there is a direct way of altering just the URL, you have to inject the url into an html string yourself. … Read more

How to store / access files in child theme folder

Can you place custom .php files directly inside the child theme folder? Yes, of course you can. WordPress is PHP. What works in PHP works in WordPress. Some of the research we found says you must write your custom PHP functions inside of the functions.php file. Nonsense. Many themes segregate code into multiple files, including … Read more

How to test for Super Admin

I got it to work as follows — in mu-plugins directory, my superAdmin.php script looks like this: <?php function check_for_superAdmin($user_login, $user) { $current_user = get_userdatabylogin($user_login); if ( is_super_admin( $current_user->ID ) ) { // do these things } else { // do other things } } add_action( ‘wp_login’, ‘check_for_superAdmin’, 10, 2 ); ?> Hope this helps … Read more