• Resolved avil

    (@avil)


    Hi

    This is a very nice theme, I’m currently testing in my localhost and plan to setup on my site very soon.

    I have some custom php files which I include in my current theme using the following code, but I’m unable to figure out where to include in this theme.

    include(TEMPLATEPATH . '/filename.php');

    I tried adding adding it to the end of footer.php but it does not seem to be working.

    Kindly suggest how to include custom file and where to place the code for footer specific codes like analytic/tracking/etc.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author heatmap

    (@stuartwider)

    If your custom php file needs to be executed in the footer the you could place it render.php around here…

    print '<!-- wp_footer() -->' . HMTA_NL;
    wp_footer();
    print '<!-- End of wp_footer() -->' . HMTA_NL;
    Thread Starter avil

    (@avil)

    Thanks a lot that worked.

    How about the sidebars if I want to place custom code or call a php function of a plugin ?

    Theme Author heatmap

    (@stuartwider)

    same principle applies.
    Just add your call whereever you need it in render.php.
    Look closely and you should be able to see what goes where – including the div structure for the sidebars.

    Alternatively if you know how to use hooks you can just hook your functions into the theme templates wherever you like.

    just take a close look at the theme templates and it should be fairly clear what to do.

    In this theme, the templates attach functions to the hooks in render.php, then render.php runs last and executes all the functions you hooked in the templates.

    If you are not familiar with hooks just look up add_action() in the wordpress codex. That should make it clearer how it works.

    Thread Starter avil

    (@avil)

    Thanks Stuart, understood ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding custom PHP code and tracking codes in footer ?’ is closed to new replies.