Skip to:
Content
Pages
Categories
Search
Top
Bottom

Modify activity output in entry.php


  • assal0le
    Participant

    @assal0le

    In entry.php how can I check if the activity stream is a post or a custom post?

Viewing 2 replies - 1 through 2 (of 2 total)

  • Henry Wright
    Moderator

    @henrywright

    You can use the get_post_type() function. For example:

    if ( get_post_type( $post_id ) === 'post' ) {
        // This is a "post" post
    } else {
        // This isn't a "post" post
    }

    It’s also helpful to know the default post type names:

    • post
    • page
    • attachment
    • revision
    • nav_menu_item

    assal0le
    Participant

    @assal0le

    thanks @henrywright that works great as I need 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar