WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. timemachines
    Member
    Posted 1 year 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 1 year 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic