I believe you are trying to check post type inside the Loop. To check the post type, try this:
global $post;
if('post' == $post->post_type ){
// post stuff here
}
else{
// aggregato stuff here
}
Alternatively, you can also use get_post_type()
function to get post type of current post.
Related Posts:
- Mixing custom post type and taxonomy rewrite structures?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Can multiple custom post types share a custom taxonomy?
- How to Add Custom Fields to a Custom Post Type?
- Using save_post to replace the post’s title
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Display current taxonomy term when inside custom post type
- limit selection of custom taxonomies to one?
- Importing old blog with regular posts into new custom post types
- $wp_query->queried_object->ID throws warning: Undefined property
- Load custom posts with same tag as page
- How can I add dropdown widget/box to admin post page?
- Get posts with tag all post types
- functions.php conditional tag only for custom post type
- Meta Query “IN” doesn’t work with ACF checkbox filter
- How do you modify the ‘post_parent’ of a custom post type?
- How to show related posts by category or custom post type?
- Archive or taxonomy pages not working for custom post type
- Custom Taxonomy returns no posts
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- Display Posts from Custom Post Type with Category Filters
- Display Custom Taxonomy
- How do I set the link in the Custom Post Type admin menu?
- Custom Post Type Events Archive Grouped By Month
- After updating a page, all pages on the site used the index.php template
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- How to post twitter like updates on wordpress
- get_post_meta returns empty array for terms
- Custom post type not using custom template
- Show one item per category of a custom post type
- Add Standard Page Attributes Metabox for Page Parent
- Permalink structure by Post Meta value
- Display as tree terms of taxonomy and custom posts for each term of taxonomy
- Custom post type: Disable single page, but keep archive
- Custom Tag Description unable to display just below and outside of the Loop
- Post count by month of taxonmy term
- Showing another posts on Archive custom post type page
- Custom post type + category archive page
- custom post type category count shortcode
- How to order and group custom post type posts by year and month
- Pretty URL for custom search for custom post type
- First custom field value (out of several) displayed twice after query
- Custom while loop for hierarchical display of a taxonomy
- Custom Post Type Archive Error, Takes Last Post as Title and Doesn’t Work
- Adding the_content() in custom template email
- Grouping of CPTs and taxonomies into menu groups in admin
- Use date in the URL of custom post type
- Why does not this wp_redirect work in is_single()?
- Show future events based on custom field AND order by date
- My archive-posttype.php template is not loading
- Create new custom post and post category of same name
- How to add terms (without deleting others)
- Archive not sorting correctly
- WP_query – Filter by tax_query and meta_query using multiple select
- Hide meta box for everything BUT a certain custom post type
- Create a list of recent Custom Post Types posts
- Empty search input does not return all posts
- Display custom tags for custom post listing page
- Update all published posts at once
- How to convert custom fields to content
- Variable Products as custom post types
- Confusion about how to use Custom Post Types, Custom Taxonomy or Category?
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- Limiting Amount of Posts in a Custom Post Type again
- Get taxonomy name used in a current post
- Custom Post type not Querying in switch_to_blog loop
- Custom post type not pulling CSS
- Hide the update button from edit view in wordpress custom post type
- Add link for CPT to another CPT on submit button
- CPT remove /blog/ by add new portfolio default /blog/%postname%/
- How to stop post status from reverting to Published?
- How to make id user can be view content
- Redirect users in first login to a dynamic link
- Custom permalink rewrite rules – how do I fix this?
- Custom Pagination based on Custom Post Type
- Link Custom Post Type Sidebar to Page/Posts
- Search form to find custom meta box generated data
- WordPress custom post type
- Problem to show custom post type in archive page category wise
- Taxonomy Grid Archive Help?
- Show Custom Post Type taxonomy term that matches custom field
- Redirect preview single post link to a page
- paging is not working properly on news archives page [duplicate]
- Yearly Archive from a custom date metabox (Event Start Date)
- Custom Loop and Standard Blog Loop Issue
- Custom Post Query Combined with Conditional Tags
- How to Display Custom Taxonomies in an Un-ordered HTML List
- 404 with Custom Post Type
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Allow admin to determine the order of queries?
- Problems with pagination for a custom post type
- Custom post type permalink structure
- How do I use CPT and permalinks with a mobile theme?
- Knowledgebase / Docs: Custom Post Type, Pages or as a Post Category?
- Add top-level menu pointing to a different custom post type?
- custom post type not getting archived?
- WordPress custom post type odd and even styling [duplicate]
- Add categories to custom post type
- How to add categories to a custom post type using wp_insert_post($new_post);
- Modify permalink of CPT archive to support two taxonomies