• 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

Function has me stumped

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 › Function has me stumped

This topic is: resolved

Tagged: functions

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 3 months ago by emasai.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 20, 2014 at 12:52 pm #91451
    emasai
    Participant

    How would I write the following to put it in the functions file and not in the hooks, presently it is on the genesis_before_loop hook

    <?php if (is_page (array (30,32,34,36,38,40,42,44,46,48,50))) { ?>
      <h1>(CRSC)</h1>
    			<h2>(Rehabilitation Center for Children with Cerebral Palsy</h2>
    	<?php }?>

    I am experiencing an early onset of brain freeze....


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    February 20, 2014 at 1:15 pm #91453
    Summer
    Member

    Try something like

    add_action ('genesis_before_loop', 'child_before_loop');
    function child_before_loop() {
       if (is_page (array (30,32,34,36,38,40,42,44,46,48,50))) {
          echo "<h1>(CRSC)</h1>";
          echo "<h2>(Rehabilitation Center for Children with Cerebral Palsy</h2>";
       }
    }
    

    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

    February 20, 2014 at 1:27 pm #91457
    emasai
    Participant

    Thanks Summer, you are my saviour...!


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Function has me stumped’ 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

© 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