• 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

add some php to top of certain pages

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 › add some php to top of certain pages

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 9 years, 6 months ago by dev.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 9, 2013 at 7:49 am #61493
    Nomad
    Member

    Hi Guys....i need to add some php at the top of two pages e.g mydomain.com/example and mydomain.com/example-2. the php must be before the page begins as it is a script it needs to "authenticate" before access is granted to the page. Here is an example of what needs to be at the top of the two pages

    <?php
    $index = true;
    require "protect.php";
    ?>

    Would appreciate some help as to what i need to add to the functions.php file and how to ensure it is page specific.....thanks my brain is a bit numb today it seems =)

    September 9, 2013 at 8:22 am #61504
    dev
    Participant

    Try one of these:

    http://wordpress.org/plugins/insert-php/

    http://wordpress.org/plugins/allow-php-in-posts-and-pages/

    http://wordpress.org/plugins/shortcode-exec-php/

    I've not tried any of them, so tell us if one of them works for you.

    Dev
    http://NewMediaWebsiteDesign.com

    September 9, 2013 at 8:29 am #61505
    dev
    Participant

    There are a bunch of plugins that purport to do this for you. Let us know which one you try and how it worked:

    http://tinyurl.com/qx3fvmn

    Dev

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

© 2023 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