- This topic has 4 replies, 2 voices, and was last updated 9 years ago by Theme Horse Support Team.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
December 2, 2015 at 2:47 pm #40166Emilio JoséParticipant
How can I translate Home Page Primary Slogan and Home Page Secondary Slogan, for example?
Kind regards.
December 3, 2015 at 10:23 am #40175Emilio 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' );
December 3, 2015 at 10:43 am #40176Theme Horse Support TeamKeymasterHI Emilio José,
As our theme is not compatible with WPML translations. We are a bit busy working on another projects. As it needs code customization. You need to hire a developer to fix it.
Before making any changes in code first you create a child theme so that while updating to new version your customization code will not be lost.
Thank you!
December 3, 2015 at 10:56 am #40180Emilio JoséParticipantThis code was added to functions.php file on my child theme.
Kind regards.
December 3, 2015 at 11:09 am #40181Theme Horse Support TeamKeymasterHi Emilio José,
You need to create wpml.xml file inside the root of the theme. Although we have not tested our theme with WPML. For this you need to hire a developer.
Thank you!
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.