Title: AgentPress Listings
Last modified: August 22, 2016

---

# AgentPress Listings

 *  [Tom.Nunn](https://wordpress.org/support/users/tomnunn/)
 * (@tomnunn)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/agentpress-listings/)
 * Hi Guys,
 * I have also posted this query within the StudioPress forums*
 * I have changed and added a few custom fields for the ‘Property Details’
 * Like so:
 * [http://s3.postimg.org/4kkag7exv/Screen_Shot_2014_09_14_at_21_22_48.png](http://s3.postimg.org/4kkag7exv/Screen_Shot_2014_09_14_at_21_22_48.png)
 * And have modified the code in archive-listing.php and taxonomy.php like so:
 *     ```
       /**
        * Custom loop for listing archive page
        */
       function agentpress_listing_archive_loop() {
   
       	if ( have_posts() ) : while ( have_posts() ) : the_post();
   
       		$listing_price = genesis_get_custom_field( '_listing_price' );
       		$listing_text = genesis_get_custom_field( '_listing_text' );
       		$address = genesis_get_custom_field( '_listing_address' );
       		$<strong>town</strong> = genesis_get_custom_field( '<strong>_listing_town</strong>' );
       		$<strong>area</strong> = genesis_get_custom_field( '<strong>_listing_area</strong>' );
       		$zip = genesis_get_custom_field( '_listing_zip' );
   
       		$loop = ''; // init
   
       		$loop .= sprintf( '<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );
   
       		if( $listing_price ) {
       			$loop .= sprintf( '<span class="listing-price">%s</span>', $listing_price );
       		}
   
       		if( $listing_text ) {
       			$loop .= sprintf( '<span class="listing-text">%s</span>', $listing_text );
       		}
   
       		if( $address ) {
       			$loop .= sprintf( '<span class="listing-address">%s</span>', $address );
       		}	
   
       		if ( $<strong>town</strong> || $<strong>area</strong> || $zip ) {
   
       			//* count number of completed fields
       			$pass = count( array_filter( array( $<strong>town</strong>, $<strong>area</strong>, $zip ) ) );
   
       			//* If only 1 field filled out, no comma
       			if ( 1 == $pass ) {
       				$town_area_zip = $town . $area . $zip;
       			}
       			//* If city filled out, comma after city
       			elseif ( $town ) {
       				$town_area_zip = $town . ", " . $area . " " . $zip;
       			}
       			//* Otherwise, comma after state
       			else {
       				$town_area_zip = $town . " " . $area . ", " . $zip;
       			}
   
       			$loop .= sprintf( '<span class="<strong>listing-town-area-zip</strong>">%s</span>', trim( $town_area_zip ) );
   
       		}
       ```
   
 * But I can not get this information to change, which has the CSS class .listing-
   town-area-zip This is displaying the text ‘Encino, California 91436′ but it should
   be displaying ‘Benitachell, Costa Blanca’
 * [http://s29.postimg.org/uxsb0n3vb/Screen_Shot_2014_09_14_at_21_25_04.png](http://s29.postimg.org/uxsb0n3vb/Screen_Shot_2014_09_14_at_21_25_04.png)
 * Any ideas?
 * Many Thanks,
    Tom
 * [https://wordpress.org/plugins/agentpress-listings/](https://wordpress.org/plugins/agentpress-listings/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Tom.Nunn](https://wordpress.org/support/users/tomnunn/)
 * (@tomnunn)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/agentpress-listings/#post-5293454)
 * Apologies, I am using the AgentPress Pro Child Theme, in which I assume you may
   ask me to send a ticket to them directly…
 *  Plugin Contributor [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/agentpress-listings/#post-5293612)
 * > I assume you may ask me to send a ticket to them directly…
 * Yes, I do that for theme customization questions regardless of which child theme
   you are using.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘AgentPress Listings’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/agentpress-listings_46515d.svg)
 * [AgentPress Listings](https://wordpress.org/plugins/agentpress-listings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/agentpress-listings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/agentpress-listings/)
 * [Active Topics](https://wordpress.org/support/plugin/agentpress-listings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/agentpress-listings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/agentpress-listings/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/agentpress-listings/#post-5293612)
 * Status: not resolved