• Resolved scottlowe

    (@scottlowe)


    I am using WW 2.2.1.

    The statement <?php require(TEMPLATEPATH . ‘/includes/filename.php’);?> no longer works in Advanced Parsing. When I save the edit window completely empties. I have to Update to get the widget window back, and it is empty. I tried INCLUDE rather than REQUIRE and the widget saves but does not function. Eventually, after several updates, the INCLUDE options blanks out too.

    The last WW that worked (as far as I know) is 2.1.3.

    https://wordpress.org/plugins/widget-wrangler/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter scottlowe

    (@scottlowe)

    HOOOLY *BEEEEEEEPP!!* I just figured it out. I was working on a completely different project, without Widget Wrangler, and had the same issue. It’s the “TEMPLATEPATH.” statement. All I did was replace that with the absolute path (including HTTP) and it was fine.

    I guess that makes it “not your problem” but I hope you can take the time to check it out. It’s a real pain to clean up.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Glad to hear it! Sorry for the slow reply, busy times over here.

    Not exactly sure what the issue was, but in general I rely much more on these two functions than on constants: get_template_directory() and get_stylesheet_directory(). The latter function is most reliable if you’re possibly dealing with child themes.

    Thread Starter scottlowe

    (@scottlowe)

    Thanks Jonathan. Again, the absolute path works however, this did not:

    <?php include(get_template_directory() . ‘/includes/filename.php’);?>

    Did I mess up on the syntax?

    Also, this particular test was in a child theme. The original issue (when I started this thread) while using TEMPLATEPATH occurred when using any theme, including default wordpress themes.

    Thread Starter scottlowe

    (@scottlowe)

    LOL!!! OMG!!!! I just used get_stylesheet_directory() as you suggested and it worked. So sorry to bother you over nothing… actually, I take it back… you helped a great deal.

    PS: I LOVE the way wwidgets are added to a page now. Great job.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP require statement not working in Advanced Parcing’ is closed to new replies.