SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress: php include in post box?

    Is it possible to place a php include() statement into the Post Box in WP?

    Like: <?php include("whatever.php"); ?>

    So far no luck, and I'm thinking the answer may be no. There's a constant piece of text I'd like to have in each post, but be able to change it if needed w/o having to redo them all.

  2. #2
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need a plug in. By default you cannot execute php code within a post.

    There is a plug in named exec-php. It works very well for me. You can find it at
    http://bluesome.net/post/2005/08/18/50/

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Phidev - thanks so much... that exactly did the trick!


    (I also just made another thread-question about another issue I'm having with WP sticky posts if you wanna take a look at that too )

  4. #4
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No Problem.

  5. #5
    SitePoint Enthusiast seanansari's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the info.I am searching for the same from long back.

  6. #6
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a note:

    If you have multi-user blogs, make sure that you protect your blog. Since allowing to execute php from a post poses a security thread.

    I believe the plug-in allows you to set permission about it. Dont forget to make the appropriate changes.

  7. #7
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The method of imitating sidebar:

    <?php get_sidebar(); ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •