• 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

Page With Scripting, Best Practice?

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 › Page With Scripting, Best Practice?

This topic is: resolved
  • This topic has 8 replies, 3 voices, and was last updated 11 years, 4 months ago by bionary.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • May 11, 2014 at 6:37 pm #104568
    bionary
    Member

    I've been a web developer for a long time but always custom coded everything. This is my first attempt at wordpress and I just bought the beautiful theme.

    What is the best practice for handling custom scripting (php) on a single page? For example... where do i place scripts? Do I need to make a page template? If so how? When I look at the existing templates all I see is:
    genesis();

    I'm trying to create a page like : http://mygroovysite/video/xyz123abc

    What I'm trying to make happen is the page template "video" is loaded and then a youtube video with id "xyz123abc" plays.

    I've done this numerous times before on my own custom sites so scripting is not the problem, it's understanding the best practices in the world of wordpress that I need help with.

    I know somebody is going to post a link to some youtube plugin but to be honest I'm yet to see a plugin do precisely what I'd like it to.

    May 11, 2014 at 6:58 pm #104573
    Brad Dalton
    Participant

    If you're referring to PHP, you have 2 choices.

    1. Add the code directly to a template file

    2. Add a conditional tag after the function in your child themes functions file.


    Tutorials for StudioPress Themes.

    May 11, 2014 at 7:41 pm #104580
    bionary
    Member

    add this to my child theme? I'm using "beautiful".
    will this break updates?

    1. when i open page.php template all i see is: genesis(); not sure how to add php here? wouldn't the scripts results get added after or before the page and not inside the page?

    2. can you provide an example please? not sure what "the function" means.

    (I'm brand new to wp )
    Thanks

    May 11, 2014 at 8:55 pm #104595
    Brad Dalton
    Participant

    Link to your site please.


    Tutorials for StudioPress Themes.

    May 11, 2014 at 8:55 pm #104596
    Brad Dalton
    Participant

    Link to your site please.


    Tutorials for StudioPress Themes.

    May 12, 2014 at 8:02 am #104646
    bionary
    Member

    I'm afraid it's a local instance. I'm just getting the feel for wordpress and genesis locally before I dare port it live.

    May 12, 2014 at 10:47 pm #104852
    essaysnark
    Participant

    @bionary, what is the behavior that you want, exactly?

    In WordPress, you can just put the URL to a YouTube video directly in a post or page (using the text editor) and it'll load the player right there, with no iframe or special coding required. It won't start playing the video automatically when the page is loaded though. Is that what you are trying to do?

    May 12, 2014 at 10:52 pm #104853
    essaysnark
    Participant

    Also to answer your original question: You can insert custom PHP code in any template file - before the genesis() function - here's a simple tutorial that shows how (which happens to load some videos too):

    http://www.carriedils.com/custom-page-template-genesis/

    May 17, 2014 at 5:44 pm #105667
    bionary
    Member

    ah, ok thanks.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 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