• 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 Pro – turn property listing field into hyperlink

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 Pro – turn property listing field into hyperlink

This topic is: not resolved

Tagged: AgentPress Listings, Agentpress Pro

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 4 months ago by jbarrett888.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 27, 2014 at 2:13 pm #126002
    jbarrett888
    Participant

    I'd like one of the property listing fields (powered by the AgentPress Listings plugin) to be returned as a hyperlink.

    Here's a sample listing page:
    http://hawaiicbc.net/listings/joyce-lee-ibarra/

    ... the property listings appear near the bottom of the section labeled "Expertise". I'd like the WEBSITE field to link to the entry populating that field. Any suggestions how to achieve this result?

    http://hawaiicbc.net
    September 27, 2014 at 3:31 pm #126008
    Brad Dalton
    Participant

    This is how i would build a function which does that using this code to start with http://codex.wordpress.org/Function_Reference/get_post_meta

    This is the default plugin shortcode output

    function property_details_shortcode( $atts ) {
    
    		global $post;
    
    		$output = '';
    
    		$output .= '<div class="property-details">';
    
    		$output .= '<div class="property-details-col1 one-half first">';
    			foreach ( (array) $this->property_details['col1'] as $label => $key ) {
    				$output .= sprintf( '<b>%s</b> %s<br />', esc_html( $label ), esc_html( get_post_meta($post->ID, $key, true) ) );	
    			}
    		$output .= '</div><div class="property-details-col2 one-half">';
    			foreach ( (array) $this->property_details['col2'] as $label => $key ) {
    				$output .= sprintf( '<b>%s</b> %s<br />', esc_html( $label ), esc_html( get_post_meta($post->ID, $key, true) ) );	
    			}
    		$output .= '</div><div class="clear">';
    			$output .= sprintf( '<p><b>%s</b><br /> %s</p></div>', __( 'Additional Features:', 'agentpress-listings' ), get_the_term_list( $post->ID, 'features', '', ', ', '' ) );
    
    		$output .= '</div>';
    
    		return $output;
    
    	}
    

    Get Help – Book Consultation.

    September 27, 2014 at 4:23 pm #126013
    jbarrett888
    Participant

    Thanks, Brad. Appreciate your response.

    I was thinking I'd need to add a function but am still pretty green in that area (building functions). Not sure how to tease apart the outputs from col1 and col2. Was hoping someone else may have already achieved this effect and could share the code they used.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2023 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