This is completely untested but I believe you would want something along these lines:
<?php
if( $loop->have_posts() ):
while ( $loop->have_posts() ):
$loop->the_post();
// Do stuff for results
echo '<h2>' . the_title() . '</h2>';
// Check for tag
if(has_tag($tag) { output HTML if true }
endwhile;
else:
echo "No Results!";
endif;
?>
Related Posts:
- Check if wp-login is current page
- Conditional tag to check if ‘page.php’ is being used?
- Manual excerpts for pages not working on Search
- Custom Search Page Pagination Not Working
- How to create wordpress page that shows posts with specific tags?
- When I split a large post with , how can a search locate users to the correct page?
- How to exclude shortcode from specific page IDs if it’s set to global
- How to get the excerpt of a page before more tag?
- Form action redirect to the same page
- Two Search pages, One search form
- How get get list of pages in ajax search
- conditional tags- how to use with shortcodes
- How to make tag post listing page working?
- Getting to a specific page on website using specific code instead of navigation bar
- Google Analytics tracking code on just one page?
- Search child pages from a specific page parent
- How to get tagged pages to show up with tagged posts?
- Query pages based on tags
- Show content if page is a grandchild of top level page
- Add Filter to Ignore a Post/Page or a Number of Post/Pages
- trying to add a author value in wp page links?
- Search results to be only posts & children of page ID
- Search anything from a Child and Sub-Pages of their Parent page
- Add pagination to search.php page
- Attach link to pages accoding to tags
- Displaying Content Only in Certain Page IDs Not Working
- Adding CSS styles to Admin Area PAGES only (not POSTS or CPT)
- If searched in a category show different 404 page
- Search page different title per results
- search page different results
- simple category search form returns full text – but I need excerpts
- Tags are automatically converted if they match post names. Stop It!
- How to enable automatic search results in WordPress
- Display list of posts with x tag within a page?
- Save search criteria per user and show on custom user page
- Add tags to long page that is broken up into subpages?
- How to get a list of pages (not posts) with specific tags?
- Custom SQL Query for WordPress page
- How restrict page for users logged? [closed]
- Only allow new subpages to be created
- Hide Visibility Option From WordPress Publish Metabox
- Targeting specific pages in the loop
- How to make nested page structure?
- List Child Pages of Parent Parent Page (Child pages from Grand Parent)
- Help with multiple dropdown tags search
- How to add meta boxes to Pages
- Differentiate between posts and pages in search results
- Missing parent page attribute
- Hiding Page by Title from Editing
- Why doesnt ONE of my links in the footer work properly? [closed]
- How do i change page template in bulk?
- Determine page content based on page parent
- Make parts of your wordpress website completely built with data from external APIs?
- category slug and page slug same
- New user Registration data imported into Page
- Could be a namespace conflict (?) with login form and register form on the same page
- The concept of non-blog content
- Loading Multiple Comments Pages via Ajax?
- Change base URL of pages created by certain users
- How to list a page tree?
- How to create a page and display only the posts with a specific custom field value?
- WordPress pages not working out correctly with HTML
- Change page name in admin list
- Dynamic page with comments
- How to rewrite a page url
- Manage content on multiple pages synchronysly?
- Display pages in alphabetical order
- If tag exists, then echo once
- get_page() – Only variables can be passed by reference
- Need Help with Custom ModRewrite
- Website jumps to top when scrolling down
- How to fix broken URL – https://mywebsite.com/comments/feed/
- Revert a Draft page to its original version
- Loading ACF Field content on a 404.php page
- My edits are not saved
- Can I use the wordpress loop in pages?
- Add addtional page parameter before loading the page
- the_excerpt displaying code inside style tag
- When would it be best to hook AJAX functions on a back-end page?
- Detecting if I’m on a single, non-post, non-homepage page?
- Page has no template
- My AJAX requests take 30 seconds to complete
- Pre-populating new Page creation with shortcodes
- WordPress Pages “allow comments” meta option can’t be checked
- Loading internal page
- Firing page_publish where page is child page
- Add role and edit page capabilities
- Google indexed pages for one page site
- WordPress, page 2 shows the same posts as page 1
- Parent for a single (single.php)
- Create a new page for each form selection
- How can one get page by pagename if it is a child page?
- Archive with specific keyword by category sorted by date
- How to pass the Querystring in pages?
- Edit the text location of a form
- How can I make a search term redirect to a page
- How to customize the author page in wordpress?
- User profile in front-end
- custom css in one page
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?