Community Forums › Forums › Archived Forums › General Discussion › Removing comma on AgentPress Featured Listing Widget
- This topic has 4 replies, 3 voices, and was last updated 12 years ago by Jared Williams.
-
AuthorPosts
-
January 17, 2013 at 5:40 pm #12752horsietimeMember
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
January 18, 2013 at 12:34 pm #12895Jared WilliamsMemberThe 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!
January 18, 2013 at 12:35 pm #12896Jared WilliamsMemberOk, 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') );
January 22, 2013 at 2:38 pm #13827goldsteinmediaMemberIn the new AgentPress that code isn't there. Is there an update to do this?
January 22, 2013 at 3:22 pm #13847Jared WilliamsMember -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.