Realtyna Organic IDX + WPL Real Estate Shortcodes

Below, you’ll find a detailed guide on how to add the Realtyna Organic IDX + WPL Real Estate Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Realtyna Organic IDX + WPL Real Estate Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Realtyna Organic IDX + WPL Real Estate Plugin and the shortcodes it provides:

Plugin Icon
Realtyna Organic IDX plugin + WPL Real Estate

"Realtyna Organic IDX plugin + WPL Real Estate is a powerful WordPress tool for real estate professionals. This plugin facilitates seamless property listings and enhances your real estate website's functionality."

★★★★☆ (201) Active Installs: 4000+ Tested with: 6.2.3 PHP Version: 7.1
Included Shortcodes:
  • [WPL]
  • [wpl_vc_agents_widget]

Realtyna Organic IDX + WPL Real Estate [WPL] Shortcode

The Realtyna WPL shortcode is a vital tool for real estate websites. It fetches global settings and views from the WPL plugin. The function ‘process’ retrieves the global settings and the view based on the ‘wpl_qs’ query variable. If no specific view is provided, it defaults to ‘property_listing’. The view is then loaded using the ‘load’ function from ‘wpl_global’. This allows for dynamic content display on your real estate site.

Shortcode: [WPL]

Examples and Usage

Basic example – The shortcode ‘WPL’ is used to load a specific view based on the parameters passed. In its simplest form, it can be used without any parameters to load the default ‘property_listing’ view.

[WPL /]

Advanced examples

Passing the ‘view’ parameter to the shortcode allows you to specify which view to load. For example, if you want to load the ‘property_detail’ view, you would use the following shortcode:

[WPL view="property_detail" /]

Multiple parameters can be passed to the shortcode to further customize its behavior. For example, if you want to load the ‘property_listing’ view and specify a certain category and sort order, you could use the following shortcode:

[WPL view="property_listing" category="condos" sort="price_asc" /]

Note: The ‘category’ and ‘sort’ parameters are examples and may not be applicable depending on your WPL setup. Always refer to the WPL documentation or your website’s specific WPL configuration for valid parameters.

PHP Function Code

In case you have difficulties debugging what causing issues with [WPL] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('WPL', array($sef, 'process'));

Shortcode PHP function:

function process($instance)
	{
		/** get global settings **/
		$settings = wpl_global::get_settings();
		$wpl_qs = wpl_global::get_wp_qvar('wpl_qs');
		
		/** get view **/
		$view = self::get_view($wpl_qs, $settings['sef_main_separator']) ?? '';
		if(!trim($view)) $view = 'property_listing';
        
		/** load view **/
		return wpl_global::load($view, '', $instance);
	}

Code file location:

real-estate-listing-realtyna-wpl/real-estate-listing-realtyna-wpl/extensions.php

Realtyna Organic IDX + WPL Real Estate [wpl_vc_agents_widget] Shortcode

The Realtyna WPL plugin shortcode, ‘wpl_vc_agents_widget’, displays a widget of real estate agents. It’s customizable with various attributes like title, layout, style, image dimensions, and more. .

Shortcode: [wpl_vc_agents_widget]

Parameters

Here is a list of all possible wpl_vc_agents_widget shortcode parameters and attributes:

  • title – The title of the widget.
  • tpl – The layout template for the widget.
  • wpltarget – The target of the widget.
  • style – The style number for the widget.
  • css_class – The CSS class for the widget styling.
  • image_width – The width of the agent image.
  • image_height – The height of the agent image.
  • mailto_status – The status of the mail-to function.
  • user_type – The type of user to display.
  • membership – The membership status of the agents.
  • user_ids – The specific IDs of agents to display.
  • random – Whether to display agents randomly.
  • orderby – The order by which to sort the agents.
  • order – The sort order for displaying agents.
  • limit – The maximum number of agents to display.

Examples and Usage

Basic example – The following shortcode displays the ‘wpl_vc_agents_widget’ with the default settings.

[wpl_vc_agents_widget]

Advanced examples

Here, the shortcode is used to display the ‘wpl_vc_agents_widget’ with a specific title and layout. The ‘title’ attribute is set to ‘Our Agents’, and the ‘tpl’ attribute is set to ‘grid’. This will display the agents in a grid layout with the title ‘Our Agents’.

[wpl_vc_agents_widget title="Our Agents" tpl="grid"]

In this next example, the shortcode is customized further by setting the image dimensions and limiting the number of agents displayed. The ‘image_width’ and ‘image_height’ attributes are set to 200, and the ‘limit’ attribute is set to 4. This will display four agents with their images resized to 200×200 pixels.

[wpl_vc_agents_widget image_width="200" image_height="200" limit="4"]

Lastly, this example shows how to display agents randomly with a specific user type. The ‘random’ attribute is set to ‘yes’, and the ‘user_type’ attribute is set to ‘2’. This will display agents of user type 2 in a random order.

[wpl_vc_agents_widget random="yes" user_type="2"]

PHP Function Code

In case you have difficulties debugging what causing issues with [wpl_vc_agents_widget] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('wpl_vc_agents_widget', array($this, 'shortcode_callback'));

Shortcode PHP function:

function shortcode_callback($atts)
    {
        ob_start();
        
        $agents = new wpl_agents_widget();
        $agents->widget(array(
            'before_widget'=>'',
            'after_widget'=>'',
            'before_title'=>'',
            'after_title'=>'',
        ),
        array
        (
            'title'=>isset($atts['title']) ? $atts['title'] : '',
            'layout'=>isset($atts['tpl']) ? $atts['tpl'] : '',
            'wpltarget'=>isset($atts['wpltarget']) ? $atts['wpltarget'] : '',
            'data'=>array(
                'style'=>isset($atts['style']) ? $atts['style'] : 1,
                'css_class'=>isset($atts['css_class']) ? $atts['css_class'] : '',
                'image_width'=>isset($atts['image_width']) ? $atts['image_width'] : 230,
                'image_height'=>isset($atts['image_height']) ? $atts['image_height'] : 230,
                'mailto_status'=>isset($atts['mailto_status']) ? $atts['mailto_status'] : '',
                'user_type'=>isset($atts['user_type']) ? $atts['user_type'] : NULL,
                'membership'=>isset($atts['membership']) ? $atts['membership'] : NULL,
                'user_ids'=>isset($atts['user_ids']) ? $atts['user_ids'] : '',
                'random'=>isset($atts['random']) ? $atts['random'] : '',
                'orderby'=>isset($atts['orderby']) ? $atts['orderby'] : '',
                'order'=>isset($atts['order']) ? $atts['order'] : '',
                'limit'=>isset($atts['limit']) ? $atts['limit'] : 6,
            )
        ));
        
        return ob_get_clean();
    }

Code file location:

real-estate-listing-realtyna-wpl/real-estate-listing-realtyna-wpl/libraries/page_builders/vc/widget_agents.php

Conclusion

Now that you’ve learned how to embed the Realtyna Organic IDX + WPL Real Estate Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *