• Resolved cptdondo

    (@cptdondo)


    I am using the sharepointlike theme. It has all of the functions in one big index.php file. Now I am trying to use a plugin (both my own and subscribe2) that calls get_header(). From the theme writing docs, division into header.php, footer.php, etc. is optional, yet when I try to call get_header() I get the header from the default WP theme, not sharepointlike….. See http://codex.wordpress.org/Theme_Development under Theme Templates.

    So… A big of digging and in wp-includes/template-functions-general.php I find:

    function get_header() {
    if ( file_exists( TEMPLATEPATH . ‘/header.php’) )
    load_template( TEMPLATEPATH . ‘/header.php’);
    else
    load_template( ABSPATH . ‘wp-content/themes/default/header.php’);
    }

    which would seem to indicate that the division into sub-files for a theme is in fact mandatory if you want the full functionality…..

    So… Where do I start fixing? It would seem that the problem is in the tempalte functions; it should check for index.php as well as the specific header/footer/etc file. But I don’t know what else I might break. Dividing sharepointlike into the subfiles seems like a lot of work that won’t actually fix the problem; the next theme update or change I will have the same problem….

    Thoughts, comments? Am I missing something?

Viewing 1 replies (of 1 total)
  • It’s true that dividing (“slicing up”?) the index.php is optional – except when using plugins that assume you have it divided (which is your case).
    Actually dividing the index into more files (header, index, sidebar, footer) isn’t a big deal and can be done quite easily. I think in your case it will fix the problem!
    Even if there will be an updated version of the theme you will be able to cut the new index file in the same way.
    The easiest way is to “cut” where the big divisions start and end (e.g. <head> <body> <div id=”sidebar”> <div id=”footer”>…) but you can also see a more complicated way here.

Viewing 1 replies (of 1 total)
  • The topic ‘get_header() question’ is closed to new replies.