badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Promobox with full width and Featured Clients / Products opening in same tab

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #36455
    Manuel
    Participant

    Hello Theme Horse Support

    I found the answers to most of my questions in the forum. two things I couldn’t find:

    1) On a normal / default page I entered the code for a Promobox:

    <section id="ambition_promobox_widget-4" class="widget widget_promotional_bar">
    <div class="promotional_bar_content" style="background-image:url('http://kibix.com/wordpress/wp-content/uploads/2015/09/bg3_mini.jpg');" >
    <div class="container clearfix"></div>
    </div>

    see here: Link

    but the width is only as wide as the content, not the full page width. how can I change that?

    2) I want to show our products on the home page (at the bottom), so I entered the Featured Clients/ Products Widget to the business page.

    Unfortunately, this opens a new page in a new tab. how to open something that is already on the website (same tab)? and why is the titel not showing? I added a text field to it, but this generates huge spaceings in between.

    Thank you for your help.

    #36527

    Hi Manuel,

    Sorry! You can not placed the Promo Widget code directly in the default page because we have designed this widget for only our Business, Services and Our Team Template but not for the default page.

    Thank you!

    #36529
    Manuel
    Participant

    ok. and what about the target:blank? to how change that in the “Featured Clients/ Products” Widget?

    #36614

    Hi Manuel,

    To get rid from target_blank and open the link in the same page while using “Featured Clients/ Products” Widget it needs code customize you have to hire a developer.

    Thank you!

    #36659
    Manuel
    Participant

    That’s what you call “Incredible Support” ?

    Pfff

    #36661

    Hi Manuel,

    We need to say that it needs code customization. If you are good at coding then you can easily customize the code by creating child theme. If you cannot create a child theme then first make a folder ambition-pro-child. Under that folder create a style.css file and functions.php file.
    Add below code inside style.css file

    /*
    Theme Name: Ambition Pro Child Theme
    Author: Self-Help WordPress User
    Template: ambition
    */
    
    @import url("../ambition/style.css"); 

    Under functions.php file of the child theme, create your widgets and register them. Just copy the parent widget, change the name of widget TH: Featured Clients/ Products to TH Child: Featured Clients/ Products, make customisation and create your custom widget. If you do this, the widgets of parent theme and child both will appear. Use your custom widget of child theme instead of the parent theme.

    Just add this below code in your functions.php file

    <?php 
    register_widget("ambition_featured_image__child_widget");
    
    /*********************************************************************************************************/
    class ambition_featured_image__child_widget extends WP_Widget {
    	function ambition_featured_image__child_widget() {
    		$widget_ops = array( 'classname' => 'widget_ourclients', 'description' => __( 'Display Featured Clients/ Products ( Business Layout )', 'ambition') );
    		$control_ops = array('width' => 200, 'height' => 250);
    		parent::__construct( false, $name='TH Child: Featured Clients/ Products', $widget_ops, $control_ops );
    	}
    	function form( $instance ) {		
    		$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'number' => '5', 'path0' => '', 'path1' => '', 'path2' => '', 'path3' => '', 'path4' => '', 'path5' => '', 'redirectlink0' => '', 'redirectlink1' => '', 'redirectlink2' => '', 'redirectlink3' => '', 'redirectlink4' => '', 'redirectlink5' => '') );	
    		$title = strip_tags($instance['title']);
    		$number = absint( $instance[ 'number' ] );	 
    		for ( $i=0; $i<$number; $i++ ) {
    			$var = 'path'.$i;
    			$var1 = 'redirectlink'.$i;
    			$instance[ $var ] = esc_url( $instance[ $var ] );
    			$instance[ $var1 ] = esc_url( $instance[ $var1 ] );
    		}		
    		?>
    		<p class="description">
    			<?php _e( 'Note: Recommended size for the image is 400px (width) and 150px (height). If you want more image adding fields then first enter the number and click on Save, this will allow you more image adding fields', 'ambition' ); ?>
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id('title'); ?>">
    				<?php _e('Image Title:', 'ambition'); ?>
    			</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>
    			<label for="<?php echo $this->get_field_id('number'); ?>">
    				<?php _e( 'Number of Images:', 'ambition' ); ?>
    			</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" />
    		</p>
    		<?php for ( $i=0; $i<$number; $i++ ) {
    			$var = 'path'.$i;
    			$var1 = 'redirectlink'.$i;
    			?>
    			<p>
    				<input type="text" class="upload1" id="<?php echo $this->get_field_id( $var ); ?>" name="<?php echo $this->get_field_name( $var ); ?>" value="<?php if(isset ( $instance[$var] ) ) echo esc_url( $instance[$var] ); ?>" />
    				<input class="button  custom_media_button" name="<?php echo $this->get_field_name( $var ); ?>" type="button" id="custom_media_button_services" value="<?php echo esc_attr( 'Add Image'); ?>"onclick="mediaupload.uploader( '<?php echo $this->get_field_id( $var ); ?>' ); return false;"/>
    				<br />
    			</p>
    			<p>
    				<?php _e('Redirect Link:', 'ambition'); ?>
    				<input class="widefat" name="<?php echo $this->get_field_name($var1); ?>" type="text" value="<?php if(isset ( $instance[$var1] ) ) echo esc_url( $instance[$var1] ); ?>" />
    			</p>
    			<?php } ?>
    			<?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=0; $i<$instance[ 'number' ]; $i++ ) {
    				$var = 'path'.$i;
    				$var1 = 'redirectlink'.$i;
    				$instance[ $var] = esc_url_raw( $new_instance[ $var ] );			
    				$instance[ $var1] = esc_url_raw( $new_instance[ $var1 ] );
    			}
    			return $instance;
    		}	
    		function widget( $args, $instance ) {
    			extract($args);
    			$title = empty( $instance['title'] ) ? '' : $instance['title'];
    			$number = empty( $instance['number'] ) ? 5 : $instance['number'];
    			$path_array = array();
    			$redirectlink_array = array();
    			for( $i=0; $i<$number; $i++ ) {
    				$var = 'path'.$i;
    				$var1 = 'redirectlink'.$i;
    				$path = isset( $instance[ $var ] ) ? $instance[ $var ] : '';
    				$redirectlink = isset( $instance[ $var1 ] ) ? $instance[ $var1 ] : ''; 			
    			if( !empty( $path )  || !empty( $redirectlink ))  {		
    				if( !empty( $path ) ){
     				array_push( $path_array, $path ); // Push the page id in the array
    		 			}else{
    		 			 array_push($path_array, "");
    		 			}
    	 			if( !empty( $redirectlink ) ){
    	 				array_push( $redirectlink_array, $redirectlink ); // Push the page id in the array
    		 			}else{
    		 			 array_push($redirectlink_array, "");
    		 			}
    		 		}
    	 		}
     		echo $before_widget;
     		if ( !empty( $path_array ) ) {
     			$output = '';
     			$output .= '<div class="container">';
     			$output .= '<ul>';
     			for( $i=0; $i<$number; $i++ ) {
     				$output .= '<li>';
     				if((!empty( $redirectlink_array[$i] )) || (!empty( $path_array[$i] )) ) {
     					$output .= '<a href="'.$redirectlink_array[$i].'" title="'.$title.'">
     					<img src="'.$path_array[$i].'" alt="'.$title.'">
     					</a>';
     				}
     				else {
     					if(!empty($path_array[$i])){
     						$output .= '<img src="'.$path_array[$i].'" alt="'.$title.'">';
     					}
     				}
     				$output .=	'</li>';
     			}
     			$output .= '</ul>';
    
     			$output .= '</div>';
    
     			echo $output;
     		}
     		echo $after_widget .'<!-- .widget_ourclients -->';
     	}
     }

    Hope this may help you
    Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.