• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Build a template or add content with hooks?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: resolved

Tagged: hooks, magazine, template

  • This topic has 1 reply, 1 voice, and was last updated 11 years, 10 months ago by bigbluesquid.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 13, 2013 at 8:17 am #56053
    bigbluesquid
    Member

    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?

    August 13, 2013 at 8:36 am #56066
    bigbluesquid
    Member

    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');
    }
    }

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Build a template or add content with hooks?’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble