• 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

Agent Press Listing

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 › General Discussion › Agent Press Listing

This topic is: resolved

Tagged: Agentpress, featured listing, listing title

  • This topic has 4 replies, 2 voices, and was last updated 11 years, 8 months ago by JPJP9.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 12, 2014 at 12:03 am #118335
    JPJP9
    Member

    Hi,
    Two questions regarding this plugin:
    1) How can I add the Listing Title to the Featured Listings Widget?
    and
    2) I have changed one of the labels in the functions.php file to Telephone (effectively rebadging that field) - is that the best way to do it?

    //* Filter the property details array
    add_filter( 'agentpress_property_details', 'agentpress_property_details_filter' );
    function agentpress_property_details_filter( $details ) {
    
        $details['col2'] = array( 
            __( 'Telephone Number:', 'agentpress' )       => '_listing_mls', 
            __( 'Square Feet:', 'agentpress' ) => '_listing_sqft', 
            __( 'Bedrooms:', 'agentpress' )    => '_listing_bedrooms', 
            __( 'Bathrooms:', 'agentpress' )   => '_listing_bathrooms', 
            __( 'Basement:', 'agentpress' )    => '_listing_basement',
        );
    
        return $details;
    
    }
    
    August 29, 2014 at 11:09 pm #121787
    Tom
    Participant

    Assuming you are still looking at doing this...

    1. In functions.php, find function agentpress_featured_listings_widget_loop_filter. You can modify this code block to print the title, adding something like $loop .= sprintf( '<span class="entry-title">' . ( get_the_title() ) . '</span>' ); The title text location and appearance can be manipulated by ordering this line in the loop amongst the others and with CSS.

    2. You should also change the variable name from _listing_mlsto _tel_number or similar to reduce term confusion, creating a new data reference.


    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

    August 31, 2014 at 9:27 pm #122152
    JPJP9
    Member

    Thanks heaps for your reply Tom.
    Couldn't find that function in the function.php file? but changed a line in class-featured-listings-widget.php
    to this
    $loop .= sprintf('<span class="entry-title">' . ( get_the_title() ) . '</span>'.'<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );

    and seems to be working.

    thanks heaps

    September 1, 2014 at 12:33 am #122180
    Tom
    Participant

    That's not a good way to make this change. The code in class-featured-listings-widget.php will be overwritten by plugin updates and your change will be lost. What is the theme that you are using?

    You can add the following filter to your functions.php, modified with your HTML mods:

    add_filter( 'agentpress_featured_listings_widget_loop', 'agentpress_featured_listings_widget_loop_filter' );
    /**
     * Filter the loop output of the AgentPress Featured Listings Widget.
     *
     */
    function agentpress_featured_listings_widget_loop_filter( $loop ) {
    
        $loop = ''; /** initialze the $loop variable */
    
        $loop .= sprintf( '<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );
    
        $loop .= sprintf( '<span class="entry-title">' . ( get_the_title() ) . '</span>' );
    
        $loop .= sprintf( '<span class="listing-price">%s</span>', genesis_get_custom_field('_listing_price') );
    
        $custom_text = genesis_get_custom_field( '_listing_text' );
        if( strlen( $custom_text ) )
            $loop .= sprintf( '<span class="listing-text">%s</span>', esc_html( $custom_text ) );
    
        $loop .= sprintf( '<span class="listing-address">%s</span>', genesis_get_custom_field('_listing_address') );
    
        $loop .= sprintf( '<span class="listing-city-state-zip">%s %s, %s</span>', genesis_get_custom_field('_listing_city'), genesis_get_custom_field('_listing_state'), genesis_get_custom_field('_listing_zip') );
    
        $loop .= sprintf( '<a href="%s" class="more-link">%s</a>', get_permalink(), __( 'View Listing', 'apl' ) );
    
        return $loop;
    
    }

    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

    September 1, 2014 at 12:59 am #122182
    JPJP9
    Member

    Yes what you are saying definitely makes sense.

    I'm using the Agent Press theme but could not find that function in the functions.php file

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ 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

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