WordPress.org

Support

Support » Plugins and Hacks » [Plugin: The Events Calendar] Code suggestion for including templates

[Plugin: The Events Calendar] Code suggestion for including templates

  • Hello,

    In the-events-calendar.php, may I suggest that templates are loaded using the wordpress functions, as this will support child themes fully.

    The current code is:

    if (file_exists(TEMPLATEPATH.'') ) {
    	include (TEMPLATEPATH.'/events/list.php');
    }
    else {
    	include dirname( __FILE__ ) . '/views/list.php';
    }

    where as the wordpress method is:

    $templates[] = "/events/single.php";
    
    if ('' == locate_template($templates, true)) {
    	load_template( dirname( __FILE__ ) . '/views/single.php');
    }

    I’d also suggest using get_header() and get_footer() in the template files for much the same reason.

    Cheers,
    Pete Wilson

Viewing 5 replies - 1 through 5 (of 5 total)
  • +1 On this, thanks for posting it Pete. I was just about to post something very similar, but this could go back to my Thematic integration request elsewhere in this forum, noting that the calendar files don’t get read out of the child theme, but out of the parent framework directory.

    Fair enough. Let me check into it and get back to you. I’ve added a ticket to 1.6.

    @shane.pearlman Thanks for the quick response, greatly appreciated.

    @wlanni Missed it by that much, chief.

    Hey Pete-

    Thank you very much for your post–I’m a first-time WP designer who’s been struggling with exactly this issue while working with an iThemes Flexx child theme. Just looks like the plug in is going out to the parent theme for header and footer stuff rather than finding the edited files in the child theme. I’d like to try your suggestion above but noticed your reference to using get_header() and get_footer() and realized I was out of my depth.

    Is the code highlighted above sufficient to solve this problem on its own, or are there other changes I’d need to make elsewhere (like the get_header() and get_footer() references) for this fix to work?

    Apologies in advance for the layman’s questions…

    Thanks!
    Karl

    @kkropp

    Sorry for the delayed response, I’ve started a new topic in Themes and Templates and replied in there.

    Pete

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: The Events Calendar] Code suggestion for including templates’ is closed to new replies.
Skip to toolbar