Simple <php> question / Wordpress

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Smack dat
    So Fucking Banned
    • Jul 2016
    • 4613

    #1

    Simple <php> question / Wordpress

    Pretty sure this is simple to do but sent a message to the plugin support and they completely ignored my question and replaced it with their own made up version.

    Basically I have a slider plugin (Slider WD) and I was given some PHP code:

    Code:
    <?php wd_slider(1); ?>
    All I want to do is restrict the plugins use on specific pages like page-ID=2 or something.

    How would I do this please?
  • Paul&John
    Confirmed User
    • Aug 2005
    • 8643

    #2
    Looks like you need is_page().. havent tested this, found at stackoverflow:

    Code:
    <?php if(is_page( 5 ): ?>
        <p>This is some text</p>
    <?php endif; ?>
    Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
    Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

    Comment

    • Smack dat
      So Fucking Banned
      • Jul 2016
      • 4613

      #3
      Originally posted by Paul&John
      Looks like you need is_page().. havent tested this, found at stackoverflow:

      Code:
      <?php if(is_page( 5 ): ?>
          <p>This is some text</p>
      <?php endif; ?>
      Cheers, I will try it.

      Comment

      • Bird
        Confirmed User
        • Jan 2005
        • 4365

        #4
        Can't you just copy the pages template and rename it and upload it to the same template folder then select it in your edit pages post on the right side under page attributes select template.
        ICQ:268731675

        Comment

        • Smack dat
          So Fucking Banned
          • Jul 2016
          • 4613

          #5
          Originally posted by Bird
          Can't you just copy the pages template and rename it and upload it to the same template folder then select it in your edit pages post on the right side under page attributes select template.
          And then....?

          Comment

          • shake
            frc
            • Jul 2003
            • 4663

            #6
            Originally posted by Smack dat
            And then....?
            Then that file will become the template custom for that url / page.
            Crazy fast VPS for $10 a month. Try with $20 free credit

            Comment

            • potter
              Confirmed User
              • Dec 2004
              • 6559

              #7
              Originally posted by Bird
              Can't you just copy the pages template and rename it and upload it to the same template folder then select it in your edit pages post on the right side under page attributes select template.
              So duplicate (potentially) hundreds of lines of PHP into a new template file to write one line of custom code for the page? Smaaart

              Comment

              • HowlingWulf
                Confirmed User
                • Nov 2001
                • 1662

                #8
                Originally posted by Paul&John
                Looks like you need is_page().. havent tested this, found at stackoverflow:

                Code:
                <?php if(is_page( 5 ): ?>
                    <p>This is some text</p>
                <?php endif; ?>
                This is the correct answer.

                https://developer.wordpress.org/refe...tions/is_page/
                WP Porn directory/review theme Maddos $35.

                webmaster AT howling-wulf.com

                Comment

                • xxx6live
                  Confirmed User
                  • Dec 2012
                  • 279

                  #9
                  And if you get an error now, I think there must be TWO parentheses before the first colon. Looks like you are not a coder, just trying to help.

                  Code:
                  <?php if(is_page( 5 )): ?>

                  Comment

                  • CurrentlySober
                    Too lazy to wipe my ass
                    • Aug 2002
                    • 38941

                    #10
                    Originally posted by Smack dat
                    And then....?


                    No and then !


                    👁️ 👍️ 💩

                    Comment

                    Working...