A simple way to do is to edit your theme’s “search.php” (copying it from the parent theme into your child theme’s directory first if you’re using a child theme) and then before the posts loop putting something like:
<?php
if ( $tag = get_term_by( 'name', get_search_query(), 'post_tag' ) ) {
?>
<article><!-- or whatever is consistent with rest of listing. -->
<h2 class="entry-title"><!-- ditto -->
<a href="https://wordpress.stackexchange.com/questions/174104/<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>" rel="bookmark"><?php printf( __( '%s (tag archive)' ), $tag->name ); ?></a>
</h2>
</article>
<?php
}
?>
Related Posts:
- Tag Posts showing in wrong places
- What is the link to my default “archive” page?
- How to create tag.php
- Restrict a search to a custom post type
- Post formats template
- Same template for all the terms of a taxonomy
- Modifying searchform.php and search.php to have two kinds of searches
- Unable to create custom search results template page
- get_search_link() redirects to 404 template page
- Search results when none found – stay on page they were on
- Get link to a specific template file [closed]
- Redirect template based on permalink rather than $wp_query
- Standard WordPress Search does not work / Search-results are not displayed / Custom template
- How to identify which template WordPress’s default search-form retrieves in my theme
- How do I override the search template in a plugin?
- Use one template only for custom post type archives?
- What is the best practice to style archive page 2,3,etc differently than archive.php?
- How to use index.php as a template for archives?
- Archive template limiting to 4 entries?
- Force WordPress to NOT display the manual excerpt
- How to get and set the post tag value within WP Query from URL?
- Conditional to determine if search.php page is the current template
- How can I get all archive-URLs to use the same template?
- Pagination issue with tag.php
- How to use another file instead of home.php
- use a custom page to display search results
- Displaying a list of tags in my archives page
- which template does wp_ tag_ cloud point to?
- How do I get tags linking to proper pages (/tag/sample-tag -> pages with that tag)
- How to name custom search page PHP file?
- Search button click sends to single-custom_post_type instead staying at the same page
- Archive only for /year/month, not terms
- how to change custom post type search template to output search results in posttype-archive.php
- Custom Post Type tag taxonomy “Page Not Found”
- Editing the tag pages and using templates
- Where is search.php?
- Search results in custom template
- Problem with permalink structure for WordPress custom post_type archive template
- How to use Class
in Java? - Get name of the current template file
- How do you find out which template page is serving the current page?
- How to change the default registration email ? (plugin and/or non-plugin)
- How do I get the size of an attachment file?
- Is there any way to use get_template_part() with folders?
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- How can i change email template for new user
- Any advantage to using get_header() over include(‘header.php’)?
- Enable page templates. How?
- Is it possible to override the result of get_template_part()?
- Use [embed] filter in template files
- Searching multiple custom post types and pages
- What’s the purpose of the paged.php file?
- How do you access the Product Short Description in a WooCommerce email template? [closed]
- Prevent comments_template() to load comments.php
- Is there a way to list all used/unused WP templates?
- Page editor missing Templates drop down
- How to redirect to post if search results only returns one post
- Print WordPress template filename(s) for debugging
- How to force TinyMCE in WordPress to replace newlines with tags and not with
- How to find the posts page (home page) programatically
- WooCommerce: Change template for single product page
- View WordPress page template usage (or unused)
- How to edit contents of dynamic_sidebar()?
- How to check if a shortcode exists?
- Where is get_header(‘shop’) file in Woocommerce templates
- Custom templates folder
- Template issues getting ajax search results
- tag.php doesn’t work with tags on a custom post type post?
- Exclude Specific Term from Search
- 404 Error On Category and Tags Pages
- How to get slug of current category in taxonomy template?
- How to show a under construction page for a domain but still be able to work on index.php?
- Change the name of the ‘Default Template’
- Customizing get_the_excerpt() to specific length and “Read More” output.
- How to Rename a Template File?
- get page templates
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- Using WordPress templating for HTML emails
- Loading partial templates with AJAX/PJAX
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- WP frontend output of custom textarea fields not respecting line breaks. In admin it’s OK
- How do you check if a WordPress template file exist?
- Load entire NextGEN gallery from single thumbnail?
- I put my blog on a subpage, how do I get page title?
- A special single page templates for posts under a category and all its child category
- $wp_query initiation?
- Executing Queries in tag.php
- Custom reset password template after forgot password request
- Outputting Canonical Resource URLs Across a Multisite Network?
- Gravity Forms Custom Templates [closed]
- Child Theme: how to override variables?
- How do I get the URL of a specific size featured image?
- Neither the_excerpt() nor the_content() works properly?
- Where to store some per-template preferences?
- Sort posts by tags in category pages
- How to search for categories and/or tags?
- add/apend templates ‘transparently’ via plugin to currently active theme or child theme?
- stop blog page from using index.php?
- Page is defaulting to archive page and not designated template
- How can I modify the default reset (lost) password email text?