NooTheme Premium WordPress Theme › Forums › CitiLights › Noo City Information
This topic is: not resolved
- This topic has 1 reply, 2 voices, and was last updated 3 years, 11 months ago by dangdv.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
3 years, 11 months ago #1134694
AnonymousInactiveTopics: 18
Posts: 25Hi!
I would like to change the settings for "Noo City Information" element on the homepage to show the Property Sub Locations instead of the Property Locations. Is there any way I can do this?
Thank you!
Attachments:
You must be logged in to view attached files.3 years, 11 months ago #1137595Dear, if you want switch Noo City Information shortcode to use Sub Location, please switch your site to use Citilights Child theme, then add custom code in file functions.php of child theme
add_action( 'init', function (){ $sub_locations = get_categories( array('orderby' => 'NAME', 'order' => 'ASC', 'taxonomy' => 'property_sub_location', 'hide_empty' => false ) ); $list = array(); foreach ( (array)$sub_locations as $sub_location ) { $list[ $sub_location->name ] = $sub_location->term_id; } vc_update_shortcode_param('noo_city_info', array( 'type' => 'param_group', 'heading' => esc_html__('Info', 'noo'), 'param_name' => 'items', 'params' => array( array( 'type' => 'attach_image', 'heading' => esc_html__('Thumbnail', 'noo'), 'param_name' => 'thumbnail', ), array( 'type' => 'dropdown', 'heading' => esc_html__('Property Sub Location', 'noo'), 'param_name' => 'location_id', 'admin_label' => true, 'value' => $list, ), ), )); },999); if (!function_exists('getLocation')) { function getLocation($id) { $location = get_term($id, 'property_sub_location'); return $location->name; } }; if (!function_exists('getPropAmount')) { function getPropAmount($id) { $location = get_term($id, 'property_sub_location'); return $location->count; } } if (!function_exists('getSlug')) { function getSlug($id) { $location = get_term($id, 'property_sub_location'); return $location->slug; } }
After add custom code, please go to edit Noo City Information shortcode settings and select sub-location again.
Best regards.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in and have valid license to reply to this topic.