Modify AgentPress Listings Plugin Property Details Class Shortcode Function

This file enables you to modify the AgentPress listings plugins property details shortcode function included in the plugins class-agentpress-listings.php file.

This file is modified in your AgentPress Pro child theme folder so any modification you make to the property_details_shortcode( $atts ) function is not lost when the plugin is updated.

The file in this download folder enables you to safely modify :

  1. The markup for the property details shortcode enabling you to remove HTML tags and replace them with classes for styling both the label and value for each property value.
  2. Remove any labels when no value is added in the listings details metabox input fields on the single listing admin page.
  3. Remove the label for the Additional Features if none added.

Here’s an example where the markup has been removed and replaced with custom classes enabling the use of CSS Grid to display property details in table like columns if the value field is not empty.

Property Details Shortcode - AgentPress Pro Listings Plugin HTML output

Demo Video

Shows the markup and output for the AgentPress Listings plugins shortcodenm modified via the AgentPress Pro child theme.

The code only executes when the AgentPress Listings plugin is active.

Installation Steps

  1. # Upload the file named agentpress-shortcode.php to your AgentPress Pro theme folder like this :
  2.  

    Step 1

  3. # Copy & paste the PHP code ( without the opening PHP tag ) from functions.php to the end of your AgentPress Pro themes functions file.
  4.  

    Step 2

Download Folder

Optional – Example HTML & CSS

You can then copy & paste the CSS from the style.css file to the end of your AgentPress Pro themes style sheet and clear caching. This is demo CSS which produces what you see in the screenshot at the beginning of this tutorial.

Also add this HTML to your editor on the Single Listings Edit screen as seen in the demo video.

Related Tutorials


Comments

6 responses to “Modify AgentPress Listings Plugin Property Details Class Shortcode Function”

  1. sebastian taru Avatar
    sebastian taru

    It worked but all markup has been removed and replaced with custom classes. even the featured image is displayed in half now. Looks ok in mobile devices but not on desktop.
    See here: https://ibiza.realestate/listings/modern-house-with-sea-views-to-es-vedra/

    1. Yes, thats what its coded to do so you can add your own markup and change the styling for customization as detailed in the tutorial description. If you want to use the default markup, just add it back from the listings plugin.

  2. sebastian taru Avatar
    sebastian taru

    Hello Brad
    The code works except the CSS. Any idea?
    Thanks

    1. It depends on how you want to style it. Sample CSS is provided to style the HTML output as seen in the screenshot.

  3. Alejandro Perez Avatar
    Alejandro Perez

    Is it possible to rename the title “Property Details” for something else ?

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.