Support

Account

Home Forums General Issues Get all "values -> labels" for a Select field AND a specific post type Reply To: Get all "values -> labels" for a Select field AND a specific post type

  • Hi there!

    I will attempt to help… I have a question though…
    .. how do you want to display the values?

    For example.. you could append it to the content of a post, so then you would filter the_content() … and within your function you can write a conditional statement for a specific post type.

    In general, when you have access to the Post ID, you can determine the post type using the code below:

    
    if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
        //if is true
    }
    

    Depending on the function you are using, you may have access to the Post Object, or the Post ID directly… so you would replace get_the_id() with however you get the Post ID in the given situation.

    Hope that helps! But please let me know if you need further clarification, and let me know the very specific goal and I can offer more direction if needed.

    Thanks for your inquiry,
    Keith