Agent Press, Featured Listing, missing/misplaced comma

Community Forums Forums Design Tips and Tricks Agent Press, Featured Listing, missing/misplaced comma

This topic is: resolved

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  offroadjoe 1 year, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1918

    offroadjoe
    Participant
    Post count: 2

    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.

    #15229

    Susan
    Moderator
    Post count: 7436

    Did 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 posts

    #15611

    offroadjoe
    Participant
    Post count: 2

    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.

    #15971

    Jared Williams
    Participant
    Post count: 47

    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!


    #16078

    offroadjoe
    Participant
    Post count: 2

    Fixed the problem. Thanks for all your help!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Agent Press, Featured Listing, missing/misplaced comma’ is closed to new replies.