Redirect from the dashboard to edit.php if wp_is_mobile() is true

The action you’re looking for is auth_redirect, which is before the headers but still recognizes $pagenow to tell which page you’re on: add_action(‘auth_redirect’, ‘the_mobile_boot’); function the_mobile_boot() { global $pagenow; if ( $pagenow == ‘index.php’ && wp_is_mobile() ) { header( ‘Location: ‘ . get_admin_url(null, ‘edit.php’) ); exit; } }

Custom post type isn’t working

One problem is that your ‘capability_type’ parameter ‘community’ doesn’t match your ‘capabilities’ array values. From the Codex: capability_type (string or array) (optional) The string to use to build the read, edit, and delete capabilities. May be passed as an array to allow for alternative plurals when using this argument as a base to construct the … Read more

Display Custom Field Value on Admin Page Column

The main errors where the missing of the $post_ID parameter in page_template_field and using $custom_field_id instead of $post_ID. Anyway, this works and is simpler: add_filter(‘manage_pages_columns’, ‘column_page’); function column_page($defaults) { $defaults[‘column_template’] = ‘Page Template’; return $defaults; } add_action(‘manage_pages_custom_column’,’column_page_template’,10,2); function column_page_template($column_name, $post_ID) { if ($column_name == ‘column_template’) { $custom_field_values = get_post_meta($post_ID,’page_template’); if (!empty($custom_field_values)) { echo ‘<p> ‘. … Read more

How to Move the Comments Bubble to the Right Side of the Toolbar

After you have removed the comments bubble, you add it again. The trick is that in the $args of add_node you have to set parent to top-secondary. So it will look like this: add_action( ‘admin_bar_menu’, ‘wpse227079_toolbar_link_to_bubble’, 999 ); function wpse227079_toolbar_link_to_bubble ( $wp_admin_bar ) { $args = array( ‘id’ => ‘wp-admin-bar-comments’, ‘parent’=> ‘top-secondary’, ‘title’ => ‘QQ’, … Read more

Building a WordPress App

I’m curious how/where you got the impression that desktop apps are more secure than the WP admin. For better security, you can enable SSL for the normal WP admin web interface, by adding this line to wp-config.php: define(‘FORCE_SSL_ADMIN’, true); More info here: http://codex.wordpress.org/Administration_Over_SSL

How do I correctly transfer my site from one domain to another?

These two pages on the WordPress codex give a good overview changing URLs: http://codex.wordpress.org/Changing_The_Site_URL http://codex.wordpress.org/Moving_WordPress However to cut a long story short, what I always do is the following: Back everything up Copy this handy little file to the root of your site: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Run it It should pick up all of your settings, so … Read more

Grabbing how Many Posts by Month for a Dashboard Widget

Just Went over your code and it looks fine but you are missing the code blocks for your foreach loops so: add_action(‘wp_dashboard_setup’, ‘dashboard_test’); function dashboard_test() { global $wp_meta_boxes; wp_add_dashboard_widget(‘month_dashboard’, ‘Reports Submitted for the Year’, ‘custom_test’); } function custom_test(){ global $wpdb; $years = $wpdb->get_col(“SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status=”publish” AND post_type=”report” ORDER BY post_date DESC”); … Read more