Community Forums › Forums › Design Tips and Tricks › Agent Press, Featured Listing, missing/misplaced comma
Tagged: Agentpress
This topic contains 4 replies, has 3 voices, and was last updated by offroadjoe 3 months, 3 weeks ago.
-
AuthorPosts
-
November 27, 2012 at 2:02 pm #1918
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 #15229Did you get this resolved? If not, please post a link to your site. Thanks!
Susan @ Graphically Designing I’d love to customize your website! I tweet!
I’ve taken up the challenge! – help me answer some of the unanswered postsJanuary 28, 2013 at 1:08 pm #15611Not 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 #15971How 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 #16078Fixed the problem. Thanks for all your help!
-
AuthorPosts
The topic ‘Agent Press, Featured Listing, missing/misplaced comma’ is closed to new replies.