How to set different settings for a mobile theme?

Just wrap you code up in a conditional: if ( $GLOBALS[‘is_iphone’] ) { // do funky stuff for mini screens } global $is_iphone; will trigger TRUE for all mobile devices incl. tablets. Edit for WP 3.4+ Now there’s wp_is_mobile() to make checks for User-Agent. It’s basically a wrapper for $is_iphone and does the same.

Can i have a single wordpress site to have two themes ( one for pc other for mobiles)

If you don’t mind getting your hands dirty with code you could combine both themes into the same folder. IE: wp-content/themes/yourtheme/secondtheme Then add the code in the header.php for your primary theme to check if its a mobile site and send the user to wp-content/themes/yourtheme/secondtheme/index.php Probably a pretty big nightmare. The proper way of doing … Read more

How to remove all javascript in a theme wordpress?

You either use the admin_*/wp_print_scripts hook or the admin_*/wp_print_styles hook. The styles hook comes before the print scripts hook, so maybe it fits better than just using a priority of 0 for the *_print_scripts hook (there might be function with a name that’s hooked in earlier on priority 0). function wpse61635_remove_all_scripts() { global $wp_scripts; $leave_alone … Read more

Which themes do you use to test compatibilities with your plugin [closed]

Themes, anyone? I don’t test »against« or »with« themes. Just with some other plugins that might conflict (but I normally leave that open until something happens – you’ll never figure out all edge cases). At least, you’re intercepting/extending/altering stuff via filters. So why test against themes, when you’re modifying core functions? If you’re intercepting the_content … Read more

Changing the template hierarchy

Try this filter function wpse_63614_restructure_template_hierarchy( $template ){ return get_template_directory().’/filename.php’; } add_filter( ‘template_include’, ‘wpse_63614_restructure_template_hierarchy’ ); The filename would be the file you would want to call in your theme folder. For child themes you would use get_stylesheet_directory instead. EDIT: Or as suggested by Chip Bennett and what I too feel would be better; you can use … Read more

Add a Second Menu to a theme that only support 1 menu

Adding custom menu position to your wordpress theme is fairly simple. This is usually done this way: 1. Announcing the desired menu positions (in function.php): add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array( ‘first-menu’ => __( ‘First Menu’ ), ‘second-menu’ => __( ‘Second Menu’ ), ‘third-menu’ => __( ‘Third Menu’ ) ) ); } … Read more

How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)

That caption shortcode is built into WordPress. It should generate the same markup for any theme, unless the theme or a plugin has unregistered it and registered a replacement. I don’t know if that is the case with your theme or with TwentyEleven. Look for ‘img_caption_shortcode’ in your theme files, probably functions.php. If your theme … Read more