Scroll Triggered Boxes
[resolved] Correct way to use 'if Post Type is'? (6 posts)

  1. tapeasy
    Posted 1 year ago #

    Hi Danny,

    I'm trying to exclude a custom post type 'reviews' and only show the box on post types 'post' and another custom post type 'question'.

    Specifying post, question in the text box against 'if Post Type is' isn't working and the scroll box shows up on all post types, including reviews.

    I wonder if there is a different way to specify post types.

    Thanks so much for your help! :)


  2. Danny van Kooten
    Plugin Author

    Posted 1 year ago #

    Hi Sonal,

    Is your "if post type is" rule defined as follows?

    post, question

    If it is and it's still not working, please let me know. It would mean it's a bug I'll have to look into.

    In the meantime you should be able to use the following manual conditional rule.

    get_post_type() !== 'reviews'


    get_post_type() === 'post' || get_post_type() === 'question'

    Hope that helps!

  3. tapeasy
    Posted 1 year ago #

    Hi Danny, yes, this is how the rule looks like:

    if Post Type is post, question

    I did not use single quotes around them.

    I'm afraid neither of the get_post_type rules are working either. is_single() works, but then every custom post type gets included with that. It would be wonderful to be able to exclude 'reviews', in my case.

    You're doing an amazing job with this plugin and I'll appreciate any pointers you can provide.


  4. worthdesigning
    Posted 1 year ago #

    I've got the same problem.

    My template has an FAQ custom post type and a Portfolio custom post type so the box is showing on these types of posts, which I don't want.

    I tried - if Post type is .... get_post_type() === 'post'

    The form doesn't show up on the custom posts - but not on my blog posts either! I'm not a php expert so not sure what to put in that will work.

    Thanks, in advance :)

  5. Danny van Kooten
    Plugin Author

    Posted 1 year ago #

    Hi there,

    You can remove the get_post_type() call altogether. So, the following setting should just work.

    If post type is ... post

    The only thing you need to enter in the box is 'post'. :-)

    Hope that helps. If not, let me know!

  6. worthdesigning
    Posted 1 year ago #

    Awesome - fixed.

    Thanks Danny :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Scroll Triggered Boxes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic