<?php if (get_the_author_meta('ID') == 7) : ?>
Do something for user with ID 7.
<?php else : ?>
Do something for anybody else.
<?php endif; ?>
Try this, where 7 is the ID of the user.
Related Posts:
- Display Authors Comments on Profile Page
- Filter post by current 2 differents users id
- get_attached_media() on author page not working
- Post ID randomly printing on page
- How to only get the content of post page while looping?
- Filter page ID outside the loop and order
- Can multiple authors be assigned on a single custom post?
- Get custom post type’s fields in a while loop as variables
- Custom Post Type within the Loop on Homepage (Page Template)
- The loop seems stuck to a single (now deleted) post
- How to restrict author to only access one custom post type ?
- Posts per row on archive page (custom post type)
- How do I know the ‘meta_key’ for ordering my custom post type
- How to show featured image block in custom post type for Author?
- Custom Theme With Custom Loops
- Custom Post Types strange pagination problem
- Custom post type conditional in loop
- Listing all term items alphabetically / sorting loop
- Display related custom taxonomy posts in sidebar
- pagination not working for category.php (custom post types in categories)
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- How do I control the output of a custom post type in the loop?
- Display custom post type posts first, then default posts
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Three Most Recent Posts, One Per Term
- Targeting custom post type
- Does WP have a global of $id?
- WordPress Loop if/else
- get_the_title() is returning results from previous loop
- Custom Post Loop pulling all custom posts, not just one
- Conditional for a Single Post That Belongs to a Category?
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Custom Post Type single.php template only shows the latest post
- Sort posts in loop by the WooCommerce Membership of the author
- Including all post id’s of a custom post type into an array
- How to include custom post type posts on a page?
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Tag page only display 10 posts
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- How can I group posts by months and years?
- Pagination Error : Duplicate argument being outputted
- get_post_type is always post
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Bootstrap accordion looping through posts incorrectly
- Main query not querying any posts in custom taxonomy template
- Loop increase number
- Custom post type showing same Post on all Pages
- Author posts not appearing for custom post type
- get_post_meta is not working inside shortcode
- Using wp_query to modify the loop in index.php for a CPT
- the_post() is printing titles in page footer
- retrieve permalinks of posts inside custom post type by using post ID
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- Display an authors post on a single page only when they are logged in
- Create Array from custom post type to display a slider
- Move Genesis Single Page/Single Post Title
- get parent content inside child posts
- 3 random images from custom post type, each in a div with a diffrent class
- Two column layout with alphabetical ordering
- Post loop count is not in order
- Control content before and after custom post type loop
- Listing custom post types on archive page with array
- get_pagination not working on a custom post type query (using WP_Query)
- How to Make infinite loop of post
- WP_Query with custom post type ID
- Displaying multiple post types on home page
- looping though custom post types and only return results in a given taxonomy
- Shortcode leaves no space for other elements?
- How to conditionally add Custom Post Type to Front Page
- Dynamically insert code to custom post type loop
- hide specific div on single.php [closed]
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Select other roles as custom post authors
- Pagination not working on custom query on a page
- Loop through posts of only 2 statuses
- Looping Through Categories of a CPT
- post_type internal ID?
- Search Filter CPT, Custom Loop
- How do you output an unknown number of images in a custom post type with desired markup?
- Get data from PHP to JavaScript to set position of each post on front page
- post body class for current user only if they are the post author
- Pull in taxonomy field of custom post type in new query
- How to add a lightbox to class mix?
- display posts of custom post type with custom taxonomy
- Query to get child pages of current page and display it in action hook
- Custom Post Type not showing in main loop
- My custom taxonomy is only displaying 1 of 3 terms
- Add more than one custom post type to wordpress home page post loop
- get custom post type value in header.php [closed]
- assign different templates to custom post type with homepage loop
- Restrict category access to specific users/groups. Author always has access
- Get post content from another section in custom single page
- Get post format
- Custom wordpress loop
- Assign a template to a custom post type when displayed by the main loop on the home page