• 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

Removing comma on AgentPress Featured Listing Widget

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 › Removing comma on AgentPress Featured Listing Widget

This topic is: not resolved

Tagged: Agentpress, customize featured listing, featured listing widget

  • This topic has 4 replies, 3 voices, and was last updated 13 years, 1 month ago by Jared Williams.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 17, 2013 at 5:40 pm #12752
    horsietime
    Member

    Hi -

    I am having a problem with Agent Press.  I told a property management company it would be perfect for them to use (they lease office space), but after working with it - I realize it is not as user friendly as I thought.  Sigh...

    But that being said - They only want to list the Property name and the Suite number of their featured listing.  I added this information to the address section of the listing post.  However there is still a placeholder "," for city and zip.  I cannot get that to disappear.  Please help.  Where is it coming from.  I have looked at the widget.php files and have deleted the city zip code but that didn't work.

    Please help

    http://nevadacityoffices.com/

    January 18, 2013 at 12:34 pm #12895
    Jared Williams
    Member

    The code is located inside the functions.php file. Look for this:

    add_filter( 'agentpress_featured_listings_widget_loop', 'agentpress_featured_listings_widget_loop_filter' );
    /**
    * Filter the loop output of the AgentPress Featured Listings Widget.
    *
    */
    function agentpress_featured_listings_widget_loop_filter( $loop ) {

    $loop = ''; /** initialze the $loop variable */

    $loop .= sprintf( '%s', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );

    $loop .= sprintf( '%s', genesis_get_custom_field('_listing_price') );
    $custom_text = genesis_get_custom_field( '_listing_text' );
    if( strlen( $custom_text ) )
    $loop .= sprintf( '%s', esc_html( $custom_text ) );
    $loop .= sprintf( '%s', genesis_get_custom_field('_listing_address') );
    $loop .= sprintf( '%s %s, %s', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );

    $loop .= sprintf( '%s', get_permalink(), __( 'View Listing', 'apl' ) );

    return $loop;

    }

    You need to remove:

    $loop .= sprintf( '%s %s, %s', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );

    So, your new code should look like this:

    add_filter( 'agentpress_featured_listings_widget_loop', 'agentpress_featured_listings_widget_loop_filter' );
    /**
    * Filter the loop output of the AgentPress Featured Listings Widget.
    *
    */
    function agentpress_featured_listings_widget_loop_filter( $loop ) {

    $loop = ''; /** initialze the $loop variable */

    $loop .= sprintf( '%s', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );

    $loop .= sprintf( '%s', genesis_get_custom_field('_listing_price') );
    $custom_text = genesis_get_custom_field( '_listing_text' );
    if( strlen( $custom_text ) )
    $loop .= sprintf( '%s', esc_html( $custom_text ) );
    $loop .= sprintf( '%s', genesis_get_custom_field('_listing_address') );

    $loop .= sprintf( '%s', get_permalink(), __( 'View Listing', 'apl' ) );

    return $loop;

    }

    Hope this helps!


    Website | Twitter | Instagram | Google +

    January 18, 2013 at 12:35 pm #12896
    Jared Williams
    Member

    Ok, sorry...it looks like the code got messed up a bit on submitting...

    basically look inside the functions.php file and remove this:

    $loop .= sprintf( '%s %s, %s', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );


    Website | Twitter | Instagram | Google +

    January 22, 2013 at 2:38 pm #13827
    goldsteinmedia
    Member

    In the new AgentPress that code isn't there. Is there an update to do this?

    January 22, 2013 at 3:22 pm #13847
    Jared Williams
    Member

    I just downloaded 2.0.2 and it is there. In the functions.php file


    Website | Twitter | Instagram | Google +

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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

© 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