• 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

Using ACF fields in page.php

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 › Using ACF fields in page.php

This topic is: resolved

Tagged: ACF, page.php, single page. custom fields

  • This topic has 4 replies, 2 voices, and was last updated 8 years ago by thisisarp.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 4, 2018 at 6:08 pm #215100
    thisisarp
    Member

    I'd like to add ACF fields to the default page.php. I don't want to create a custom page template; I just want some additional fields on all pages.

    I've seen a few tutorials online on adding ACF fields but all used custom page templates. Trying this code in page.php (copied from /genesis to child theme) and placing it before genesis(); did not work:

    add_action( 'genesis_after_entry', 'pagebottom' );
    function pagebottom() {
    	if( get_field('page_bottom_content') ) { ?>
    		<section class="page_bottom_content">
    			<div class="wrap">
    				<?php echo get_field('page_bottom_content'); ?>
    			</div>
    		</section>
    	<?php }
    }

    Based on the tuts I've seen that should work - except it doesn't. Is there something else I need to do in order to customize page.php?

    January 4, 2018 at 8:05 pm #215104
    Brad Dalton
    Participant

    You need to add a conditional tag.

    Try this code example as a guide and change the conditional tag to is_singular('page'))

    You'll also need to make sure you use the correct hook.


    Tutorials for StudioPress Themes.

    January 5, 2018 at 9:53 am #215115
    thisisarp
    Member

    Thanks Brad - that got me on the right track. What does the '12' in the add_action line signify?

    January 5, 2018 at 5:40 pm #215125
    Brad Dalton
    Participant

    3rd parameter $priority

    (Optional) Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.

    Default value: 10


    Tutorials for StudioPress Themes.

    January 6, 2018 at 11:29 am #215149
    thisisarp
    Member

    Good to know, thanks so much for explaining 🙂

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Using ACF fields in page.php’ 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

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