WordPress.org

Ready to get started?Download WordPress

Forums

Global variables for use in the sidebar? (3 posts)

  1. garbonzo
    Member
    Posted 6 years ago #

    Wondering how to get my dynamic sidebars to be able to access my global variables?
    I would love for a widget to be able to use a global variable that I declare in header.php

    Thanks

  2. Michael Fields
    Themer
    Posted 6 years ago #

    Thy using the following in your theme pages instead of:

    get_header();
    get_sidebar();
    get_footer();

    use:

    include (TEMPLATEPATH . "/header.php");
    include (TEMPLATEPATH . "/sidebar.php");
    include (TEMPLATEPATH . "/footer.php");
  3. gimperdaniel
    Member
    Posted 6 years ago #

    I didn't ask the original question, but that works. Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic