I’m not sure I fully understand your question, but I wonder if you mean:
if( 5 == $post->ID
|| 'archive' === mb_strtolower( $post->post_title )
|| 'archive' === $post->post_name )
{
echo 'Show me';
}
when you generate the HTML for the tabs.
ps: If you check the source of is_page()
you will see that it returns $wp_query->is_page( $page )
, where it uses the global $wp_query
object. So it’s mainly used for main queries but not sub queries.
Related Posts:
- Get posts inside Get terms problem
- Only showing the_date and the_excerpt for first entry in get_posts
- WordPress Random post (last 3 days posts)
- ‘child_of’ in get_posts not working
- List all pages including archive
- setup_postdata() does not seem to be working?
- Regenerate Slugs From Title of Posts
- Why get_posts are only showing five posts (retrieved by assigning a category to them?
- WordPress get_posts by category
- Alternative to get_posts() due to multithreading cache crash
- How to restore deleted pages/posts?
- get posts based on meta value of the author
- date_query not returning some posts in date range
- How do you get posts by meta_query using the JSON API plugin?
- Why favour the standard WP loop over iterating over (new WP_Query())->get_posts()?
- Query posts ordering by title, but ignore ” and special characters
- functions.php conditional tag only for custom post type
- get_posts not honoring post_status
- Limit number of pages in pagination
- get_posts only children from certain parents
- how to display active, upcoming and past event with featured listing with pagination
- Filtering custom post type query
- How to get only one category of custom post type?
- Display 4 chronological posts starting with a random post
- get_posts from post x(offset=>x) to end
- With get_posts(), how can I put a category as a variable
- Serialized array, grab specific posts with meta_key/meta_value[0]->is_featured
- How do I combine these 2 queries
- Increase the page size of the WordPress REST API
- get_posts() returns all posts rather than the ones specified with ‘post_author’ =>
- Query random post from different categories
- get_posts() excluding all children of a specific post/page
- Advanced Custom Fields: Post Object – Not returning data [closed]
- How to enqueue CSS and JS only on specific template?
- excluding current post from get_posts
- How to query posts to include specific pages of one post type, and all pages of another post type?
- Only retrieve posts where post_excerpt has been filled out
- Can I use numberposts=-1 and offset together when using get_posts()?
- Ordering posts in get_posts
- Why not yield/iterable in posts interface?
- how could I load a different template part by page
- How do I exclude recent post from recent post php widget
- Ho to add get_relative_date and post_except to this get_latest_post query?
- How do I get post attachments in menu_order in WordPress?
- get_posts() not working in functions.php
- Getting only a specific post type with get_post?
- If tag equals then show else show
- Display post details by post ID
- What is the p parameter in a get_posts() parameter array?
- Conditional tag doesn’t work in WordPress plugin
- Memory issue with get_posts( ) function
- get_posts() using an array of post ids [closed]
- How can I show the author’s latest post with title?
- get the post_date of ID
- Output meta into arrays
- Conditional Tag for has post [closed]
- Get posts in between specific ID’s
- Don’t submit post if post title exists
- If ‘editor’ is empty, then
- How to retrive the text : No movie by this actor
- Hide gravity forms
- Why would get_posts be ignoring posts with 2-digit ids?
- Order custom post type by custom field (created by PODS) via PHP
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- get_posts returns all posts
- Display an image based on field value
- meta query not retrieving posts
- Unable to render custom field after attempt to generate a list of recent post in page template
- Fetching All Posts (200+) in a Category – Performance Issues?
- Can’t get Category link inside get_posts
- How do I get only a certain number of images from a post (minus the featured image)?
- Yet another get_posts() in explicitly defined order problem
- List random posts on single page in the current category
- Divide the list into two columns (get_posts)
- WordPress echoing content in seemingly random place
- How to use get_posts to filter against a single post id?
- Why set cookie from URL parameter doesnt work all the time?
- How to add Text before my Custom Term and hide it when empty
- Is there a way to extract a single post better than using get_posts()?
- Array merging multiple get_posts throwing Undefined offset error
- Custom Category widget
- Why does ‘meta_key’ return an empty array in get_pages
- Multiple if statements with else for get_the_category [closed]
- Remove Featured Images from Posts Older Than a Certain Date
- How to Retrieve Post ID of another page
- if user is admin display admin link and logout link else display logout only
- Add code only for blog posts
- WordPress – List Sub Categories and Sub-Sub Categories, With Posts
- If Month=Particular month display content [closed]
- Sort posts by title, sort array by largest number [duplicate]
- Transient Loop Not working as expected
- Sorting posts by specific order
- Conditional in foreach loop is outputting content twice
- Advanced custom fields Repeater conditional statement not working [closed]
- Issues trying to add a href statment with PHP into a PHP Echo Statement [closed]
- Add Category names to post lists of custom post type
- Custom post type is_singular condtional not working when managing sidebar display
- advanced custom fields: repeater field within conditional statement [closed]
- Link on post title only if post have content
- WordPress Block Editor Gutenberg running code inside ! is_admin()