WordPress.org

Forums

[resolved] Shortcode to include an external file (3 posts)

  1. pshero
    Member
    Posted 4 years ago #

    Hey Gang, I'm hoping one of the WP Guru's out there can give me a little hand. I've got a php file I'd like to include when a shortcode is called in a page/post. This php file is basically an FAQ that I'd like to be able to call at will inside a page/post. I've tried this: http://www.amberpanther.com/knowledge-base/using-the-wordpress-shortcode-api-to-include-an-external-file-in-the-post-content/ but it didn't work for me, can anyone make a suggestion as to how to do this?

    Basically I want to say [faq] and have it include the faq.php (or faq.txt or html if that's easier. I won't be using php functionality at all).

    I'm not the strongest coder, so a full shortcode function would be GREATLY appreciated.

    Thanks in advance!

  2. pshero
    Member
    Posted 4 years ago #

    Nobody? Ok, so I spent a few more frustrated hours searching dozens of pages of Google results to finally stumble upon this gem, which totally worked for me:

    http://www.dougdaulton.com/2009/08/01/wordpress-shortcode-for-file-inclusion/

    Hopefully all my searching can help somebody else.

  3. doug.daulton
    Member
    Posted 4 years ago #

    Glad you found that useful!

Topic Closed

This topic has been closed to new replies.

About this Topic