Displaying AgentPress Listings property details (custom fields) in template

Community Forums Forums Design Tips and Tricks Displaying AgentPress Listings property details (custom fields) in template

This topic is: not resolved

This topic contains 4 replies, has 4 voices, and was last updated by  carachristenson 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #24818


    Instead of using the [property_details] shortcode, I would like to place the property details directly into my template so that they display on each listing automatically. I thought this would be simple (they’re just custom fields!) but I’ve had a pretty hard time with it so far. I can’t even seem to find a Genesis hook that successfully places a new function inside the loop—including the ones I think are supposed to. And I’m not sure I can access the custom fields if I’m not inside the loop.

     Has anyone done this before?



    No but you can customize the details which isn’t that difficult and i have done this before.

    Whats the reason you don’t want to use the shortcodes?



    @cushtina You can look into Custom Meta Boxes if you want something a little more automated.

    You may be able to modify the core AgentPress files using CMB as a guide (which isn’t recommended by the devs, btw) as I’ve been doing.



    Thanks. I ended up hardcoding the specific names of the custom fields into functions.php. I would’ve liked to create a loop to run through them and echo whatever’s in there to save a step in case we end up adding or removing anything, but sometimes you can’t have it all, and it’s a relatively small issue.



    This probably isn’t helpful after 2 years, but I was just wanting to accomplish the same thing and thought I’d share my work-around with you.

    I didn’t want my client to have to enter the shortcode every time, because anything too technical scares him. :)

    I use Genesis Extender, and I added a hook box into genesis_entry_content with this:
    <?php echo do_shortcode( ‘[property_details]’ ); ?>

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.