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

  1. pshero
    Posted 5 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
    Posted 5 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:


    Hopefully all my searching can help somebody else.

  3. Doug
    Posted 5 years ago #

    Glad you found that useful!

Topic Closed

This topic has been closed to new replies.

About this Topic