How to add php script on wordpress page/post?

Th3T3chGuy

Senior Member
Joined
Jun 1, 2011
Messages
888
Reaction score
653
Hi, I just created a wordpress blog and I installed a random theme. I saw a php script from http://codecanyon.net that interested me. Is there anyway to make the php script run on that wordpress page only?

Thanks
 
Yes . there are few plugin in wordpress which runs php .just goto 'install new plugin' and search for php. i dont remember the plugin name at the moment.
I did this when i want to show the user's Ip address and the referral URL in the sidebar of my website.
 
Yes, of course:

PHP:
if (is_page( 'page-slug-of-your-page' )) {
//your script
}
else {
//normal page
}

or

PHP:
if (is_page( ID OF THE PAGE )) {
//your script
}
else {
//normal page
}
 
Ok thanks for the answers. But the script requires an index.php file and other files to be in my server.. I didn't actually get a php code.
 
Back
Top