Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I have a piece of code for displaying a slider on the homepage, that is working well.
    Code:
    <?php if(get_option("PPT_slider") =="s1"  && is_home() && !isset($_GET['s']) && !isset($_GET['search-class']) ){ echo $PPTDesign->SLIDER(); } ?>
    I want to display a second slider on every page except the homepage, and I can't figure out how to write the code so that this happens.

    I have tried this
    Code:
    <?php if(get_option("PPT_slider2") =="s1"  !! is_home() && !isset($_GET['s']) && !isset($_GET['search-class']) ){ echo $PPTDesign->SLIDER2(); } ?>
    but it's not working.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    I'm still teaching myself PHP... but I've done this kind of thing literally thousands of times in ASP.

    and with WP, I guess it depends on your permalink settings... if you're not using permalinks, you could look for the page variable in server variable of the url...( http://www.example.com?page=5V)

    if you are using permalinks and htaccess to re-write the users url...

    then you could just look for the full url of the homepage ( http://www.example.com), and set your variable on the slider appropriately. ( actually, since you're only looking to add a different slider from the home page, that's probably easiest ).

  4. #3
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    PHP Code:
     
    <?php 
    if(is_home()){
        if(
    get_option("PPT_slider") =="s1" && !isset($_GET['s']) && !isset($_GET['search-class']) ){ 
        echo 
    $PPTDesign->SLIDER();
        }
    }
    else{
        if(
    get_option("PPT_slider2") =="s1" && !isset($_GET['s']) && !isset($_GET['search-class']) ){
        echo 
    $PPTDesign->SLIDER2();
        }
    }
    ?>


  5. #4
    WDF Staff m3n0tu18's Avatar
    Join Date
    Jul 2011
    Location
    Devon, UK
    Posts
    1,473
    Member #
    28473
    Liked
    265 times
    Are you not meant to change =="s1" to =="s2" on the second slider?
    If you like my comments to your thread please click the LIKE button

    Check out my portfolio: Here!
    View my company Facebook Page
    View my company Website

    <<Plrease ignoer my typo's I have isdexlyia>>

  6. #5
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    I was also not sure what "s1" represents .. or if there is an "s2" or not.


  7. #6
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Yeah, me neither - I think it represents "slider1" but I'm not sure. I'll post an answer when/if I find one - thanks guys!
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com