- This topic has 10 replies, 2 voices, and was last updated 8 years, 9 months ago by Theme Horse Support Team.
-
AuthorPosts
-
January 29, 2016 at 12:53 pm #41990info178Participant
Hello,
I’ve just bought the Ultimate Pro theme and I would like to add a link to the single image on the Our Team page, redirecting to another page. I’ve read in a previous topic that you suggest to create a child theme and customize your own widget. But I can’t find where the parent widget is in order to copy it in the child theme “functions.php” file. Can you help me?Also have you any suggestion how to assign the “Business Page” Layout to multiple pages? I know it needs customization, but have you any advice to give me? I’m new with the code.
Thanks in advance.
DésiréeFebruary 1, 2016 at 11:08 am #42083Theme Horse Support TeamKeymasterHi Désirée,
Yes you are right. If you like to add a link to the single image on the our team page, it needs code customization. So you need to create a child theme. Make a copy of your parent theme. For this you need some thing about coding too. The parent widgets code is inside the theme folder -> inc -> widgets-> ultimate_widgets.php
Goto line no 130 you will see this.
register_widget("ultimate_ourteam_widget");
Create a new widgets nameregister_widget("ultimate_child_ourteam_widget");
in your child theme.
again copy that team widgets class functions fromline no 838 to 1010
to your child theme and customize the code.
class ultimate_ourteam_widget extends WP_Widget {
toclass ultimate_child_ourteam_widget extends WP_Widget {
To create a multiple business page Create a page and select the template name (our team, services, testimonial). This template cannot be used for twice or many. If above template is not using then you can assign that template and drag and drop the widgets to their section.
If you want a new template and widgets then you have to customize the code and there will be lots of code customization. So you need to hire a developer.
Thank you!
February 3, 2016 at 4:23 pm #42212info178ParticipantHello,
thank you for your reply.
I’ve managed to create a child theme and duplicate the widget. However I have no idea how to add a link in there because I do not have sufficient knowledge of the PHP language. Do you plan to insert this type of modify on a future release? It would be very useful to have a link redirecting to a page or file.Also, regarding the field “name” “designation” and “description”, the field “name” and “designation” will show only if you fill the field “description” as well. There is the possibility to fill only the “name” and/or only the “designation”? I would like just to have a title, without any description.
Thanks in advance
DésiréeFebruary 4, 2016 at 7:13 am #42234Theme Horse Support TeamKeymasterHi info178,
Yes the field “name” “designation” and “description”, will show only if you fill the field “description”. You can add blank space to display it. As we have designed our theme this way.
Actually we are busy on working new projects and there is no any plan recently. To add link on images you have to add a text field on widgets and also extract the content on the front end. So new code customization is required.
Thank you!
February 4, 2016 at 7:29 am #42238Theme Horse Support TeamKeymasterOk just add below widgets in your child theme widgets. I have registered and added a link for image.
register_widget("ultimate_child_ourteam_widget"); /**************************************************************************************/ /** * Our Team widget */ class ultimate_child_ourteam_widget extends WP_Widget { function ultimate_child_ourteam_widget() { $widget_ops = array( 'classname' => 'widget_our_team', 'description' => __( 'Display Our Team ( Our Team Child Layout ) recommendation size ( 300 * 300 )px', 'ultimate' ) ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name = __( 'TH: Our Team Child', 'ultimate' ), $widget_ops, $control_ops); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'number' => '3', 'image1' => '', 'imageurl1' => '', 'text1' => '', 'name1' =>'', 'designation1'=>'','image2'=>'', 'imageurl2' => '','text2'=>'','name2'=>'','designation2'=>'','image3' => '','imageurl3' => '', 'text3' => '', 'name3' =>'', 'designation3'=>'' ) ); $title = strip_tags($instance['title']); $number = absint( $instance[ 'number' ] ); for ( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url( $instance[ $image ] ); $instance[ $imageurl ] = esc_url( $instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $instance[ $name ] ); $instance[ $designation ] = strip_tags( $instance[ $designation ] ); $instance[ $text ] = strip_tags( $instance[ $text ] ); } ?> <p> <label for="<?php echo $this->get_field_id('number'); ?>"> <?php _e( 'Number of OurTeam:', 'ultimate' ); ?> </label> <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /> <input type="submit" name="savewidget" id="widget-ultimate_ourteam_widget-2-savewidget" class="button button-primary widget-control-save right" value="Save"> <span class="spinner" style="display: none;"></span> </p> <p> <label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title:', 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> </p> <p> </p> <?php for ( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url( $instance[ $image ] ); $instance[ $imageurl ] = esc_url( $instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $instance[ $name ] ); $instance[ $designation ] = strip_tags( $instance[ $designation ] ); $instance[ $text ] = strip_tags( $instance[ $text ] ); ?> <p> <input type="text" class="upload1" id="<?php echo $this->get_field_id($image); ?>" name="<?php echo $this->get_field_name($image); ?>" value="<?php if(isset ( $instance[$image] ) ) echo esc_url( $instance[$image] ); ?>"/> <input type="button" class="button custom_media_button"name="<?php echo $this->get_field_name($image); ?>" id="custom_media_button_services" value="<?php echo esc_attr( 'Add Image','ultimate'); ?>" onclick="mediaupload.uploader( '<?php echo $this->get_field_id($image); ?>' ); return false;"/> </p> <p> <label for="<?php echo $this->get_field_id('imageurl'); ?>"> <?php _e( 'Image Url '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($imageurl); ?>" name="<?php echo $this->get_field_name($imageurl); ?>" type="text" value="<?php if(isset ( $instance[$imageurl] ) ) echo esc_attr( $instance[$imageurl] ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('name'); ?>"> <?php _e( 'Name '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($name); ?>" name="<?php echo $this->get_field_name($name); ?>" type="text" value="<?php if(isset ( $instance[$name] ) ) echo esc_attr( $instance[$name] ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('designation'); ?>"> <?php _e( 'Designation '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($designation); ?>" name="<?php echo $this->get_field_name($designation); ?>" type="text" value="<?php if(isset ( $instance[$designation] ) ) echo esc_attr( $instance[$designation] ); ?>" /> </p> <?php _e( 'OurTeam Description '.$i,'ultimate'); ?> <textarea class="widefat" rows="8" cols="20" id="<?php echo $this->get_field_id($text); ?>" name="<?php echo $this->get_field_name($text); ?>"><?php if(isset ( $instance[$text] ) ) echo esc_attr( $instance[$text] ); ?></textarea> <p> </p> <hr> <p> </p> <?php } } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = absint( $new_instance['number'] ); for( $i=1; $i<=$instance['number']; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url_raw( $new_instance[ $image ] ); $instance[ $imageurl ] = esc_url_raw( $new_instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $new_instance[ $name ] ); $instance[ $designation ] = strip_tags( $new_instance[ $designation ] ); $instance[ $text ] = strip_tags( $new_instance[ $text ] ); } return $instance; } function widget( $args, $instance ) { extract($args); global $options, $array_of_default_settings; $options = wp_parse_args( get_option( 'ultimate_theme_options', array() ), ultimate_get_option_defaults()); $title = empty( $instance['title'] ) ? '' : $instance['title']; $number = empty( $instance['number'] ) ? 2 : $instance['number']; $image_array = array(); $imageurl_array = array(); $name_array = array(); $designation_array = array(); $text_array = array(); for( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $image = isset( $instance[ $image ] ) ? $instance[ $image ] : ''; $imageurl = isset( $instance[ $imageurl ] ) ? $instance[ $imageurl ] : ''; $name = isset( $instance[ $name ] ) ? $instance[ $name ] : ''; $designation = isset( $instance[ $designation ] ) ? $instance[ $designation ] : ''; $text = isset( $instance[ $text ] ) ? $instance[ $text ] : ''; if( !empty( $image ) || !empty( $name ) || !empty( $designation ) || !empty( $text )) { if( !empty( $image ) ) array_push( $image_array, $image ); // Push the page id in the array else array_push($image_array, ""); if( !empty( $name ) ) array_push( $name_array, $name ); // Push the page id in the array else array_push($name_array, ""); if( !empty( $designation ) ) array_push( $designation_array, $designation ); // Push the page id in the array else array_push($designation_array, ""); if( !empty( $text ) ) array_push( $text_array, $text ); // Push the page id in the array else array_push($text_array, ""); } } echo $before_widget; echo '<div class="container clearfix">'; if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } ?> <div class="column clearfix"> <?php $j = 1; for( $i=0; $i<$number; $i++ ) { if( $j % 4 == 1 && $j > 1 ) { $ourteam_class = "one-fourth clearfix-half-team clearfix-fourth"; } elseif ( $j % 3 == 1 && $j > 1 ) { if($j<=4 || $j==10){ $ourteam_class = "one-fourth clearfix-third-team"; }else{ $ourteam_class = "one-fourth clearfix-half-team clearfix-third-team"; } } elseif ($j % 2 == 1 && $j > 1 ) { $ourteam_class = "one-fourth clearfix-half-team"; } else{ $ourteam_class = "one-fourth"; } ?> <?php if(!empty($image_array[$i]) || !empty($text_array[$i])){?> <div class="<?php echo $ourteam_class; ?>"> <?php if(!empty($image_array[$i])){ ?> <div class="our-team-photo"> <a href ="<?php echo $imageurl_array[$i]; ?>"><img src="<?php echo $image_array[$i]; ?>" title="<?php if(!empty($name_array[$i])){ echo $name_array[$i]; } ?>" alt="<?php if(!empty($image_array[$i])){ echo $name_array[$i]; }?>" /> </a></div> <?php } if(!empty($text_array[$i])){?> <div class="our-team-content"> <h3 class="our-team-name"><?php if(!empty($name_array[$i])){ echo $name_array[$i]; } ?></h3> <div class="our-team-designation"><?php if(!empty($designation_array[$i])){ echo' - '; echo $designation_array[$i]; }?></div> <p><?php echo $text_array[$i]; ?></p> </div><!-- .our-team-content --> <?php } ?> </div><!-- .one-fourth --> <?php } ?> <?php $j++ ; } ?> </div> <?php echo '</div><!-- .container -->'; echo $after_widget; } }
Hope this may help you
Thank you!February 4, 2016 at 6:29 pm #42263info178ParticipantHello,
many thanks for your reply!
Thank you for the suggestion to add a space in the description and also thanks for the child widget.
Unfortunately it seems not functioning how it should. I see the fiel “Image Url”, but once I wrote the link and clicked “save” the link disappear from the field. In the pagesite you can see the hand when you roll over the image, but there’s no link.Maybe I’m doing something wrong?
The link should be http://www.example.com, right?Thanks in advance
DésiréeFebruary 5, 2016 at 8:41 am #42289Theme Horse Support TeamKeymasterhi sorry please check it
/**************************************************************************************/ /** * Our Team widget */ class ultimate_child_ourteam_widget extends WP_Widget { function ultimate_child_ourteam_widget() { $widget_ops = array( 'classname' => 'widget_our_team', 'description' => __( 'Display Our Team ( Our Team Child Layout ) recommendation size ( 300 * 300 )px', 'ultimate' ) ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name = __( 'TH: Our Team Child', 'ultimate' ), $widget_ops, $control_ops); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'number' => '3', 'image1' => '', 'imageurl1' => '', 'text1' => '', 'name1' =>'', 'designation1'=>'','image2'=>'', 'imageurl2' => '','text2'=>'','name2'=>'','designation2'=>'','image3' => '','imageurl3' => '', 'text3' => '', 'name3' =>'', 'designation3'=>'' ) ); $title = strip_tags($instance['title']); $number = absint( $instance[ 'number' ] ); for ( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url( $instance[ $image ] ); $instance[ $imageurl ] = esc_url( $instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $instance[ $name ] ); $instance[ $designation ] = strip_tags( $instance[ $designation ] ); $instance[ $text ] = strip_tags( $instance[ $text ] ); } ?> <p> <label for="<?php echo $this->get_field_id('number'); ?>"> <?php _e( 'Number of OurTeam:', 'ultimate' ); ?> </label> <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /> <input type="submit" name="savewidget" id="widget-ultimate_ourteam_widget-2-savewidget" class="button button-primary widget-control-save right" value="Save"> <span class="spinner" style="display: none;"></span> </p> <p> <label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title:', 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> </p> <p> </p> <?php for ( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url( $instance[ $image ] ); $instance[ $imageurl ] = esc_url( $instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $instance[ $name ] ); $instance[ $designation ] = strip_tags( $instance[ $designation ] ); $instance[ $text ] = strip_tags( $instance[ $text ] ); ?> <p> <input type="text" class="upload1" id="<?php echo $this->get_field_id($image); ?>" name="<?php echo $this->get_field_name($image); ?>" value="<?php if(isset ( $instance[$image] ) ) echo esc_url( $instance[$image] ); ?>"/> <input type="button" class="button custom_media_button"name="<?php echo $this->get_field_name($image); ?>" id="custom_media_button_services" value="<?php echo esc_attr( 'Add Image','ultimate'); ?>" onclick="mediaupload.uploader( '<?php echo $this->get_field_id($image); ?>' ); return false;"/> </p> <p> <label for="<?php echo $this->get_field_id('imageurl'); ?>"> <?php _e( 'Image Url '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($imageurl); ?>" name="<?php echo $this->get_field_name($imageurl); ?>" type="text" value="<?php if(isset ( $instance[$imageurl] ) ) echo esc_attr( $instance[$imageurl] ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('name'); ?>"> <?php _e( 'Name '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($name); ?>" name="<?php echo $this->get_field_name($name); ?>" type="text" value="<?php if(isset ( $instance[$name] ) ) echo esc_attr( $instance[$name] ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('designation'); ?>"> <?php _e( 'Designation '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($designation); ?>" name="<?php echo $this->get_field_name($designation); ?>" type="text" value="<?php if(isset ( $instance[$designation] ) ) echo esc_attr( $instance[$designation] ); ?>" /> </p> <?php _e( 'OurTeam Description '.$i,'ultimate'); ?> <textarea class="widefat" rows="8" cols="20" id="<?php echo $this->get_field_id($text); ?>" name="<?php echo $this->get_field_name($text); ?>"><?php if(isset ( $instance[$text] ) ) echo esc_attr( $instance[$text] ); ?></textarea> <p> </p> <hr> <p> </p> <?php } } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = absint( $new_instance['number'] ); for( $i=1; $i<=$instance['number']; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url_raw( $new_instance[ $image ] ); $instance[ $imageurl ] = esc_url_raw( $new_instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $new_instance[ $name ] ); $instance[ $designation ] = strip_tags( $new_instance[ $designation ] ); $instance[ $text ] = strip_tags( $new_instance[ $text ] ); } return $instance; } function widget( $args, $instance ) { extract($args); global $options, $array_of_default_settings; $options = wp_parse_args( get_option( 'ultimate_theme_options', array() ), ultimate_get_option_defaults()); $title = empty( $instance['title'] ) ? '' : $instance['title']; $number = empty( $instance['number'] ) ? 2 : $instance['number']; $image_array = array(); $imageurl_array = array(); $name_array = array(); $designation_array = array(); $text_array = array(); for( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $image = isset( $instance[ $image ] ) ? $instance[ $image ] : ''; $imageurl = isset( $instance[ $imageurl ] ) ? $instance[ $imageurl ] : ''; $name = isset( $instance[ $name ] ) ? $instance[ $name ] : ''; $designation = isset( $instance[ $designation ] ) ? $instance[ $designation ] : ''; $text = isset( $instance[ $text ] ) ? $instance[ $text ] : ''; if( !empty( $image ) || !empty( $name ) || !empty( $designation ) || !empty( $text )) { if( !empty( $image ) ) array_push( $image_array, $image ); // Push the page id in the array else array_push($image_array, ""); if( !empty( $name ) ) array_push( $name_array, $name ); // Push the page id in the array else array_push($name_array, ""); if( !empty( $designation ) ) array_push( $designation_array, $designation ); // Push the page id in the array else array_push($designation_array, ""); if( !empty( $text ) ) array_push( $text_array, $text ); // Push the page id in the array else array_push($text_array, ""); } } echo $before_widget; echo '<div class="container clearfix">'; if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } ?> <div class="column clearfix"> <?php $j = 1; for( $i=0; $i<$number; $i++ ) { if( $j % 4 == 1 && $j > 1 ) { $ourteam_class = "one-fourth clearfix-half-team clearfix-fourth"; } elseif ( $j % 3 == 1 && $j > 1 ) { if($j<=4 || $j==10){ $ourteam_class = "one-fourth clearfix-third-team"; }else{ $ourteam_class = "one-fourth clearfix-half-team clearfix-third-team"; } } elseif ($j % 2 == 1 && $j > 1 ) { $ourteam_class = "one-fourth clearfix-half-team"; } else{ $ourteam_class = "one-fourth"; } ?> <?php if(!empty($image_array[$i]) || !empty($text_array[$i])){?> <div class="<?php echo $ourteam_class; ?>"> <?php if(!empty($image_array[$i])){ ?> <div class="our-team-photo"> <a href ="<?php echo $imageurl_array[$i]; ?>"><img src="<?php echo $image_array[$i]; ?>" title="<?php if(!empty($name_array[$i])){ echo $name_array[$i]; } ?>" alt="<?php if(!empty($image_array[$i])){ echo $name_array[$i]; }?>" /> </a></div> <?php } if(!empty($text_array[$i])){?> <div class="our-team-content"> <h3 class="our-team-name"><?php if(!empty($name_array[$i])){ echo $name_array[$i]; } ?></h3> <div class="our-team-designation"><?php if(!empty($designation_array[$i])){ echo' - '; echo $designation_array[$i]; }?></div> <p><?php echo $text_array[$i]; ?></p> </div><!-- .our-team-content --> <?php } ?> </div><!-- .one-fourth --> <?php } ?> <?php $j++ ; } ?> </div> <?php echo '</div><!-- .container -->'; echo $after_widget; } }
This must work now
Thank you!February 5, 2016 at 4:29 pm #42300info178ParticipantHello,
many thanks for your support.
I’m sorry to bother you again, but it’s not working. The link now stays once saved, but doesn’t work on the web site.http://desireegottardi.ilbello.com/test2/prodotti-2/
Can you check it?
Thanks in advance
DésiréeFebruary 8, 2016 at 6:31 am #42351Theme Horse Support TeamKeymasterHi Thanks for reporting that its not working.
Paste below code/* Start */ class ultimate_child_ourteam_widget extends WP_Widget { function ultimate_child_ourteam_widget() { $widget_ops = array( 'classname' => 'widget_our_team', 'description' => __( 'Display Our Team ( Our Team Child Layout ) recommendation size ( 300 * 300 )px', 'ultimate' ) ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name = __( 'TH: Our Team Child', 'ultimate' ), $widget_ops, $control_ops); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'number' => '3', 'image1' => '', 'imageurl1' => '', 'text1' => '', 'name1' =>'', 'designation1'=>'','image2'=>'', 'imageurl2' => '','text2'=>'','name2'=>'','designation2'=>'','image3' => '','imageurl3' => '', 'text3' => '', 'name3' =>'', 'designation3'=>'' ) ); $title = strip_tags($instance['title']); $number = absint( $instance[ 'number' ] ); for ( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url( $instance[ $image ] ); $instance[ $imageurl ] = esc_url( $instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $instance[ $name ] ); $instance[ $designation ] = strip_tags( $instance[ $designation ] ); $instance[ $text ] = strip_tags( $instance[ $text ] ); } ?> <p> <label for="<?php echo $this->get_field_id('number'); ?>"> <?php _e( 'Number of OurTeam:', 'ultimate' ); ?> </label> <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /> <input type="submit" name="savewidget" id="widget-ultimate_ourteam_widget-2-savewidget" class="button button-primary widget-control-save right" value="Save"> <span class="spinner" style="display: none;"></span> </p> <p> <label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title:', 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> </p> <p> </p> <?php for ( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url( $instance[ $image ] ); $instance[ $imageurl ] = esc_url( $instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $instance[ $name ] ); $instance[ $designation ] = strip_tags( $instance[ $designation ] ); $instance[ $text ] = strip_tags( $instance[ $text ] ); ?> <p> <input type="text" class="upload1" id="<?php echo $this->get_field_id($image); ?>" name="<?php echo $this->get_field_name($image); ?>" value="<?php if(isset ( $instance[$image] ) ) echo esc_url( $instance[$image] ); ?>"/> <input type="button" class="button custom_media_button"name="<?php echo $this->get_field_name($image); ?>" id="custom_media_button_services" value="<?php echo esc_attr( 'Add Image','ultimate'); ?>" onclick="mediaupload.uploader( '<?php echo $this->get_field_id($image); ?>' ); return false;"/> </p> <p> <label for="<?php echo $this->get_field_id('imageurl'); ?>"> <?php _e( 'Image Url '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($imageurl); ?>" name="<?php echo $this->get_field_name($imageurl); ?>" type="text" value="<?php if(isset ( $instance[$imageurl] ) ) echo esc_attr( $instance[$imageurl] ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('name'); ?>"> <?php _e( 'Name '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($name); ?>" name="<?php echo $this->get_field_name($name); ?>" type="text" value="<?php if(isset ( $instance[$name] ) ) echo esc_attr( $instance[$name] ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('designation'); ?>"> <?php _e( 'Designation '.$i, 'ultimate' ); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id($designation); ?>" name="<?php echo $this->get_field_name($designation); ?>" type="text" value="<?php if(isset ( $instance[$designation] ) ) echo esc_attr( $instance[$designation] ); ?>" /> </p> <?php _e( 'OurTeam Description '.$i,'ultimate'); ?> <textarea class="widefat" rows="8" cols="20" id="<?php echo $this->get_field_id($text); ?>" name="<?php echo $this->get_field_name($text); ?>"><?php if(isset ( $instance[$text] ) ) echo esc_attr( $instance[$text] ); ?></textarea> <p> </p> <hr> <p> </p> <?php } } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = absint( $new_instance['number'] ); for( $i=1; $i<=$instance['number']; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $instance[ $image ] = esc_url_raw( $new_instance[ $image ] ); $instance[ $imageurl ] = esc_url_raw( $new_instance[ $imageurl ] ); $instance[ $name ] = strip_tags( $new_instance[ $name ] ); $instance[ $designation ] = strip_tags( $new_instance[ $designation ] ); $instance[ $text ] = strip_tags( $new_instance[ $text ] ); } return $instance; } function widget( $args, $instance ) { extract($args); global $options, $array_of_default_settings; $options = wp_parse_args( get_option( 'ultimate_theme_options', array() ), ultimate_get_option_defaults()); $title = empty( $instance['title'] ) ? '' : $instance['title']; $number = empty( $instance['number'] ) ? 2 : $instance['number']; $image_array = array(); $imageurl_array = array(); $name_array = array(); $designation_array = array(); $text_array = array(); for( $i=1; $i<=$number; $i++ ) { $image = 'image'.$i; $imageurl = 'imageurl'.$i; $name = 'name'.$i; $designation = 'designation'.$i; $text = 'text'.$i; $image = isset( $instance[ $image ] ) ? $instance[ $image ] : ''; $imageurl = isset( $instance[ $imageurl ] ) ? $instance[ $imageurl ] : ''; $name = isset( $instance[ $name ] ) ? $instance[ $name ] : ''; $designation = isset( $instance[ $designation ] ) ? $instance[ $designation ] : ''; $text = isset( $instance[ $text ] ) ? $instance[ $text ] : ''; if( !empty( $image ) || !empty( $name ) || !empty( $designation ) || !empty( $text )) { if( !empty( $image ) ) array_push( $image_array, $image ); // Push the page id in the array else array_push($image_array, ""); if( !empty( $imageurl ) ) array_push( $imageurl_array, $imageurl ); // Push the page id in the array else array_push($image_array, ""); if( !empty( $name ) ) array_push( $name_array, $name ); // Push the page id in the array else array_push($name_array, ""); if( !empty( $designation ) ) array_push( $designation_array, $designation ); // Push the page id in the array else array_push($designation_array, ""); if( !empty( $text ) ) array_push( $text_array, $text ); // Push the page id in the array else array_push($text_array, ""); } } echo $before_widget; echo '<div class="container clearfix">'; if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } ?> <div class="column clearfix"> <?php $j = 1; for( $i=0; $i<$number; $i++ ) { if( $j % 4 == 1 && $j > 1 ) { $ourteam_class = "one-fourth clearfix-half-team clearfix-fourth"; } elseif ( $j % 3 == 1 && $j > 1 ) { if($j<=4 || $j==10){ $ourteam_class = "one-fourth clearfix-third-team"; }else{ $ourteam_class = "one-fourth clearfix-half-team clearfix-third-team"; } } elseif ($j % 2 == 1 && $j > 1 ) { $ourteam_class = "one-fourth clearfix-half-team"; } else{ $ourteam_class = "one-fourth"; } ?> <?php if(!empty($image_array[$i]) || !empty($text_array[$i])){?> <div class="<?php echo $ourteam_class; ?>"> <?php if(!empty($image_array[$i])){ ?> <div class="our-team-photo"> <?php if(!empty($imageurl_array[$i])){ ?><a href ="<?php echo $imageurl_array[$i]; ?>"> <?php } ?><img src="<?php echo $image_array[$i]; ?>" title="<?php if(!empty($name_array[$i])){ echo $name_array[$i]; } ?>" alt="<?php if(!empty($image_array[$i])){ echo $name_array[$i]; }?>" /> <?php if(!empty($imageurl_array[$i])){ ?></a> <?php } ?></div> <?php } if(!empty($text_array[$i])){?> <div class="our-team-content"> <h3 class="our-team-name"><?php if(!empty($name_array[$i])){ echo $name_array[$i]; } ?></h3> <div class="our-team-designation"><?php if(!empty($designation_array[$i])){ echo' - '; echo $designation_array[$i]; }?></div> <p><?php echo $text_array[$i]; ?></p> </div><!-- .our-team-content --> <?php } ?> </div><!-- .one-fourth --> <?php } ?> <?php $j++ ; } ?> </div> <?php echo '</div><!-- .container -->'; echo $after_widget; } }
Hope this may help you
Thank you!February 12, 2016 at 6:05 pm #42538info178ParticipantHello,
many thanks, it works great!
I really appreciated you help and support.Thanks a lot
DésiréeFebruary 15, 2016 at 5:24 am #42596Theme Horse Support TeamKeymasterHi Désirée,
Could you also please help us rating this theme in WordPress Repository.
https://wordpress.org/support/view/theme-reviews/ultimate
We really appreciate your rating.Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.