Community Forums › Forums › Archived Forums › Design Tips and Tricks › AgentPress Listings on AgentPress Pro Theme
Tagged: AgentPress Listings, css, php
- This topic has 5 replies, 2 voices, and was last updated 9 years, 4 months ago by daverollo.
-
AuthorPosts
-
September 14, 2014 at 2:30 pm #124390TomMember
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.pngAnd 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.pngAny ideas?
Many Thanks,
TomSeptember 14, 2014 at 2:32 pm #124391TomMemberApologies, ignore the strong tag's.
September 15, 2014 at 4:59 pm #124580TomMemberAfter trying to figure this out today, I am returning to this post for advice...
September 16, 2014 at 11:50 am #124692TomMemberGoing to have to bump this, sorry.
September 22, 2014 at 2:40 pm #125359TomMemberHas 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 #134881daverolloMemberI 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?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.