There are various ways to solve this. First coming to mind are checking via is_singular() or get_post_type(). Using the latter you could write
foreach( $posts as $p ):
setup_postdata( $p );
$post_type = get_post_type($p);
if ($post_type === Tribe__Events__Main::POSTTYPE) {
//or: if ($post_type === 'tribe_events') {
// Display the date of the event
$p_event = tribe_get_start_time ( $p->ID, 'j F à H \h i' );
if ( $p_event ) {
echo $p_event;
}
else '';
}
endforeach;
Related Posts:
- How to schedule multiple posts while adding new
- order posts by date like craigslist
- How to get the latest posting time of archived pages in WordPress?
- How to insert current date/time in the content of a post?
- How to get the date of a post in WordPress, so I could use it in a script?
- Automatically Updating Publish Date Bug
- How can I show many posts an author has per week?
- If modified on same day, show only time
- Prevent scheduled post being published if date/time is past current date/time
- Automatically add date to the auto generation of post slug
- How i can limit period of post publication?
- Changing default WP-Site creation date
- Get the most recently modified post date of most recently modified post
- How to show different timestamp
- Date is wrong on ‘all posts’ page
- change the post time on multiple posts
- Access last visit time to a post
- Post navigation using date
- Bulk update published posts date randomly using wp-cli?
- How do you update post date (year only) in a separate custom field?
- How to handle dates, trying to calculate time since a post
- date_query returning only the most recent post instead of the post published before today
- Post/Page Preview Template
- Count how many posts in category
- Post slugs and images cannot have same name?
- Convert custom fields to post categories
- Hide password protected posts in admin
- Most viewed post for the last 2 days using WP_Query
- Adding Post Counts to Menu (Nav) Programmatically?
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Show chart in post using data passed as custom field
- Show One Category on Post
- Creating new page with pre-defined parent page
- Get all Youtube video’s from posts and embed them on a different page
- How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?
- Send email to user that his post has been rejected
- How can I highlight syntax like it appears on stackoverflow?
- Custom post type permalinks breaking due to 3.1 bug fix
- wp_insert_post let users post to without login…broke
- Export posts manually selected by end user (not logged in)
- Add Category name to Post Title (h1)
- Blogroll – Different layout for first post
- How to delete old posts’ edits to save space?
- When trashing a post, also trash related comments
- Loop through all product posts?
- Image Insert into posts and pages not working after 3.2.1 update
- How to add Tags Filter in wordpress admin dashboard
- How to display featured image without it appearing in post?
- allow new users to post an article before they sign up [closed]
- Make Post Editor Select Number of Columns To 1 By Default
- Adding the_date inside tags around the_content
- Mixing Tweets with Posts
- Problem with permalink routing?
- Ajax post filters not working
- Making a custom Pagination for multi page blog post
- Listing Specific Categories from Current Post with Depth
- Custom Post Type Rewrite To Include Parent Page(s)
- Getting only the URL of the post thumbnail
- outputting posts’ taxonomies: cant get ‘get_the_taxonomies’ working
- Displaying posts that belong to a specific author
- Query for first 3 posts to change the look and feel
- Getting blog pagination to work on page set as front page
- Navigate through the posts using keyboard arrows
- unique post in “$args” of wp_query display more than one post
- Do one have to wait after pressing “update” on a post edit page?
- Link to date_query results in WordPress
- Add post tags to previously created custom post type
- Problem with quotes
- Add Input Field in Simple Model Contact Form (smcf) plugin [closed]
- Anyone know a php snippet for showing the first 200 characters of the most recent post?
- Am getting duplicate data from get_posts()
- How to display the post categories for each post inside the loop with custom format?
- Allow / show post comments in category pages
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Display default matabox of posts(add category) wordpress
- How to get tags when using publish_post
- Filter post by users creation date
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- Function is printing twice – any suggestions?
- How do you change the permalink for posts for a single category?
- Pagination Not Working With Custom Post Type Category
- how to create a category with wp_insert_post and post_category
- Disaply products from category
- Multisite Issue on Subdomain’s article pages
- Post not showing in the front page
- If user has 1 post then dont let him create new one [closed]
- Blank page after changing number of post displayed in wp-admin
- Show all posts from the tags without having to set all of them
- Is there a global page/post/product/anything ID?
- Auto populate custom fields by post date
- How to show only Post titles on category pages
- Show Post number of specific Category
- Thumbnail With Next/Prev Links Not Showing Next Post?
- Sort Posts Alphabetically by Multiple Categories [duplicate]
- How can I allow users (subscribers) to download selected posts into a single PDF? (RESOLVED)
- How to change text (date) in post base on the day
- How do you order posts by type then term_id and then by date?
- Blog posts are not appearing as subs of Blog Page
- Best method for comment section associated with different images?
- Change permalinks in posts via SQL