• 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:

    https://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’

    https://s29.postimg.org/uxsb0n3vb/Screen_Shot_2014_09_14_at_21_25_04.png

    Any ideas?

    Many Thanks,
    Tom

    https://www.ads-software.com/plugins/agentpress-listings/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tom.Nunn

    (@tomnunn)

    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

    (@wpmuguru)

    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.