I assume you’re looping through your query the usual way, if so, use the following code
if ( $query_parent_products->have_posts() ) :
while ( $query_parent_products->have_posts() ) {
$query_parent_products->the_post();
// your post specific logic here
if ( get_the_ID() == 116 ) {
_e ('my ID is 116', 'theme_domain');
} else {
the_title();
}
}
endif;
Related Posts:
- Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
- Is there a way to get N number of WYSIWYG editors in a custom post type?
- Why are the comments disabled by default on my custom_post_types?
- Getting the IDs of a custom post type
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Get Custom post with ID
- Is it OK to move admin menu items?
- How to throw error to user when saving post
- Filter by custom Field for Custom post type Admin Listing
- Display text if current user has written 1 or more posts in a custom post type
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- Compare 3 custom fields and sort by oldest
- Recent comments on author page?
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- WordPress custom post type Single.php?
- how to use two permalinks for one custom post type
- Adding capabilities to default roles
- Automatically Add a Category to a Custom Post Type
- Filters post in admin with dropdown select, custom post type
- Detect if 1st, 2nd or 3rd level custom page?
- Custom Permalink Tag breaks Pagination
- Display posts if a custom field value is equal to another custom field value
- Custom Fields vs Separate Table
- Add the current menu item CSS class to a custom page type archive in WordPress menu
- Why is archive.php used for my page
- Display custom post data in sidebar w/ dropdown
- Using several custom fields as custom post title
- Hide specific parent categories from post edit
- Return the thumbnail meta data for getter and setter
- CPT UI change custom taxonomy url
- How to create Blog Post Specific Widget
- Custom Post-Type not in admin menu
- Page vs Custom Post Types Differences/Issues
- WordPress custom post – add dynamically meta boxes
- Show posts from two or more custom taxonomy terms
- WordPress add_permastruct unwanted matches
- Link to full size post thumbnail
- Roles for Custom Post Types
- Having unique constraints for custom fields in a custom post type
- Make parts of your wordpress website completely built with data from external APIs?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- JS innerhtml changing style when using AJAX
- How do I add a custom screen for a custom post type to be called from custom post row action?
- Add Custom Post type menu to another menu in specific location
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- How to get custom posts sub category link
- Can you link custom post types to pages?
- Pretty URLs and custom post types
- Limit Search to Post Type With Apostrophe return search not found
- Add a custom text to admin footer in a Custom Post Type page
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Custom Rewrite Rule for Custom Post Type with URL Param
- List of users that clicked a ‘Join’ button at single post
- Setting Post Title via Meta Data returns Auto-draft
- How to enable UX builder for custom post types in Flatsome
- search custom post type by custom fields on front end
- category list with cutom post count
- Dynamic CPT permalink structure based on ACF field value
- Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’
- Custom permalink not working and showing 404 page not error
- Get post format
- get_delete_post_link() only works for administrator, even if other user has exactly the same permissions
- Custom post type and taxonomy cross registration [duplicate]
- Template code to split a post and print a custom field?
- Add Class according to the order of appearance
- How to know which archive page is active
- If tag exists, then echo once
- Custom Post Type UI
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Display All Courses in Course Archive Page
- Hide title field of selected post-types on edit pages
- Custom wp-query display post only today
- How to filter custom post type by multiple Taxonomies
- Order custom post type by taxonomy
- Display Custom Post Type Based on Taxonomy With WP_Query()
- Cannot display the_content() after removed WordPress 5’s auto embed feature (iframe & blockquote)
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- Problem in moving cpt’s from local website to live website
- Permalink for custom post type pages not working
- Adding admin menu seperators around CPT’s
- pagination for a custom query
- Custom nav menu current item custom link problem
- How To Loop Through list with Custom Post Types
- redirect old post type url to new structure url
- Custom Post Type + Category archive
- Customizing a plugin function using a hook
- Changing custom post_type when publishing
- one get_posts to return a number of custom posts for each meta value
- Show custom post type in archive page by category
- custom_post_type with umlaut in name
- Pop up showing same content on all posts display.
- Collection of fields in a single post
- How do I do this?: If custom post type exists, echo it, else do not
- WordPress custom post type post and category links 404
- Count of posts with meta_key filled in?
- Get Posts From A Certain Post Type In An ID Array
- Custom post type efficiency
- Choose custom post type template by category
- Query order by meta value force specific tag first