Removing comma on AgentPress Featured Listing Widget

Community Forums Forums General Discussion Removing comma on AgentPress Featured Listing Widget

This topic is: not resolved

This topic contains 4 replies, has 3 voices, and was last updated by  Jared Williams 1 year, 6 months ago.

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

    horsietime
    Participant
    Post count: 2

    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/

    • This topic was modified 1 year, 6 months ago by  horsietime.
    • This topic was modified 1 year, 6 months ago by  horsietime.
    #12895

    Jared Williams
    Participant
    Post count: 47

    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!


    #12896

    Jared Williams
    Participant
    Post count: 47

    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') );


    #13827

    goldsteinmedia
    Participant
    Post count: 3

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

    #13847

    Jared Williams
    Participant
    Post count: 47

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


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

You must be logged in to reply to this topic.