get_post_class()
generates and returns the list of classes echoed by post_class()
. The only reason for the function itself not producing the result you want can be found in the source post-template.php
:
if ( ! is_admin() )
$classes[] = $post->post_type;
Which means that the class post
actually only gets generated if is_admin()
doesn’t apply.
Another possibility actually could be that the filter post_class is used to prevent the class. But given the available information this can just be a non-grounded assumption.
Related Posts:
- Get current menu_order
- Set Default Listing “View” in Admin
- How to add category to: ‘wp-admin/post-new.php’?
- How to prevent posts from being published too close to each other?
- Exclude drafts in all() view of edit.php
- How to publish a post with empty title and empty content?
- Change the Slug of Post Type post to baseurl/post/%postname%
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How do I use element instead of tags in WordPress post content having webP support?
- Prevent duplicate posts in wp_insert_post using custom fields
- How can I allow editors to leave comments on posts that have not yet been published?
- How to after saving or publishing a post redirect back to the original page
- How do I programmatically add an image to a post?
- problem to delete page
- Get user’s most published categories
- How to activate Markdown in a local installation of WordPress 4.3?
- setup_postdata doesn`t seem ot be working
- Single post as homepage?
- Pagination on single post page?
- Bulk update post slugs through database
- How To Remove Certain category Posts From the Blog Page
- Add icon/badge next to posttitle of specific category
- Ajax load more button in Recent posts widget
- Get posts of ONE taxonomy term of custom post type
- WordPress Custom Fields (Checkboxes with multiple values)
- How can I pass the ID of a post to a page template by clicking a url?
- How Can I Query a Specific Page From a MultiPage paginated Post
- Too many connections to server
- delete_post hook – deleting multiple items
- How do I exclude the current post from listing in recent posts
- Whitelist Author of Private Post
- Custom Post Archive Page not working
- Adding buttons to Add New Post and Add New Page
- How do I phpunit test a post output process?
- Stop users posting into category while still seeing contents of the category
- Can wordpress post and sidebar remain visible after scroll?
- How to switch wordpress post status between publish and schedule in MySQL?
- How to get posts from a current post’s month?
- Gather posts into a cart/lightbox and share with another user
- Wrong post title displayed from loop
- Custom post types related to same custom post type?
- What are the benefits of setting a “featured image” for a WP blog post?
- Format latest/newest post differently
- Loop doesn’t exclude the specified category in home page
- is_page Funtion for Posts ?
- show posts under subcategory only when in that subcategory
- How to update all posts at once?
- How include css class based on post ( in loop ) slug?
- WordPress Loop: How to display recent posts in multiple divs
- How to have one page show posts reverse-chronologically, but the others chronologically?
- When moving a WordPress installation to a new server, why do I have to update each post before content shows?
- wp_insert_post not working fine
- Post title is not showing
- Change Author Name to Sitename on Frontend
- Inserting Media to WordPress Posts
- Problem with trying to display subheader in posts
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Add Text Domain To Post Navigation
- Using the loop to set locations for all posts on a single google map
- Change content off every sixth element
- WordPress, custom post type and posts query help!
- Custom post type and taxonomy page templates
- What would causes search to return incorrect results?
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- Pagination not give another posts
- Shortcode for Comments and Comment Boxes in Post Loop
- Get post slug and match with menu item slug to change css
- Can’t find webpage on All Pages or All Post menus
- Centre Blog Index (Posts Page) on Home.php
- How to display particular categorie’s post which associated to specific user?
- Display Specific Categories posts on the home page
- Code to display random ordered posts in Categories across pages [duplicate]
- Integrate video and iframe in a post type gallery
- Modify loop to include all post statuses not just ‘published’
- How to convert return type of ‘get_posts()’ same as ‘wp_get_recent_posts()’?
- Filter question list on substring of metavalue
- Embedding Facebook in blog post not working
- Add category information beneath post?
- How to list all names and descriptions of a custom taxonomy
- Post List Widget with custom posts and editing the Read More Link
- WordPress Media URLs?
- Save/retrieve form data best practises for theme development
- Removing standard links in the posts page
- How to handle a post before publishing?
- How to inject a post within a loop
- How to display a certain template element only for posts published within certain time range?
- List direct children of page
- Unable to get posts with category on my page
- Multiple post back-to-back display only one gallery
- Error establishing a database connection
- Auto selection of category based on subject line or TAG
- Single post pagination
- posts_per_page – Repeats only first posts ‘post__in’ array
- WP Rest API feature image breaking react component
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Inserting Media on New Post But Hides Previous Uploads for Editor/Contributor
- Undefined Function Fatal Error with Shortcode [closed]
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category