Including CSS and JS on Admin Screen of Custom Theme Options

If you create an admin theme plugin from the Codex steps, you will notice it says not to insert stylesheets as per above – although the above will work. If you place the following inside your admin theme file, it will serve the same purpose, but uses the wp_enqueue_styles approach: function add_admin_theme_styles() { wp_register_style($handle=”mytheme-theme-admin-styles”, $src … Read more

How to control initial wp_head() output?

Here is the current list of actions that is currently hooked by default to wp_head Reposted here to avoid unnecessary opening multiple browser windows add_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 ); add_action( ‘wp_head’, ‘wp_enqueue_scripts’, 1 ); add_action( ‘wp_head’, ‘feed_links’, 2 ); add_action( ‘wp_head’, ‘feed_links_extra’, 3 ); add_action( ‘wp_head’, ‘rsd_link’ ); add_action( ‘wp_head’, ‘wlwmanifest_link’ ); add_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, … Read more

How Do I Programmatically Force Custom Permalinks with My Theme?

To fully enable permalinks, you also need to ensure that .htaccess is also created. To do that, you need to set an option and flush the rules with a Boolean. global $wp_rewrite; //Write the rule $wp_rewrite->set_permalink_structure(‘/%postname%/’); //Set the option update_option( “rewrite_rules”, FALSE ); //Flush the rules and tell it to write htaccess $wp_rewrite->flush_rules( true ); … Read more

Where do I start from

Glad your taking the jump into wordpress, wordpress is an amazing platform for developers and non-developers alike, if you have knowledge of PHP, HTML, CSS (and jQuery in some instances) you will enjoy working with wordpress. A great place to start understanding wordpress would of-course be the wordpress website itself. http://codex.wordpress.org/Main_Page I hope this helps, … Read more

Remove Customize Background and Header from Appearance admin menu without CSS or JS

As overcomplicated as it sounds, I always find the best way to handle admin menu modifications is to overlook the given wordpress remove_ functions and go straight to the $menu and $submenu globals. In the case you’ve specified here, you’d want to change your code to: add_action(‘admin_menu’, ‘remove_unnecessary_wordpress_menus’, 999); function remove_unnecessary_wordpress_menus(){ global $submenu; unset($submenu[‘themes.php’][20]); unset($submenu[‘themes.php’][22]); … Read more