• 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

[Help] Output the listing ID at properties field for Agentpress pro theme

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 › [Help] Output the listing ID at properties field for Agentpress pro theme

This topic is: resolved

Tagged: Agentpress Pro

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 6 months ago by victor1972.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • June 6, 2017 at 6:04 am #207384
    victor1972
    Participant

    Hello,

    I would like to output the listing ID and display it at listing property details, such as:

    Post ID: 456

    The code below output the listing ID when I place the short code [thepostid] in the listing post content. But I want to show it at property details column

    //[thepostid]
    function thepostid_func( $atts ){
             global $post;
             return $post->ID;   
    }
    add_shortcode( 'thepostid', 'thepostid_func' );

    Please teach me, how to show the shortcode [thepostid] for custom listing field.

    Thanks

    June 6, 2017 at 3:11 pm #207400
    Victor Font
    Moderator

    You probably don't need the shortcode. You could call thepostid_func() directly in the loop and echo the results.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    June 6, 2017 at 3:32 pm #207402
    victor1972
    Participant
    
     $details['col1'] = array( 
            __( 'Post ID:', 'agentpress' )   => 'thepostid_func',
            __( 'Price:', 'agentpress' )   => '_listing_price', 
            __( 'Address:', 'agentpress' ) => '_listing_address', 
            __( 'City:', 'agentpress' )    => '_listing_city', 
            __( 'State:', 'agentpress' )   => '_listing_state', 
            __( 'ZIP:', 'agentpress' )     => '_listing_zip',
        );
        $details['col2'] = array( 
            __( 'MLS #:', 'agentpress' )       => '_listing_mls', 
            __( 'Square Feet:', 'agentpress' ) => '_listing_sqft', 
            __( 'Bedrooms:', 'agentpress' )    => '_listing_bedrooms', 
            __( 'Bathrooms:', 'agentpress' )   => '_listing_bathrooms', 
            __( 'Basement:', 'agentpress' )    => '_listing_basement',
        );
    
        return $details;
    
    }
    

    So the code should look like above? Sorry I am not a PHP programmer

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