• 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 & Genesis Hooks (Output Issues)

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 & Genesis Hooks (Output Issues)

This topic is: not resolved

Tagged: advanced custom fields, AgentPress Listings plugin, genesis hooks, Prose Child Theme

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 1 month ago by Cotton Rohrscheib.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 6, 2014 at 8:58 pm #93795
    Cotton Rohrscheib
    Member

    We started this project w/ Agentpress Listing Plugin w/ the Prose Child Theme and quickly discovered that the client was looking for more than the plugin offered in terms of layout, etc. -- so we implemented the Advanced Custom Fields plugin and have managed to configure the site the way the client wants from an entry standpoint but we have some issues w/ the layout (or output of the data) and I'm just not for sure which hooks we should be using.

    ----- SEARCH RESULTS PAGE (ARCHIVE OR LISTINGS -----

    On the Search Results Page for the Listings, the Client wants to display the Featured Image for the Listing (which we've handled) and also the following advanced custom fields: County, Acres, Price, Type, Agent. We have this working pretty well w/ the exception of the last listing on the page: http://rohrscheib.net/sandbox-014/?s=&post_type=listing&county=&acreage=&property_type=&listing-agent=&state=

    This is the custom code we are using to accomplish this: 
    /** Custom Code for Advanced Custom Fields: Search Results (Archive) */

    add_action( 'genesis_post_content', 'custom_stuff2');
    function custom_stuff2() {
    echo '<b>County:&nbsp;</b>';
    the_field('county');
    echo '<br/>';
    echo '<b>Acres:&nbsp;</b>';
    the_field('acres');
    echo '<br/>';
    echo '<b>Price:&nbsp;$</b>';
    the_field('price');
    echo '.00<br/>';
    echo '<b>Type:&nbsp;</b>';
    the_field('type');
    echo '<br/>';
    echo '<b>Agent:&nbsp;</b>';
    the_field('agent');
    echo '<br/>';
    }

    ----- INDIVIDUAL LISTING PAGE(S) -----

    We also have this page constructed w/ the fields the client wants, including (County, Acres, Price, Type, Agent, -- and we've added Description, Aerial Map, Location Map, and Photos to this page by using the following custom custom code & hook. Here's an example listing page: http://rohrscheib.net/sandbox-014/listings/test-listing-heber-springs-property/

    /** Custom Code for Advanced Custom Fields. Individual Listings. */

    add_action( 'genesis_after_loop', 'custom_stuff');
    function custom_stuff() {
    the_field('description');
    echo '<br/>';
    echo '<b>Aerial Map:&nbsp;</b>';
    the_field('aerial_map');
    echo '<br/>';
    echo '<b>Location Map:&nbsp;</b>';
    the_field('location_map');
    echo '<br/>';
    echo '<br/>';
    the_field('photos');
    }

    ----- SUMMARY / QUESTIONS -----

    As you can tell from both examples I've sent over, I've picked either the wrong "hook" or something and it's not giving me what we are looking for.  Also, if you will notice on the homepage of the website: http://rohrscheib.net/sandbox-014/ --you will notice that the custom fields are also showing up at the bottom of the page even though the "home page" isn't a listing. 

    Does anyone have any suggestions? This is sort of new to me, thanks for your help in advance,


    Cotton Rohrscheib
    http://cottonrohrscheib.com

    http://rohrscheib.net/sandbox-014/ 
    March 6, 2014 at 9:30 pm #93804
    coralseait
    Member

    Hello,

    On your first question, it appears that something is happening outside of the loop or different on that listing. What if you delete it and re-add, is it the same? What are you doing, if anything to the query args? Edit, thinking on it may be related to second question below because of the action hook firing with query populated. Not sure.

    On your second question, because you've hooked into genesis_after_loop the action fires after the genesis loop anywhere it is used (which is every template page in most themes) so that def isn't the desired behaviour for your goals. Have a look here for a better hook http://my.studiopress.com/docs/hook-reference/

    You may want to look into a custom genesis loop instead of adding an action after the loop standard genesis loop if you can't find something that better suits your needs. You may also want to look into WP Query if you need to completely customize your query args and write your own front end.


    Coral Sea IT

    March 7, 2014 at 11:38 am #93846
    Cotton Rohrscheib
    Member

    Thanks so much for your response, I'm going to get w/ another one of our developers and pick his brain on this too --and definitely will try to get my head around custom genesis loops and wp query as well. I might have more questions once I get further a long into the process, thanks for taking the time to offer up some suggestions!!


    Cotton Rohrscheib
    http://cottonrohrscheib.com

  • 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

© 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