• 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

Agent Press, Featured Listing, missing/misplaced comma

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 › Agent Press, Featured Listing, missing/misplaced comma

This topic is: resolved

Tagged: Agentpress

  • This topic has 4 replies, 3 voices, and was last updated 13 years ago by offroadjoe.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • November 27, 2012 at 2:02 pm #1918
    offroadjoe
    Member

    In Agent Press, "Featured Listing" section the City, State, Zip is displayed with a comma between State and Zip and no comma between City and State where it properly belongs. I would like to change it so that it is City, State ZIP for consistency with IDX pulls and other pages.

    January 26, 2013 at 8:55 pm #15229
    Susan
    Moderator

    Did you get this resolved? If not, please post a link to your site. Thanks!

    January 28, 2013 at 1:08 pm #15611
    offroadjoe
    Member

    Not resolved yet. Please see "Featured Listings"  http://prescottpinesrealestate.com/

    The addresses show correctly on the "View My Listings" page,  http://prescottpinesrealestate.com/listings/, just not in the Featured Listings widget.

    January 29, 2013 at 9:30 am #15971
    Jared Williams
    Member

    How comfortable are you will modifying PHP in the functions.php file?

    Basically, the comma is in the wrong place in the Featured Listings Widget filter...

    You currently have:

    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( '<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );
    
    	$loop .= sprintf( '<span class="listing-price">%s</span>', genesis_get_custom_field('_listing_price') );
    	$custom_text = genesis_get_custom_field( '_listing_text' );
    	if( strlen( $custom_text ) )
    		$loop .= sprintf( '<span class="listing-text">%s</span>', esc_html( $custom_text ) );
    	$loop .= sprintf( '<span class="listing-address">%s</span>', genesis_get_custom_field('_listing_address') );
    	$loop .= sprintf( '<span class="listing-city-state-zip">%s %s, %s</span>', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );
    
    	$loop .= sprintf( '<a href="%s" class="more-link">%s</a>', get_permalink(), __( 'View Listing', 'apl' ) );
    	
    	return $loop;
    	
    }

    This line is incorrect:

    $loop .= sprintf( '<span class="listing-city-state-zip">%s %s, %s</span>', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );

    so we need to make it:

    $loop .= sprintf( '<span class="listing-city-state-zip">%s, %s %s</span>', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );

    Hope this helps!


    Website | Twitter | Instagram | Google +

    January 29, 2013 at 1:55 pm #16078
    offroadjoe
    Member

    Fixed the problem. Thanks for all your help!

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Agent Press, Featured Listing, missing/misplaced comma’ is closed to new 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