Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 08-31-2009, 08:43 AM   #1
HyperActive Warrior
War Room Member
 
warfore's Avatar
 
Join Date: Jun 2009
Location: Maryland USA
Posts: 261
Thanks: 124
Thanked 18 Times in 17 Posts
Default Running php on WP posts and pages

I have a snippet of php code that I would like to run on a WP blog page to establish a links page. Is there an easier way to do this. I have tried to use a couple of run php plugins but one blew up my site and another is so outdated that it is not compatible with WP 2.8. Any ideas?

Regards,

Tony
warfore is offline   Reply With Quote
Old 08-31-2009, 09:44 AM   #2
Senior Warrior Member
War Room Member
 
Steve Diamond's Avatar
 
Join Date: Apr 2006
Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Steve Diamond
Default Re: Running php on WP posts and pages

Hi, Tony. I've done exactly that on several WP sites using Exec-PHP. Have you tried that one? I don't think I'm at the current WP version on any of those sites, though, so it may not work well. Also, if you look at some of the recent comments at the bottom of the page I linked to, you'll see that there seem to be some problems with the latest Exec-PHP release.

The other thought I have, which I haven't tried, is to create a new template in your WP theme. Simply copy your page.php to another filename (e.g. linkpage.php) and insert the link page PHP code at an appropriate spot (inside the loop) in that file. Then assign that template to the links page when you create/edit it.

That ought to work fine, but, as I said, I haven't tried it.

HTH.

Steve

Executive I.T. consulting for small/medium business
Website development | PHP - MySQL - JavaScript expert programming
Software requirements analysis | Specification writing
Project management | Vendor relationship management
Steve Diamond is offline   Reply With Quote
Old 08-31-2009, 09:59 AM   #3
HyperActive Warrior
War Room Member
 
warfore's Avatar
 
Join Date: Jun 2009
Location: Maryland USA
Posts: 261
Thanks: 124
Thanked 18 Times in 17 Posts
Default Re: Running php on WP posts and pages

ExecPhp is the plug in that caused me to have to reinstall my site (it caused the all WP admin links to want to open up in notepad) which was not fun. This did happen on WP 2.82.

The template idea sounds like a good one so I will try that. Thanks for the info.

Regards,

Tony
warfore is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
pages, php, posts, running

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 05:43 PM.