Assigning Multiple Layout Designs with Custom Pages in WordPress?

Sounds like what you want is a Custom Page Template It’s quite simple, if you want to call your layout “My Special Layout” just create a file in your Theme Directory calling it whatever you like (I’d call it “page-my-special-layout.php” but that’s not required) and add the following comment to the top of the template … Read more

How to control WordPress Search Behavior?

What you tried to use is broken. add_filter( ‘pre_get_posts’, ‘modified_pre_get_posts’ ); function modified_pre_get_posts( WP_Query $query ) { if ( $query->is_search() ) { $query->set( ‘post_type’, array( ‘page-home’ ) ); } return $query; } That function definition is not valid. You would have seen an error if you had debugging enabled. You need: add_filter( ‘pre_get_posts’, ‘modified_pre_get_posts’ ); … Read more

Theme or Style WordPress Message pages

That screen is essentially a conditional display of the wp-login.php screen. It’s wp-login.php?action=logout, so to style it you have to simply enqueue a stylesheet (preferred) or inline code with your own style rules. So create your style-login.css file, put it in your theme/child theme (depending on if you’re building from scratch or just adding to … Read more

When calling wp_title(), do you have to create some kind of “title.php” file?

The wp_title() template tag does some context-based output. From the Codex: The title text depends on the query: Single post or a Page the title of the post (or Page) Date-based archive the date (e.g., “2006”, “2006 – January”) Category the name of the category Author page the public name of the user If you … Read more

Current class on admin menu using add_submenu_page()

Try this: add_menu_page(__(‘My Plugin’, ‘myplugin’),__(‘My Plugin’, ‘myplugin’), ‘edit_posts’,’my-plugin-dashboard’,’my_plugin_dashboard’,’icon’); // dashboard submenu – this fails to highlight with current add_submenu_page(‘my-plugin-dashboard’, __(‘Dashboard’,’myplugin’), __(‘Dashboard’,’myplugin’), ‘edit_posts’, ‘my-plugin-dashboard’, ‘my_plugin_dashboard’ ); // settings submenu – this fails to highlight with current add_submenu_page(‘my-plugin-dashboard’, __(‘Settings’,’myplugin’), __(‘Settings’,’myplugin’), ‘manage_options’, ‘my-plugin-settings’, ‘my_plugin_settings’ ); Essentially: don’t use full page links with admin.php?… as the page slug. Especially … Read more

PageLines theme: how to change the background color of the main content vs. entire page?

Looking at your code, this is a very very VERY bloated theme. Seriously, there’s no reason a page that simple should take over 4 seconds to fully load. In addition to the “way too many nested DIV’s” issue, areas above and below the header menu span the entire page, so you can’t actually change just … Read more