Grow your CSS skills. Land your dream job.

Incuding a .php on every page without include()

  • # March 24, 2011 at 12:49 pm

    I want to include a file on every page. I’ve come across this htaccess trick:

    php_value auto_prepend_file /usr/www/users/website/includes/functions.php

    To my delight, it works perfectly. I would just like to know what the standard practice is. How does wordpress achieve this?

    Bob
    # March 24, 2011 at 1:42 pm

    Doesn’t WordPress uses things like get_footer() to include the footer on every page? Don’t know if thats exactly what you’re looking for though.

    # March 24, 2011 at 2:13 pm

    I’m not using WordPress. I asked if anyone knows hoe WordPress achieves this.

    # March 24, 2011 at 2:45 pm

    It’s loaded in the wp-settings.php file.

    // Load the functions for the active theme, for both parent and child theme if applicable.
    if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
    include( STYLESHEETPATH . '/functions.php' );
    if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
    include( TEMPLATEPATH . '/functions.php' );
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".