You need to use pre_get_posts hook. Paste this code to your themes functions.php file.
add_action('pre_get_posts', 'wpse_pre_get_posts');
function wpse_pre_get_posts($q)
{
if( $q->is_main_query() && $q->is_tag() )
{
$q->set('post_type', array('post','page') );
}
}
Related Posts:
- How to create wordpress page that shows posts with specific tags?
- 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?
- How to make tag post listing page working?
- Query pages based on tags
- trying to add a author value in wp page links?
- Attach link to pages accoding to tags
- Search Page: activate html code if the tag is on the page
- Tags are automatically converted if they match post names. Stop It!
- Display list of posts with x tag within a page?
- Add tags to long page that is broken up into subpages?
- How to get a list of pages (not posts) with specific tags?
- How to set post slug when using wp_insert_post();?
- Create a page without adding a page in the Database
- What methods to use to create small, editable pieces of text for static pages?
- Hide page visual editor if certain template is selected?
- What is an alternative to get_page_by_title()?
- Require title for pages
- Add a new page to wordpress programmatically
- Get Permalink for the top level parent of child pages
- Get page id by title?
- How to embed page content in a blog post
- Notify admin when page is edited?
- List all pages and children in separate ul
- Dynamically Load Styles and Scripts from Theme Functions.php
- How do I load custom scripts and styles for a page?
- How should I best incorporate WordPress in my static website?
- WP won’t save changes in post (any)
- Can’t change parent page
- Call the content of a page in AJAX in WordPress
- Registering multiple sidebars with data from an array
- How to dynamically save a selected option from page “Templates” selectbox?
- Change names of pages in wordpress
- WASM page in WordPress website
- Include a specific page in your template
- Extra title output with this function wp_list_pages
- Where is the key _wp_page_template passed?
- Displaying page content in category archive (archive.php)
- Is it possible to skip certain specified pages when using < prev and next > links?
- Custom Page Order instead of Alphabetical
- Missing Page, But Still Exists In Preview
- How to create a page that lists all the experts(Users with same access permission as author)?
- Adding Author and Updated Schema Markup to WordPress Static Pages
- Trying to Edit a Page but it sends me to a Product Edit page
- Create a page that’s to not be indexed or accessible via slug
- My custom template page not loading content inside it?
- Can a user find a child page?
- How to edit a HTML list in WordPress?
- Is it possible to activate page template without manually selecting it in wp-admin?
- Excerpt Now Showing on the Post Page
- How can I use “getarchives_where” to get monthly archives for static pages?
- All Pages visible on the Frontpage
- How do we exclude multiple pages (like opposite of is_page)
- Only Display a Featured Image on First Post Page
- Create page template with some static contents
- Link to Particular Page Within Template PHP Code
- Can I schedule my site to launch at a set time and date?
- If I use a static page-slug.php for a page, is the database still queried?
- How do I quickly hide a hierarchy of pages from search engines and external users?
- How to store archived copies of a WordPress site
- Changes in WordPress taking 48hrs to reflect [closed]
- Remove Duplicate Pages so only original exists
- Best way to organize data in this scenario
- Would a “hub” page work better as a page or a post?
- Does Feedburner send notifications about WordPress pages?
- Using index.php as page template
- What’s the section of code (or loop) which retrieves the Page title and description?
- How to backup just pages from my site, but not posts with other post_type values
- Template field missing in page attributes
- How to hide a page in wordpress made for menu
- How to delete the scrollbar in my pages?
- How to make a page as default page for a theme without a plugin?
- How to change default home link title?
- Recovering a page from the drafts
- Pulling images from the media folder category to display inside a page
- My Password Protected Pages Aren’t Working
- Display grandchild page content on parent page
- Converting HTML to WordPress theme: integrating pages function and using its text editor, conditional enqueuing
- How do you assign custom template for Posts page (under Front page displays setting)
- Category Page Custom Layout [closed]
- How to copy specific page content and create child page?
- How to output different content of page on different places in my template
- WordPress slow pages/post, hangs and white text
- Adding CSS styles to Admin Area PAGES only (not POSTS or CPT)
- 1st Level Page with No Children
- Previewing Draft shows white page, publishing works fine?
- Changing title bar in browser window of theme “Encounters Lite”
- Custom Filter using meta_value in wordpress admin list not working
- Grabbing the_content from “about us”
- making a pseudo-static page
- Dynamic content in pages
- Woocommerce – Making product pages child of shop
- Javascript will not run properly
- Website fully loads then immediately crashes in Internet Explorer [closed]
- How to display a page?
- How to read a page’s “Shortcodes” from the Template File?
- Split Page Links
- Ask for template when adding a new page
- How to view front-end of WordPress website, using Atom?
- Custom template is not showing up in templates dropdown list after re-naming it