From what I understand you have a loop that displays up to 500 pages. If the page parent = 18219 than you want to query the tags for that page. As far as I know, by default WP does not allow you to tag Pages, only Posts. But let’s pretend you have a plugin that allows you to do that… Inside your loop you can check to see if the page has a parent equal to the ID you’re looking for.
//Check if this page has a parent equal to $resparent
if($post->post_parent == $resparent){
$terms = get_the_terms($post->ID, 'post_tag');
foreach ( $terms as $term ) {
if (strlen($term->slug) >1){
$terms_array[] = $term->slug.",".$term->name ;
}
}
}
Related Posts:
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Query with custom taxonomy not working
- Serve specific “template” page at any URL that ends in its slug
- How to display an other custom post type in a different custom post type’s archive?
- Filter Custom Taxonomy Posts
- Determine if ID is page or post and query the ID
- How to query for a page, get data, then query for child pages of that page
- How do I stop the same post showing multiple times in a archive?
- My entry results are not consistently alphabetized
- How to create page that lists tags by initial letter?
- get contents and permalink from a specified page
- query_posts problem – need help
- WordPress pagination returns the same posts
- Adding a language rule and displaying posts with a custom taxonomy term on its archive page
- Query all posts if multiple meta key don’t exist
- How to display Related Posts based on number of taxonomy terms matched
- Why post__not_in is ignored?
- find posts that don’t have a custom taxonomy
- Is there a better way to pull in custom content without querying posts?
- How to query for all posts that have a particular meta key?
- Custom taxonomy.php not working
- Reset WordPress Post Query to default
- Advanced WP Query and/or
- How to get all post except particular category without breaking the paging
- How do I rewrite this loop as a new WP_Query style-loop?
- Exclude All Posts Which Do Not Have A Tag Assigned
- How to make WP_Query not to show irrelevant posts?
- How can I override one post and make it display content for another post?
- Include current post into loop
- Get all posts which was posted on X Days WordPress
- WP_Query args to show posts from specific custom taxonomy
- WP_Query for a taxonomy with different taxonomy types
- Exclude parent with child pages from WP_Query
- get all posts associated with a custom taxonomy
- How to provide meta_key array to wp_query?
- How to set an alternate posts_per_page value for default queries in different templates
- Using custom taxonomies in a query
- Easy way to write complex queries in wordpress
- Filter post query to only show direct children of category
- Order post type by sum of two custom fields
- get_posts output always same post
- Query_posts works when appending via AJAX call wp_query doesn’t?
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- Using WP_Query and Query_post for the loop?
- How to create custom query by keyword in post title?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Conditional operator OR not working with custom fields
- complex get_posts() query to select child pages
- How to add custom meta to ‘pre_get_terms’?
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- Create a loop on my pages with new “WP_Query”
- Get posts that do not have the same tags as current
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- All blog data on a page using custom query gives 404 for page 2 and onward
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Should I reset $wp_query?
- Posts Query | Query to only show sub categories
- One WP_Query that always shows 1 post from category X and 1 post from “not in category X”?
- How to print term name inside wp post loop
- Posts query according to meta box date
- Check if a post has term inside loop
- How can I comment comma-separated array values?
- How do I add a relation parameter to my filter query?
- When listing child pages run out of memory
- WPQuery calling specific posts problem
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Display specific page (that is child) content on parent page
- How to get posts by category and by choosing a taxonomy term?
- How to restrict search on a certain page to only return results against custom taxonomies?
- Creating attachments archive in tags and categories
- How to use ‘WP_Query’ or ‘query_posts’ to display content in a descending order
- Get next/prev image/attachment in time with date query
- Query Taxonomy By Page Title
- Custom Taxonomy Breaks Pages
- 2 queries with counters
- Get query results with a page title
- Show single posts date, in a page of posts
- Max Posts and Memory Limit
- How to get current page nearest parent id?
- How to get main menu only with wp_nav_menu
- specific post is not excluded from the loop
- Unable to paginate a custom page query
- How to create single page site in WordPress
- Why doesn’t my WP Meta Query return any results?
- Multiple Query_Posts
- Paginate pages with dynamic query
- Posts of specific category on page and excluded from index.htm
- filter posts by meta key with pagination
- Trouble Making WP_Query paged
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Custom template for password protected page
- WP_Query Class custom field parameters
- Get list of all Grandchild Pages
- Add AJAX “Load more” on custom query block
- Posts limit on homepage (genesis framework)
- Custom query does not find pages
- How to get pages of parent (non-recursive)?