NooTheme Premium WordPress Theme › Forums › CitiLights › Amount of Agents shown in the "Meet our agents" section
- This topic has 9 replies, 2 voices, and was last updated 6 years, 1 month ago by
Vermouth Bui.
-
AuthorPosts
-
6 years, 1 month ago #2393
Hello,
Is there any way to change the amount of agents shown in this box:
6 years, 1 month ago #2413Hi,
Thank you for contacting us.
We'll add configuration that you can change the columns for recent on next version.
Or you change them as code in the file:
../wp-content/noo-citilights/framework/admin/noo-agent.php
on function: recent_agents_shortcode
<li class="col-md-4 col-sm-6"> <!--You can change the columns for recent on this(ex: if you want displaying 4 columns on pc and 6 columns on smartphone: <li class="col-md-3 col-sm-6">)-->
Regards,
Vermouth Bui
6 years, 1 month ago #2442Where exactly do I need to add this code.
Cause when I add <span style="box-sizing: border-box; color: #4b4d4d; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5;"><li class=”col-md-3 col-sm-6″></span><span style="box-sizing: border-box; color: #4b4d4d; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5;">)–> Below </span><span style="color: #4b4d4d; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 21px;">public function recent_agents_shortcode($atts, $content = null){ </span></span>
It just gives me an error.
6 years, 1 month ago #2443Where exactly do I need to add this code?
Cause when I add it just below public function recent_agents_shortcode($atts, $content = null){public function recent_agents_shortcode($atts, $content = null){ <li class=”col-md-4 col-sm-6″>
It Just gives me an error. where do I need to add this code in the function?
6 years, 1 month ago #2447Dear,
Please tell me you want change the amount of agents or the columns of agents.
If you want change the amount of agents, you can set up with configuration : "Number" of Recent Agents shortcode.
If you want change the columns of agent, please tell me exactly the amount of columns.
I'll give code of function: recent_agents_shortcode, you only replace them on your file.
Regards,
Vermouth Bui
6 years, 1 month ago #2448Hello.
I have 6 Agents but it is showing 3 per column and I want to have it to show 4.
6 years, 1 month ago #2451So yes I want to have 4 columns showing.
6 years, 1 month ago #2465Dear,
Please replace this function: recent_agents_shortcode on file:
../wp-content/noo-citilights/framework/admin/noo-agent.php
<code>public function recent_agents_shortcode($atts, $content = null){ extract( shortcode_atts( array( 'title' => __('Recent Agents',NOO_TEXT_DOMAIN), 'number' => '6', 'visibility' => '', 'class' => '', 'custom_style' => '' ), $atts ) ); wp_enqueue_script( 'noo-property' ); $visibility = ( $visibility != '' ) && ( $visibility != 'all' ) ? esc_attr( $visibility ) : ''; $class = ( $class != '' ) ? 'recent-agents ' . esc_attr( $class ) : 'recent-agents'; switch ($visibility) { case 'hidden-phone': $class .= ' hidden-xs'; break; case 'hidden-tablet': $class .= ' hidden-sm hidden-md'; break; case 'hidden-pc': $class .= ' hidden-lg'; break; case 'visible-phone': $class .= ' visible-xs-block visible-xs-inline visible-xs-inline-block'; break; case 'visible-tablet': $class .= ' visible-sm-block visible-sm-inline visible-sm-inline-block visible-md-block visible-md-inline visible-md-inline-block'; break; case 'visible-phone': $class .= ' visible-lg-block visible-lg-inline visible-lg-inline-block'; break; } $class = ( $class != '' ) ? ' class="' . esc_attr( $class ) . '"' : ''; $custom_style = ( $custom_style != '' ) ? ' style="' . $custom_style . '"' : ''; $args = array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'post_type'=>self::AGENT_POST_TYPE, ); $q = new WP_Query($args); ob_start(); ?> <!--?php if($q--->have_posts()):?> <div class="recent-agents recent-agents-slider"><!--?php if(!empty($title)):?--> <div class="recent-agents-title"></div> &nbsp; <div class="recent-agents-content"> <div class="caroufredsel-wrap row"> <ul class=""> <ul class=""> <ul class=""><!--?php // // Check if agent has properties // if( !self::has_my_properties( $post--->ID ) ) {</ul> </ul> </ul> <ul class=""> <ul class=""> // continue;</ul> </ul> <ul class=""> <ul class="">// }</ul> </ul> // Variables $prefix = self::AGENT_META_PREFIX; $avatar_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' ); if( empty($avatar_src) ) { $avatar_src = NOO_ASSETS_URI . '/images/default-avatar.png'; } else { $avatar_src = $avatar_src[0]; } // Agent's info $phone = noo_get_post_meta( get_the_ID(), "{$prefix}_phone", '' ); $mobile = noo_get_post_meta( get_the_ID(), "{$prefix}_mobile", '' ); $email = noo_get_post_meta( get_the_ID(), "{$prefix}_email", '' ); $skype = noo_get_post_meta( get_the_ID(), "{$prefix}_skype", '' ); $facebook = noo_get_post_meta( get_the_ID(), "{$prefix}_facebook", '' ); $twitter = noo_get_post_meta( get_the_ID(), "{$prefix}_twitter", '' ); $google_plus = noo_get_post_meta( get_the_ID(), "{$prefix}_google_plus", '' ); $linkedin = noo_get_post_meta( get_the_ID(), "{$prefix}_linkedin", '' ); $pinterest = noo_get_post_meta( get_the_ID(), "{$prefix}_pinterest", '' ); ?> <ul class=""> <ul class=""> <li class="col-md-3 col-sm-6"><article id="agent-<?php the_ID(); ?>">> <div class="agent-featured"><a class="content-thumb" href="<?php the_permalink() ?>"> <img src="<?php echo $avatar_src; ?>" alt="&quot;<?php" />"/> </a></div> <div class="agent-wrap"> <h2 class="agent-title"><!--?php the_title(); ?--></h2> <div class="agent-excerpt"><!--?php if($excerpt = $post--->post_content):?> <!--?php <br ?--> $num_word = 20; $excerpt = strip_shortcodes($excerpt); echo '' . wp_trim_words($excerpt,$num_word,'...') . ' '; ?> <!--?php endif;?--> </div> <div class="agent-social"><!--?php echo ( !empty($facebook) ? '<a class="noo-social-facebook" href="' . $facebook . '"-->' : '' ); ?> <!--?php echo ( !empty($twitter) ? '<a class="noo-social-twitter" href="' . $twitter . '"-->' : '' ); ?> <!--?php echo ( !empty($google_plus) ? '<a class="noo-social-googleplus" href="' . $google_plus . '"-->' : '' ); ?> <!--?php echo ( !empty($linkedin) ? '<a class="noo-social-linkedin" href="' . $linkedin . '"-->' : '' ); ?> <!--?php echo ( !empty($pinterest) ? '<a class="noo-social-pinterest" href="' . $pinterest . '"-->' : '' ); ?></div> </div> </article></li> </ul> </ul> &nbsp; </div> &nbsp; </div> </div> <!--?php <br ?--> wp_reset_query(); wp_reset_postdata(); return ob_get_clean(); endif; } </code>
and replace file: ../wp-content/noo-citilights/assets/js/propety.js
Best regards
6 years, 1 month ago #2496Hello,
What it does now is the following.
It shows 4 agents for a split second and then it goes back to 3.
and I could not find the property.js file in that folder I did add it though.Regards
Jasper
6 years, 1 month ago #2497Dear,
Please give me your site’s URL and admin account to check this problem. Please remember to mark your reply as private to hide that information from others.
Regards,
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.