use a custom page to display search results

I noticed that your goal is to have an editable content on the search result. You can use another method to do that, by calling the content of the page from your search.php file. You can start by creating a page with the slug search-page as usual. You can also add post meta / custom … Read more

Single post full screen template not inheriting WordPress role permission

The following bypasses wordpress by not going through index.php: http://prompter.rareapps.org/prompter.php?p=2193 I’d recommend that instead of doing that, you place prompter.php in your theme directory and then hijack the page to display when someone clicks the link to view full screen using the template_redirect filter: function my_special_display_view( $template ) { if ( is_page() && isset($_REQUEST[‘special_view’]) ) … Read more

Create a Page template selector page

You could develop your own metabox for the page (with custom styling, probably) that allows selection of the template. I don’t know that generating screenshots is feasible, but you could definitely have it pull from some sort of associated file (eg: template name is template-name.php, screenshot is template-name.png). With the replacement selection method generated, you … Read more

Import a header template from another theme

As you have now stated that both Theme A and Theme B are already Child Themes, perhaps you could try adding this to your funcions.php file in Theme B – add_action(‘wp_enqueue_scripts’, ‘enqueue_front_scripts’); function enqueue_front_scripts(){ /** Switch to the parent blog */ switch_to_blog(1); // You may need to change the ID, I don’t know what ID … Read more

How to use another file instead of home.php

You could filter home_template, check for the presence whatever $_GET var is reliably set for each of those requests, and load a different template for those cases. function wpd_home_template( $home_template=”” ){ if( isset( $_GET[‘search_type’] ) ){ $home_template = locate_template( ‘homesearch.php’, false ); } return $home_template; } add_filter( ‘home_template’, ‘wpd_home_template’ ); EDIT- fixed incorrect var test.

Custom form not showing in correct place on page

When working with shortcode you must return a value rather than output directly. The below amendmetn should fix your positioning issue. For more informaiont, see the Shortcode API Codex, speciffically the Output section. function multipage_form() { global $wpdb; $this_page = $_SERVER[‘REQUEST_URI’]; $page = $_POST[‘page’]; if ( $page == NULL ) { /** * first name … Read more

Why is my sub-category template showing the wrong posts

Remove query_posts and add a pre_get_posts action to your functions.php file to modify sort order: function wpd_category_sort_order( $query ) { if ( !is_admin() && $query->is_category() && $query->is_main_query() ) { $query->set( ‘order’, ‘ASC’ ); } } add_action( ‘pre_get_posts’, ‘wpd_category_sort_order’ );

Create theme for mobile phones and tablets only?

It’s doable with a user agent string “sniffer”. Take a look at this project: http://mobiledetect.net Mind you, this approach can be troublesome as most modern browsers can ‘fake’ their user agent strings. Also, this approach doesn’t work to well with caching systems. I’ve implemented it successfully on a project I worked on, and I know … Read more