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*

Emilio José

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: WPML translations #40180
    Emilio José
    Participant

    This code was added to functions.php file on my child theme.

    Kind regards.

    in reply to: WPML translations #40175
    Emilio José
    Participant
    
    /**
     * Añade soporte para WPML
     */
    function apg_wpml() {	
    	global $array_of_default_settings;
    	
    	$options = wp_parse_args( get_option( 'interface_theme_options', array() ), interface_get_option_defaults() );
    	
    	if ( function_exists( 'icl_object_id' ) ) { //Registramos los textos en WPML
    		do_action( 'wpml_register_single_string', 'apg_interface', 'home_slogan1', $options['home_slogan1'] );
    		do_action( 'wpml_register_single_string', 'apg_interface', 'home_slogan2', $options['home_slogan2'] );
    		do_action( 'wpml_register_single_string', 'apg_interface', 'footer_code', $options['footer_code'] );
    	}
    }
    add_action( 'init', 'apg_wpml', 15 );
    
    if ( ! function_exists( 'interface_home_slogan' ) ) :
    
    /**
     * Display Home Slogan.
     *
     * Function that enable/disable the home slogan1 and home slogan2.
     */
    function interface_home_slogan() {	
    	global $array_of_default_settings;
    	
     	$options = wp_parse_args( get_option( 'interface_theme_options', array() ), interface_get_option_defaults() );
    	
    	$home_slogan1	= $options['home_slogan1'];
    	$home_slogan2	= $options['home_slogan2'];
    	if ( function_exists( 'icl_object_id' ) ) { //Versión 3.2 o superior
    		$home_slogan1	= apply_filters( 'wpml_translate_single_string', $options['home_slogan1'], 'apg_interface', 'home_slogan1' );
    		$home_slogan2	= apply_filters( 'wpml_translate_single_string', $options['home_slogan2'], 'apg_interface', 'home_slogan2' );
    	}
    	
    	$interface_home_slogan = '';
    	if( !empty( $home_slogan1 ) || !empty( $home_slogan2 ) ) {
          
    		if ( 1 != $options[ 'disable_slogan' ] ) {
    			$interface_home_slogan .= '<section class="slogan-wrap"><div class="container"><div class="slogan">';
    			if ( !empty( $home_slogan1 ) ) {
    				$interface_home_slogan .= esc_html( $home_slogan1 );
    			}
    			if ( !empty( $home_slogan2 ) ) {
    				$interface_home_slogan .= '<span>'.esc_html( $home_slogan2 ).'</span>';
    			}
    			$interface_home_slogan .= '</div><!-- .slogan -->';
    			$interface_home_slogan .= '</div><!-- .container --></section><!-- .slogan-wrap -->';
    		}
    		
    	}	
    	echo $interface_home_slogan;
    }
    endif;
    
    /**
     * function to show the footer info, copyright information
     */
    function apg_interface_footer_info() {         
    	global $array_of_default_settings;
    	
     	$options = wp_parse_args( get_option( 'interface_theme_options', array() ), interface_get_option_defaults() );
    
    	$footer_code	= $options['footer_code'];
    	if ( function_exists( 'icl_object_id' ) ) { //Versión 3.2 o superior
    		$footer_code	= apply_filters( 'wpml_translate_single_string', $options['footer_code'], 'apg_interface', 'footer_code' );
    	}
    
        $interface_footer_info = '<div class="copyright">' . $footer_code . '</div><!-- .copyright -->';
       	echo do_shortcode( $interface_footer_info );
    }
    
    function sobrescribiendo_ganchos() {
    	remove_filter( 'interface_footer', 'interface_footer_info', 30 );
    	add_filter( 'interface_footer', 'apg_interface_footer_info', 30 );
    }
    add_action( 'after_setup_theme', 'sobrescribiendo_ganchos' );
    
Viewing 2 posts - 1 through 2 (of 2 total)