Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #165622
    angrybird
    Participant

    Just bought Fullscreen Pro. Your webpage says “Glance over our Multilingual WordPress themes with built-in multilingual support. Supports plugin like WPML, Polylang and qTranslate.”

    I’m using Polylang (WPML-compatibility enabled), but cannot figure out how to translate the Header Media Title or Header Media Text. It does not show up in the Textstring-translations, nor anywhere else.

    What to do?

    #165663
    Skandha
    Keymaster

    @ville123: Please post in your site URL so that I can look into the issue.

    Kind Regards,
    Skandha

    #165683
    angrybird
    Participant
    #165755
    angrybird
    Participant

    Any ideas?

    #165758
    Skandha
    Keymaster

    @ville123: First of all you will need to create a child theme to translate the header media title using Polylang. Let me know if you are familiar with child theme customization so that I can guide you how to do it.

    Kind Regards,
    Skandha

    #165775
    angrybird
    Participant

    I have created a child theme and it is active (has been all along).

    #165823
    Skandha
    Keymaster

    @ville123: Go to => Child Theme folder => functions.php and add the following Code.

    function polylang_translation() {
     	if ( function_exists( 'pll_register_string' ) ) {
    	 	$header_media_title = get_theme_mod( 'catch_fullscreen_header_media_title', esc_html__( 'Dancing Under The Sky', 'catch-fullscreen-pro' ) );
    		pll_register_string( 'catch_fullscreen_header_media_title', $header_media_title, 'Catch Fullscreen Pro' ); //die('aaaa');
    	}
    }
    add_action ( 'admin_init', 'polylang_translation' );
    
    function catch_fullscreen_header_title( $before = '', $after = '' ) {
    		if ( is_front_page() ) {
    			$header_media_title = get_theme_mod( 'catch_fullscreen_header_media_title', esc_html__( 'Dancing Under The Sky', 'catch-fullscreen-pro' ) );
    
    			if ( $header_media_title ) {
    				if( class_exists( 'Polylang' ) ) {
    					echo $before . pll__( $header_media_title ) . $after;
    				}
    				else{
    					echo $before . wp_kses_post( $header_media_title ) . $after;
    				}
    			}
    		} elseif ( is_singular() ) {
    			if ( is_page() ) {
    				if( ! get_theme_mod( 'catch_fullscreen_single_page_title' ) ) {
    					the_title( $before, $after );
    				}
    			} else {
    				the_title( $before, $after );
    			}
    		} elseif ( is_404() ) {
    			echo $before . esc_html__( 'Nothing Found', 'catch-fullscreen-pro' ) . $after;
    		} elseif ( is_search() ) {
    			/* translators: %s: search query. */
    			echo $before . sprintf( esc_html__( 'Search Results for: %s', 'catch-fullscreen-pro' ), '<span>' . get_search_query() . '</span>' ) . $after;
    		} else {
    			the_archive_title( $before, $after );
    		}
    	}

    Now, you should be able to translate the Header Media Title when you Go to => Dashboard => Languages => String Translation.

    Let me know if this works out!
    Kind Regards,
    Skandha

    #166725
    angrybird
    Participant

    Yes it worked, thank you!

    #166814
    Skandha
    Keymaster

    @ville123: Hello there, I hope I was able to resolve your issue. If it’s not too much trouble, I have a quick request: could you please leave an honest review?
    https://wordpress.org/support/theme/catch-fullscreen/reviews/#new-post
    Your review will help others know what to expect when they’re looking for the support I offer. Even a sentence or two would be hugely appreciated. Thanks, and if there’s anything else at all that I can do to help, don’t hesitate to let me know. Have a good day! 🙂

    Kind Regards,
    Skandha

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Header media title and Polylang’ is closed to new replies.