You can use this inside the WordPress loop:
if (get_post_type() == 'post') {
// do something
}
Related Posts:
- Search posts by post author name
- Human Time Diff, change mins to minutes
- How can I show many posts an author has per week?
- Change all author links in Blog roll
- Change post author without using wp_update_post()
- Display Updated Date Instead of Published Date
- How do you update post date (year only) in a separate custom field?
- How do i search post by jquery datepicker?
- On WordPress Search, how to search post from Author meta also
- Custom author search
- How to get posts published between a date and today?
- How to check if post meta key exists or not in wordpress database
- How to get post creation date?
- Changing the post date and time with function
- How to add category to: ‘wp-admin/post-new.php’?
- Including categories in search results
- Hook that get’s triggered when the author of a post is changed
- the_author() returns empty string
- Prevent Authors from viewing each others Posts
- How can I retrieve multiple get_post_meta values efficiently?
- Code to make a post sticky
- Display Random Author with Details in Sidebar
- Is it possible to Schedule Attachments in WordPress?
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- How to allow hidden custom fields to be added from wp-admin/post.php?
- using wp_update_post on save_post
- Export WordPress Posts and Meta Information in CSV format
- How to show list of posts by author and category?
- WordPress: How to get the current logged in author page URL?
- Delete duplicated wp_postmeta record
- How to add editor’s name to entry meta byline?
- Different permalink for posts and authors
- How to put last edited entry on top of the blog-post list?
- Will a large postmeta table slow a site down?
- Update all posts automatically when using post_meta
- How to display posts by current user/author in a custom page template?
- Display all search results
- Query posts from current year
- How to batch update post content with custom post meta value
- Query posts distinct authors
- Change slug with custom field
- Restrict the Number of Posts an Author can Publish (over time)?
- Get the user type of an author
- Update existing post dates to random dates
- Search not working with title and content
- Better post meta efficiency?
- Show the title of the latest post by author
- featuring old articles without messing up with the archive
- Setting post meta data to random value during post status transition / on publish
- Find most recent authors
- Show author post count in sidebar – Variable
- Edit meta data does’t work with custom sql
- Get current users post URL?
- Get the author of the latest revision
- Filter posts by author and category simultaneously
- how to hide specific post from google search
- Custom Post Type & Author not associating, user post count is 0, api doesn’t return author in post objects
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- How to display an icon when a new post is published and then remove it when a specific time past?
- How to output comments number of a post per day?
- Post author is changed to admin after his post is modified by admin
- How to search only by post title and category?
- Display custom post types by date field
- Search widget breaks when using multiple loops?
- Change post format using custom field
- Get all posts by post_author
- Does WP get all post_meta on POST page?
- How can I display a specific user’s first published post?
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Pagination not working on custom query
- Exporting Data from WordPress into a flat table
- Adding Multiple Values to a Post Meta Key
- How can I control multiple editing of wordpress posts?
- Can wordpress differentiate between added and updated posts?
- Fetch posts from current week (Sunday to Saturday)
- Using radio button meta data from a custom meta box
- Multiple authors for single post without plugin
- Limit number of posts a user can make per minute?
- How can I get all posts data from within a paginated search result?
- Authors in menu, template list post by author
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Author must complete profile info before they can publish a post?
- WP rest api returns 404 only when author param is used
- Search query – exact post title match
- How can I list random authors from current post category?
- pagination hook doesn’t work with search results
- How to set post expiration date and time and move the page to archive after expiration [closed]
- PHP Notice error (when on 404 page)
- What Is meta_id In wp_postmeta?
- Search for posts based on their url in the admin?
- Checking if a post with certain meta value exists
- wp_query ‘s’ parameter does not work with custom post type
- How to permanently delete a post meta entry?
- Add custom field automatically (add_post_meta) with value based on number of words of article
- Differentiate between posts and pages in search results
- How to generate numbers indistinguishable for the IDs of the posts
- Modify WP_Post before processing
- Count search results in heading
- Save re-arranged draggable post items to wordpress database
- Display post from specific date