• Greetings WP community. I’m using WP more as a CMS than as a blog — am very happy with the layout and people who contribute to this program. My site will consist of entries that will allow people to read about and download videos that I make. Linking to these videos, as well as showing images from them, is easy. I want to have the option for people to rate the videos too, as well as have a PHP script displaying the number of downloads per video.
    I’ve found (more or less) scripts that do what I want, but the WP parser (?) won’t let me post functional PHP code in an entry. Any ideas on how to bypass this? A plug-in?
    I don’t know PHP, and while recommendations that I ought to learn it are appreciated, I’m thinking more along the lines of tapping those brains which have already achieved this feat. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • mmmm, yeah, this is going to fall into the category of “it doesn’t work like that.” And there is a reason why. PHP is a server side script and needs to be executed. By putting the PHP into a post, it (the website/server) isn’t going to know to execute the code within it. It’s not a WP thing, it’s just the way PHP works.
    TG

    Although my method is horribly outdated, there are several improvements which some have kindly offered availible in the entry’s comments and pingbacks. ??
    I really should get around to updating these…

    Thread Starter paticoflange

    (@paticoflange)

    OK, I can handle that PHP doesn’t work like that. Can you call a PHP script in an entry though? I think that’s what I’m really talking about anyway, not actually executing the whole script.
    Example: a download count script. The script resides elsewhere, I just need to call to it in my post so that the number will display. Is this doable — and how?

    Thread Starter paticoflange

    (@paticoflange)

    By the way — thanks both of you. Stevarino, I followed your link and from your site found mark.scottishclimbs.com’s 1.2 plug-in. We’ll see how it turns out. I had no plans to learn PHP, but I keep getting pulled in deeper…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to allow PHP code in posts?’ is closed to new replies.