Tagged: x
-
AuthorPosts
-
June 14, 2016 at 1:09 am #1040840
CrystalTiffanyTanParticipantHi X Theme,
Quick question regarding your counter short code. Is it possible to have the following settings:
“We have 823 big ideas”
By default, the number shows 823. Once the page loads, num_start is 0 and num_end is 823.
The reason I’m asking: sometimes, a page is very slow to load, and the counter doesn’t load immediately. Therefore, it gets stuck with num_start which is 0.
So for slow connections, it sometimes shows “We have 0 big ideas”. So to fix this issue, I’m thinking of just having 823 as the default number before everything loads, and have it count up from 0 again.
Thank you!
June 14, 2016 at 1:09 am #1040841
CrystalTiffanyTanParticipantThis reply has been marked as private.June 14, 2016 at 1:26 am #1040865
NicoModeratorHi There,
Thanks for writing in.
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Don’t forget also to update your setup to the latest version. for updating guide: https://community.theme.co/kb/updating-your-theme-and-plugins/
Thanks.
June 14, 2016 at 3:19 am #1040983
CrystalTiffanyTanParticipantThis reply has been marked as private.June 14, 2016 at 3:56 am #1041021
CrystalTiffanyTanParticipantThis reply has been marked as private.June 14, 2016 at 8:34 am #1041381
LelyModeratorHi There,
We can change the default to something else but it wouldn’t be dynamic.
Please try adding the following code on your child theme’s functions.php file:// Counter // ============================================================================= function x_shortcode_counter_update( $atts ) { extract( shortcode_atts( array( 'id' => '', 'class' => '', 'style' => '', 'num_color' => '', 'num_start' => '', 'num_end' => '', 'num_speed' => '', 'num_prefix' => '', 'num_suffix' => '', 'text_color' => '', 'text_above' => '', 'text_below' => '' ), $atts, 'x_counter' ) ); $id = ( $id != '' ) ? 'id="' . esc_attr( $id ) . '"' : ''; $class = ( $class != '' ) ? 'x-counter ' . esc_attr( $class ) : 'x-counter'; $style = ( $style != '' ) ? 'style="' . $style . '"' : ''; $num_color = ( $num_color != '' ) ? 'style="color: ' . $num_color . ';"' : ''; $num_start = ( $num_start != '' ) ? $num_start : 0; $num_end = ( $num_end != '' ) ? $num_end : 0; $num_speed = ( $num_speed != '' ) ? $num_speed : 1500; $num_prefix = ( $num_prefix != '' ) ? '<span class="prefix">' . $num_prefix . '</span>' : ''; $num_suffix = ( $num_suffix != '' ) ? '<span class="suffix">' . $num_suffix . '</span>' : ''; $text_color = ( $text_color != '' ) ? 'style="color: ' . $text_color . ';"' : ''; $text_above = ( $text_above != '' ) ? '<span class="text-above" ' . $text_color . '>' . $text_above . '</span>' : ''; $text_below = ( $text_below != '' ) ? '<span class="text-below" ' . $text_color . '>' . $text_below . '</span>' : ''; $js_params = array( 'numEnd' => floatval($num_end), 'numSpeed' => floatval($num_speed) ); if ( floatval($num_start) > 0 ) { $js_params['numStart'] = floatval($num_start); } $data = cs_generate_data_attributes( 'counter', $js_params ); $output = "<div {$id} class=\"{$class}\" {$data} {$style}>" . $text_above . "<div class=\"number-wrap w-h\" {$num_color}>" . $num_prefix . "<span class=\"number\">{$num_start}</span>" . $num_suffix . '</div>' . $text_below . '</div>'; return $output; } add_action('wp_head', 'update_counter_shortcode'); function update_counter_shortcode() { remove_shortcode( 'x_counter' ); add_shortcode( 'x_counter', 'x_shortcode_counter_update' ); }From above code, look for this line:
$num_start = ( $num_start != '' ) ? $num_start : 0;Change 0 to your preferred default value. Unfortunately, it is not dynamic, changing this to be dynamic is possible via customization, but that would be outside the scope of our support. Thank you for understanding.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1040840 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
