Build a template or add content with hooks?

Community Forums Forums General Discussion Build a template or add content with hooks?

This topic is: resolved

This topic contains 1 reply, has 1 voice, and was last updated by  bigbluesquid 1 year, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #56053

    bigbluesquid
    Participant
    Post count: 2

    I have seven templates from a previous WP theme and I’ve tried unsuccessfully to integrate them with the Magazine theme.
    Before I try any further I have looked at using Hooks, simply because the content within the template should appear after the page content. The template content is a PHP search program and therefore has no effect on the styling or layout of the pages, it should simply be a function after the page content.

    I tried adding the following to the functions.php page with no success (the template code loads but nothing else appears):

    /** MIKES TEMPLATES */
    add_action( 'genesis_after_content', 'include_template_findavenue' );
    function include_template_findavenue() {
    require(CHILD_DIR.'/template_find_a_venue.php');

    Should I go back and try integrating the code as a template or continue to figure out how to make it work with hooks?

    #56066

    bigbluesquid
    Participant
    Post count: 2

    Just discovered this for defining actions to operate only on specific pages which works perfectly:

    /** MIKES TEMPLATES */
    add_action( ‘genesis_after_content’, ‘include_template_findavenue’ );
    function include_template_findavenue() {
    if ( is_page( ‘eating-out’ ) ) {
    require(CHILD_DIR.’/template_find_a_venue.php’);
    }
    }

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Build a template or add content with hooks?’ is closed to new replies.