is_home() || is_front_page() – false positives?

Home Forums Calendar Products Events Calendar PRO is_home() || is_front_page() – false positives?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #54385
    Sindy
    Participant

    Hey there,

    Woothemes is using the following code to only display a featured slider on my front page. This featured slider is now also displaying on my events front page since the upgrade. Is this intended or a bug? I’ve tested modifying the code to only crosscheck “is_home” or “is_front_page” – it still displays the slider each time.

    // Featured Slider
    if ( ( is_front_page() ) && ( $paged == 1 ) && isset( $woo_options[‘woo_featured’] ) && $woo_options[‘woo_featured’] == ‘true’ )
    get_template_part ( ‘includes/featured’ );

    #54772
    Jonah
    Participant

    Hi Marco,

    This is not intended but not really a bug either. It’s something you or WooThemes will need to modify in order to add an additional check for the events page(s) to prevent the slider form showing. You can use the following conditional to check for the various event related pages: https://gist.github.com/jo-snips/2415009

    I hope that helps but let me know if you have any other questions.

    – Jonah

    #55543
    Sindy
    Participant

    Hi Jonah,

    Ultimately I could not get any of those conditional checks to work for me and went with the solution of checking that ‘events’ wasn’t in the URL by adding the following: (strpos($_SERVER[‘REQUEST_URI’],’events’) === FALSE)

    if ( ( is_home() ) && ( is_front_page() ) && (strpos($_SERVER[‘REQUEST_URI’],’events’) === FALSE) && ( $paged == 1 ) && isset( $woo_options[‘woo_featured’] ) && $woo_options[‘woo_featured’] == ‘true’ )
    get_template_part ( ‘includes/featured’ );

    Thanks!
    Marco

    #55886
    Jonah
    Participant

    Hi Marco,

    Not sure why my code wouldn’t work for you but I’m glad you came up with a solution! Let us know if you need help with anything else.

    Thanks,
    Jonah

    #979652
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘is_home() || is_front_page() – false positives?’ is closed to new replies.