If the theme doesn’t have a search.php
file, index.php
will be used.
Template_Hierarchy
Template file used to render a Search Results Index page
- search.php
- index.php
[update]
Use the following to print the current template being used to render a page:
add_filter( 'the_content', 'so_9405896_the_content_filter', 20, 1 );
function so_9405896_the_content_filter( $content )
{
if( is_admin() || !current_user_can( 'delete_plugins' ) )
return $content;
global $template;
$the_templ="<strong style="background-color: #CCC;padding:10px">TEMPLATE = "
. basename( $template ) . '</strong><br />';
$content = sprintf( $the_templ . '%s', $content );
return $content;
}
Which results in:
Related Posts:
- why does bones theme call the_excerpt function with parameters?
- How can I customize the search results in Bones theme?
- Varying Search Result Pages
- Twenty Twelve theme search returns Nothing Found
- Search form not finding content in template page
- Hi everybody, I have a problem of search box
- Moving the search bar to be in menu bar
- How can I modify the CSS only for the search results page of WordPress?
- Where to find child themes?
- Basic wordpress search shows no results
- How do I remove search bar that isn’t a widget?
- How can i display wath i am searching in a theme
- Search engine for themes [closed]
- how to add version of style.css in wordpress
- What is the role and history of the $content_width global variable?
- Override parent theme translation on child theme
- Add a page outside of the current theme?
- How to create a live demo page for a theme? [closed]
- How to incorporate admin theme in my back-end-plugin
- add image size still doesn’t work even after regenerating thumbnails
- Using chunk theme from wordpress.com on my own host
- What is the first file wordpress looks at in a theme?
- Duplicate and change a Theme Widget
- Best location for theme translation files
- Two Navigation Menus in Themes Produce the same menus?
- How to develop a theme while having another show up
- When does WordPress wrap inline scripts in CDATA?
- Theme not showing after uploading
- Being asked to update a theme that I don’t have
- I want to run different WordPress websites under the same database
- get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR
- Using a _GET gives me a debug error (over my head)
- Switch to other theme at URL
- How to go about pre generating css file with variables from theme options
- How can I create an “excerpt” with text that won’t be displayed in the post itself?
- Possible to put header-{your_custom_template}.php in subdirectory?
- Why wp_enqueue_style() not working?
- 404 Error while accessing the font files
- Child Style.css not overriding parent theme style located in assets/css/main.css
- Creating a theme options page
- Static page not working
- How do I change the scan depth for page template files?
- changing behaviour of get_search_form
- Moving test theme to live site without mySQL error – how? [closed]
- Error defining a gutenberg block in a theme
- Apache errors when retrieving taxonomies
- Can’t resize logo in responsive theme?
- How to display message (with switch_theme hook) after deactivating My theme?
- Is wordpress big enough for my project [closed]
- Using twitter bootstrap in a theme
- Featured images, am I missing something?
- Is there a way to upgrade a theme without losing custom templates?
- Theme doesn’t support shortcodes
- Trying to uninstall a theme, but it’s hijacking my home page
- Basic Theme for a Static Corporate Website?
- SOLVED Custom Add rewrite rule and Get string
- How to add some php code in header.php using plugin
- WordPress Theme and Plugin Name extraction
- Section Background Images?
- Homepage showing a simple listing of title, featured image, then posted on
- Setting a new default template for the creation of a page
- Adding a template in WPTouch
- Two column layout in WordPress?
- List of categories instead of dropdown menu selector in admin options
- WordPress doesn’t recognise created theme
- Losing theme customization when switching from a theme to a child
- Problem of not changing the front and bottom of the Woodmart template by activating the really simple ssl pro plugin in WordPress
- Please help me clear my confusions about WordPress
- Why does an ad page open when I browse my websites’s wp-admin page?
- Get the name WordPress default theme in the core
- What is the correct way to set up a staging server and use github for version control?
- How do I use the default style for widget?
- WordPress fails to embed video URL on specific theme
- Unable to set social icons using Advance Portfolio Theme
- How to add extra custom social icons to page with same style?
- Allow WP users to sort search result on a videos site
- How can I theme or style the lost password page without a plugin?
- how make wp include urls as https?
- how to costume title single page
- use a Thumbnail size in post
- Why does WordPress Editor Only Use Half the Box?
- Installing Theme from uploaded file. Not uploaded theme?
- Where can I find a theme that has a big banner
- WordPress theme not updating in Other browsers
- WP-CLI wp theme install url PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
- Site broken after deleting inactive themes [closed]
- Can i add wordpress editor to my custom theme option? [closed]
- Featured images are cropped on index and post page
- Change theme’s thumbnail to cropped WP featured image
- Best way to include pagination in a theme [closed]
- What happens to bespoke page template references on theme change?
- Stylesheet not being loaded? [closed]
- is it possible to create a website with wordpress with these requirements without coading?
- How to change the standard width of a page
- Where can I decide the number of posts to display on the blog index page?
- I need to disable responsive feature of a theme called Meet GavernWP [closed]
- how to add dynamic footer credit in Greatmag theme [closed]
- register_nav_menus syntax error, unexpected identifier “register_nav_menus” in
- RTL in posts only [closed]
- Blocking Google Fonts in wordpress website