Community Forums › Forums › Archived Forums › Design Tips and Tricks › Agent Press, Featured Listing, missing/misplaced comma
Tagged: Agentpress
- This topic has 4 replies, 3 voices, and was last updated 13 years ago by
offroadjoe.
-
AuthorPosts
-
November 27, 2012 at 2:02 pm #1918
offroadjoe
MemberIn 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 #15229Susan
ModeratorDid you get this resolved? If not, please post a link to your site. Thanks!
January 28, 2013 at 1:08 pm #15611offroadjoe
MemberNot 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 #15971Jared Williams
MemberHow 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!
January 29, 2013 at 1:55 pm #16078offroadjoe
MemberFixed the problem. Thanks for all your help!
-
AuthorPosts
- The topic ‘Agent Press, Featured Listing, missing/misplaced comma’ is closed to new replies.