• 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

Including php file in template file

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 › Including php file in template file

This topic is: resolved

Tagged: file, get, include, page, php, template

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 3 months ago by David Chu.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 28, 2014 at 9:20 pm #116182
    Teo100
    Member

    Hi,

    I have a custom form that I have saved in the Genesis child theme folder (myform.php)
    Now I would like to show that form at the end of my custom page template.

    So what I did is I am tried to call that form file directly on my page template file:

    add_action( 'genesis_entry_content', 'contact_form_lp', 12 );
    function contact_form_lp() { 
                get_template_part('myform');
    	}
    

    That is not working and I am wondering what would be the right way to call that myform.php file?
    Or should I try to include the contact form code directly into my template file?

    Thx in advance

    July 29, 2014 at 8:11 am #116209
    David Chu
    Participant

    Hi,
    Your plan looks just right to me! This is very standard WordPress procedure, and a good idea so that you have clean template files.

    I have a couple of ideas. Your page template will need this command at the bottom to allow genesis functions:

    genesis();

    And you don't want that command in your myform.php, or you'll have problems. ๐Ÿ™‚ If those are OK, my last idea - try running it without the priority and see what you get.

    Cheers, Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and 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