Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-11-2016, 12:30 PM   #1
Smack dat
So Fucking Banned
 
Industry Role:
Join Date: Jul 2016
Posts: 4,613
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?
Smack dat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2016, 01:03 PM   #2
Paul&John
Confirmed User
 
Paul&John's Avatar
 
Industry Role:
Join Date: Aug 2005
Location: YUROP
Posts: 8,606
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
Paul&John is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2016, 01:38 PM   #3
Smack dat
So Fucking Banned
 
Industry Role:
Join Date: Jul 2016
Posts: 4,613
Quote:
Originally Posted by Paul&John View Post
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.
Smack dat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2016, 02:51 PM   #4
Bird
Confirmed User
 
Bird's Avatar
 
Join Date: Jan 2005
Location: Stockton
Posts: 4,365
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
Bird is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2016, 03:04 PM   #5
Smack dat
So Fucking Banned
 
Industry Role:
Join Date: Jul 2016
Posts: 4,613
Quote:
Originally Posted by Bird View Post
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....?
Smack dat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2016, 03:39 PM   #6
shake
frc
 
Industry Role:
Join Date: Jul 2003
Location: Bitcoin wallet
Posts: 4,663
Quote:
Originally Posted by Smack dat View Post
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
shake is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2016, 07:08 AM   #7
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
Quote:
Originally Posted by Bird View Post
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
__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2016, 08:06 AM   #8
HowlingWulf
Confirmed User
 
HowlingWulf's Avatar
 
Join Date: Nov 2001
Posts: 1,662
Quote:
Originally Posted by Paul&John View Post
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
HowlingWulf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2016, 10:55 AM   #9
xxx6live
Confirmed User
 
xxx6live's Avatar
 
Industry Role:
Join Date: Dec 2012
Location: Scandinavia
Posts: 279
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 )): ?>
xxx6live is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2016, 01:23 PM   #10
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,614
Quote:
Originally Posted by Smack dat View Post
And then....?


No and then !
__________________


👁️ 👍️ 💩
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
plugin, simple, question, slider, code, restrict, plugins, php, specific, page-id=2, pages, message, support, completely, wordpress, pretty, version, basically, replaced
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.