Forums

PHP Code Widget
[resolved] secret to includes (2 posts)

  1. timemachines
    Member
    Posted 6 months ago #

    I have tested the PHP widget - and it works with the usual "Hello World" - however, I can never seem to get a simple include code to execute.
    \<?php include 'pagetitles.php'; ?>\

    thoughts?

    http://wordpress.org/extend/plugins/php-code-widget/

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 6 months ago #

    That include isn't specific as to the location of 'pagetitles.php'. When you're running in the widget context, you don't know the relative location of where the executing file is. So use the ABSPATH constant to specify the location of your file relative to the WP Root directory.

Reply

You must log in to post.

About this Plugin

About this Topic