• 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

Advanced Custom Fields and Genesis

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 › Design Tips and Tricks › Advanced Custom Fields and Genesis

This topic is: resolved

Tagged: ACF, Custom fields

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by sminker.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 28, 2016 at 9:56 am #190382
    sminker
    Member

    Hello Sally,

    We got your help request! One of our agents will respond to you as soon as possible.

    Thanks!

    Sally Minker sent a message
    Jul 29, 1:15am
    I am trying to use ACF on a website i am developing using a Genesis theme and News Pro. I got the field to display by adding this code to the functions.php

    // Display Advanced Custom Fields
    add_action( 'genesis_entry_content', 'ccs_stationery' );
    function ccs_stationery() {
    if ( is_singular( 'post') ) {
    $cf = get_post_meta( get_the_ID(), 'ccs_letter', true );
    if( ! empty( $cf ) ) {
    echo '<div class="letter">'. $cf .'</div>';
        }
      }
    }

    The problem is that the content in the ccs_letter field is just displaying as a single run-on paragraph. when I inspect the html, there are no paragraph returns in the text, although when I display the html in the text editor, the <p> tags are there, but they are translating as line breaks when you look at the the html in the page inspector, not keeping their code.

    I turned off all the other plugins and that didn't change anything, so it is not a plugin conflict.

    The password for the site is happyday

    http://sallyminker.com/ccs-redesign/2016/03/trial-for-moroccan-professor-scheduled-for-march-23/
    July 29, 2016 at 6:42 am #190429
    Brad Dalton
    Participant

    Please link to a live site.

    You can add p tags to the code so all the cf content is wrapped in p tags like this.

    echo '<p class="letter">'. $cf .'</p>';

    Tutorials for StudioPress Themes.

    July 29, 2016 at 9:36 am #190444
    sminker
    Member

    Actually, I just solved my problem with help from code on Kevin Shoffner's website and information on the ACF website. Here is how I solved it:

    add_action( 'genesis_entry_content', 'ccs_stationery' );
    function ccs_stationery() {
    if ( is_single() && get_field('ccs_letter') )
    echo '<div class="letter">'. get_field('ccs_letter') .'</div>';
    }

    get_post_meta only brings in the text from the wysiwyg editor, but not the html. You have to use get_field or the_field to get the html, which is what I needed.

    thanks for your response, @braddalton

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ 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