Support » Plugin: WPGlobus - Multilingual Everything! » WPGlobus both language appear on slider only

  • Resolved swtscp

    (@swtscp)


    <?php 
    function imax_ibanner_slider () {    
    
    	$arrslidestxt = array();
    
    	$template_dir = get_template_directory_uri();
    
    	$banner_text = esc_attr(get_theme_mod('banner_text', ''));
    
    	$text_alignment = esc_attr(get_theme_mod('itrans_align', 'nxs-left'));
    
    	$banner_overlay = esc_attr(get_theme_mod('itrans_overlay', 'nxs-semitrans'));
    
    	$itrans_sliderparallax = get_theme_mod('itrans_sliderparallax', 1);	
    
    	$sliderscpeed = intval(esc_attr(get_theme_mod('itrans_sliderspeed', '6'))) * 1000 ;		
    
    		
    
    	$upload_dir = wp_upload_dir();
    
    	$upload_base_dir = $upload_dir['basedir'];
    
    	$upload_base_url = $upload_dir['baseurl'];		
    
    	
    
        for($slideno=1;$slideno<=4;$slideno++){
    
    			$strret = '';
    
    			$slide_title = esc_attr(get_theme_mod('itrans_slide'.$slideno.'_title', 'Welcome To i-MAX'));
    
    			$slide_desc = esc_attr(get_theme_mod('itrans_slide'.$slideno.'_desc', 'To start setting up i-max go to appearance > customize. Make sure you have installed recommended plugin “TemplatesNext Toolkit” by going appearance > install plugin.'));
    
    			$slide_linktext = esc_attr(get_theme_mod('itrans_slide'.$slideno.'_linktext', 'Know More'));
    
    			$slide_linkurl = esc_url(get_theme_mod('itrans_slide'.$slideno.'_linkurl', 'http://www.templatesnext.org/icreate/?page_id=541'));
    
    			$slide_image = esc_url(get_theme_mod('itrans_slide'.$slideno.'_image', get_template_directory_uri() . '/images/slide'.$slideno.'.png'));
    
    			
    
    			$slider_image_id = imax_get_attachment_id_from_url( $slide_image );			
    
    			$slider_resized_image = wp_get_attachment_image( $slider_image_id, "imax-slider-thumb" );			
    
    			
    
    			if (!$slide_linktext)
    
    			{
    
    				$slide_linktext="Read more";
    
    			}
    
    	
    
    			if ($slide_title) {
    
    				if( $slide_image!='' ){
    
    					if( file_exists( str_replace($upload_base_url,$upload_base_dir,$slide_image) ) ){
    
    						$strret .= '<div class="da-img">' . $slider_resized_image .'</div>';
    
    					}
    
    					else
    
    					{
    
    						$slide_image = $template_dir.'/images/slide'.$slideno.'.png';
    
    						$strret .= '<div class="da-img noslide-image"><img src="'.$slide_image.'" alt="'.$slide_title.'" /></div>';					
    
    					}
    
    				}
    
    				else
    
    				{					
    
    					$slide_image = $template_dir.'/images/slide'.$slideno.'.png';
    
    					$strret .= '<div class="da-img noslide-image"><img src="'.$slide_image.'" alt="'.$slide_title.'" /></div>';
    
    				}
    
    				
    
    				$strret .= '<div class="slider-content-wrap"><div class="nx-slider-container">';
    
    				$strret .= '<h2>'.$slide_title.'</h2>';
    
    				$strret .= '<p>'.$slide_desc.'</p>';
    
    				$strret .= '<a href="'.$slide_linkurl.'" class="da-link">'.$slide_linktext.'</a>';
    
    				$strret .= '</div></div>';
    
    			}
    
    			if ($strret !=''){
    
    				$arrslidestxt[$slideno] = $strret;
    
    			}
    
    					
    
    	}
    
    	
    
    	if(count($arrslidestxt)>0){
    
    		echo apply_filters('the_head','<div class="ibanner '.$banner_overlay.' '.$text_alignment.'">');
    
    		echo apply_filters('the_da','	<div id="da-slider" class="da-slider" role="banner" data-slider-speed="'.$sliderscpeed.'" data-slider-parallax="'.$itrans_sliderparallax.'">');
    
    			
    
    		foreach ( $arrslidestxt as $slidetxt ) :
    
    			echo apply_filters('the_nxslider','<div class="nx-slider">');	
    
    				
    				echo apply_filters('the_text', $slidetxt);
    
    			echo '</div>';
    
    		endforeach;
    
    		echo '	</div>';
    
    		echo '</div>';
    
    	} else
    
    	{
    
            echo '<div class="iheader front">';
    
            echo '    <div class="titlebar">';
    
            echo '        <h1>';
    
    		
    
    		if ($banner_text) {
    
    			
    			echo apply_filters('banner_text', $banner_text);
    
    		} 
    
            echo '        </h1>';
    
    		echo ' 		  <h2>';
    
    			    		//bloginfo( 'description' );
    
    						//echo of_get_option('itrans_sub_slogan');
    
    		echo '		</h2>';
    
            echo '    </div>';
    
            echo '</div>';
    
    	}
    
        
    
    }

    This is the code i need to switch from french to enligsh now i have both languages at the same place i’ve red the documention here https://wpglobus.com/documentation/wpglobus-compatibility-with-themes-and-plugins/

    but it doesnt work and i’ve added the filter

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WPGlobus both language appear on slider only’ is closed to new replies.