get_current_site() not returning site name
Try using get_current_site_name() to insure you get the site name so something like this: echo get_current_site_name(get_current_site());
Try using get_current_site_name() to insure you get the site name so something like this: echo get_current_site_name(get_current_site());
Try: <?php if (current_user_can(‘edit_post’, $post->ID)) echo “<a href=”” . wp_nonce_url(“/wp-admin/post.php?action=delete&post=$id”, “delete-post_’ . $post->ID) . “‘>Delete post</a>” ?> You can decide when to empty the WordPress trash by adding this code to the wp-config.php file in your WordPress root directory. define(‘EMPTY_TRASH_DAYS’, 1 ); The 1 in the code signifies you want to empty the trash everyday. … Read more
You can use the show_option_all argument: <?php $args = array( ‘show_option_all’ => ‘Categories’ ); wp_dropdown_categories( $args ); ?> Function Reference/wp dropdown categories
Sounds like you have an issue with another plugin or function that is trying to prevent non logged in or non admin users access to the wp-admin area so it is redirecting from wp-admin/admin-ajax.php and giving you your 302 response. You need to find the code that is doing this and add a conditional not … Read more
Move the template files out of the subdirectory, and put them in the Theme’s root directory. Then, if you simply want to include the contents of those template files in other template files, simply call get_template_part( ‘test-page-name.php’ );. If you insist on keeping these files in a subdirectory, you’ll need to include them via locate_template().
add_action(‘plugins_loaded’, ‘initialize_custom_image_sizes’); plugins_loaded is fired off way before functions.php is included. Change that hook to init. http://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_a_Typical_Request
I’m not sure this is a problem you really need to solve. Any regular Chrome user knows this is how Chrome (doesn’t) handle RSS. That said, you can provide a custom feed template. see Customizing Your Feeds in Codex.
Add a static variable to the shortcode handler to check if the shortcode has been called already. Sample code add_shortcode( ‘wpse62826’, ‘wpse_62826_shortcode’ ); function wpse_62826_shortcode() { static $done = FALSE; // Nothing to do. if ( $done ) { return; } if ( is_singular() ) { $done = TRUE; } return ‘<b>I run once on … Read more
I don’t think it’s possible to do it with the get_users function. From what the Codex implies, you cannot pass arrays to the role argument. But it should be fairly easy to code your way out of that limitation. Try this: function filter_two_roles($user) { $roles = array(‘academic’,’student’); return in_array($user->roles[0], $roles); } $users = get_users(‘fields=all_with_meta’); // … Read more
Take a look at adding a custom meta box for any type of predefined meta field. add_meta_box – Docs – WordPress You will need to add a hook to the ‘save_post’ action in order to save the meta data also. Here is a quick and simple version: add_action( ‘save_post’, ‘your_meta_box_save’ ); add_action( ‘add_meta_boxes’, ‘your_meta_box_add’ ); … Read more