• xhost

    (@xhost)


    Hi, I’m trying to include a php file from the theme directory like this:

    [php]include_once "/wp-content/themes/mytheme/popular-this-week.php";[/php]

    But it does not output anything?
    If I include the content of the file directly in the post it’s working fine.

    Any idéas?

    Thanks 🙂

    https://wordpress.org/plugins/ezphp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Tracy

    (@ridgey28)

    Did you try it outside of WYSIWYG (Visual) mode?

    I did the following in the Text Mode and got it working

    Please also note that there is no / in front of wp-content

    <?php include “wp-content/themes/mytheme/popular-this-week.php”; ?>

    Thread Starter xhost

    (@xhost)

    Hi ridgey28

    Thanks yes I tried in text-mode. Will give your suggestion a try though

    //tomas

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Include a php file?’ is closed to new replies.