• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

AgentPress Listings on AgentPress Pro Theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › AgentPress Listings on AgentPress Pro Theme

This topic is: not resolved

Tagged: AgentPress Listings, css, php

  • This topic has 5 replies, 2 voices, and was last updated 10 years, 11 months ago by daverollo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • September 14, 2014 at 2:30 pm #124390
    Tom
    Member

    Evening all,

    Another AgentPress query for me, 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

    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

    Any ideas?

    Many Thanks,
    Tom

    September 14, 2014 at 2:32 pm #124391
    Tom
    Member

    Apologies, ignore the strong tag's.

    September 15, 2014 at 4:59 pm #124580
    Tom
    Member

    After trying to figure this out today, I am returning to this post for advice...

    September 16, 2014 at 11:50 am #124692
    Tom
    Member

    Going to have to bump this, sorry.

    September 22, 2014 at 2:40 pm #125359
    Tom
    Member

    Has somebody come into contact with the same issue? If you are located outside of the USA the field names will pretty much be irrelevant to the industry.
    Or if AgentPress Listings has been used to display something else rather than real estate.

    Tom.

    December 19, 2014 at 5:37 am #134881
    daverollo
    Member

    I have just upgraded from Agent Press 2.0 to Pro and had to amend the Functions PHP to get the Property Details Fields amended to how I want:

    http://gunnrollo.co.uk/index.php/listings/32-32-bank-street-hillhead-g12-8nd/

    The issue I have is similar to your, in so much that within the listings page (for Sold properties or For Sale properties) it is not pulling through any of the data/address fields that I have created, so no one will know where a property is located without clicking on it.

    Maybe between us we can figure it out?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble