WordPress.org

Ready to get started?Download WordPress

Forums

How To Make A PHP Include Function Within A Post (4 posts)

  1. Farwalker
    Member
    Posted 2 years ago #

    Thanks in advance for any guidance.

    Goal:
    Add a simple php include in a post and have it actually work.

    Issue:
    I used to use simple php includes in custom websites, but when I put php include code in a post, it nullifies the php code.

    Is there a proper way to add php include code in a WP post or should one use a PHP include plugin to get the job done? ( I know there's a few out there, but wanted to make sure that was the route to go before implementing a plugin)

    Thanks for your guidance!

  2. security_man
    Member
    Posted 2 years ago #

    plugin is the way i have done that in the past... unless you can hard code it into the template then thats the way to do it imho

  3. Farwalker
    Member
    Posted 2 years ago #

    Thanks for the reply Security Man - might end up doing that. Anyone else have any thoughts on the question? Thanks.

  4. Jerry
    Member
    Posted 2 years ago #

    I say just use shortcodes. http://codex.wordpress.org/Shortcode_API

    It's way more simple and all you have to do is edit your theme's functions file and add say one line to it. Then you use your function when you need too.

Topic Closed

This topic has been closed to new replies.

About this Topic