1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I need help with Conditional Tags

Discussion in 'WordPress' started by Divvy, Mar 21, 2018.

  1. #1
    Hello guys,

    Can someone give me a little help here?

    I want to show a widget on all pages except in a specific page and on a specific custom post_type.

    This is what I have to show in all pages except the page /videos/

    !is_page('videos') && $post==$posts[0] && !is_paged()
    Code (markup):
    Is working great!

    But how to hide in all post type "vrvideo" too?

    I tried this but didn't worked:

    !is_page( array( 'videos', 'vrvideo' ) ) && $post==$posts[0] && !is_paged()
    Code (markup):
    Probably is because I'm using is_page for "videos".
    And "vrvideo" is a post type...

    Any idea how to solve this? :)

    Thanks in advance!
     
    Divvy, Mar 21, 2018 IP
  2. Divvy

    Divvy Well-Known Member

    Messages:
    781
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Problem solved with the following code:

    !is_page('videos') && $post==$posts[0] && !is_paged() && !is_singular('vrvideo')
    PHP:
    Thank you anyway :)
     
    Divvy, Mar 22, 2018 IP