WordPress.org

Ready to get started?Download WordPress

Forums

Ceceppa Multilingua
[resolved] Site Title/Tagline not translating with my theme. (13 posts)

  1. joshisanonymous
    Member
    Posted 5 months ago #

    I'm using the theme Grey Opaque and the translated site title/tagline doesn't get translated. It shows the translation on mouse-over but not for just the normal display.

    I have no idea how to manual edit themes but I found the following in the header.php file for the theme and I'm hoping there's something that can be changed to make the translation of the title/tagline work properly:

    <title><?php
    	/**
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title('|', true, 'right');
    
    	// Add the blog name.
    	bloginfo('name');
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo('description', 'display');
    	if($site_description && (is_home() || is_front_page())) {
    		echo " | $site_description";
    	}
    
    	// Add a page number if necessary:
    	if($paged >= 2 || $page >= 2) {
    		echo ' | ' . sprintf(__('Page %s', 'grey-opaque'), max($paged, $page));
    	}
    
    	?></title>

    What could be going on here?

    http://wordpress.org/plugins/ceceppa-multilingua/

  2. Alessandro Senese
    Member
    Plugin Author

    Posted 5 months ago #

    Hi,
    I tested your code and works correctly for me...
    What is your website address?

  3. joshisanonymous
    Member
    Posted 5 months ago #

    http://joshmcneill.com/testblog2lang/

    The title and tagline appear in English regardless of the language but some part of it is working because the mouse-over for the title in French gives a translation.

  4. Alessandro Senese
    Member
    Plugin Author

    Posted 5 months ago #

    Seen...
    Can you past the code inside '<div id="branding" role="banner">'?
    Probabily you can find it in "header.php"

  5. joshisanonymous
    Member
    Posted 5 months ago #

    Certainly. I found it in functions.php:

    if(!function_exists('greyopaque_set_branding')) {
    	function greyopaque_set_branding() {
    		$heading_tag = (is_home() || is_front_page()) ? 'h1' : 'div';
    
    		echo '
    		<div id="branding" role="banner">
    			<' . $heading_tag . ' id="site-title">
    				<span>
    					<a href="' . home_url('/') . '" title="' . esc_attr(get_bloginfo('name', 'display')) . '" rel="home">' . get_bloginfo('name') . '</a>
    				</span>
    			</' . $heading_tag . '>
    			<div id="site-description">' . get_bloginfo('description') . '</div>
    		</div><!-- #branding -->';
    	}
    
    	if(isset($array_GreyOpaqueOptions['show-branding']) && $array_GreyOpaqueOptions['show-branding'] == 'on') {
    		add_action('greyopaque_header', 'greyopaque_set_branding');
    	}
    }
  6. Alessandro Senese
    Member
    Plugin Author

    Posted 5 months ago #

    Hi,
    I found the solution....
    Add the paramter 'display' to function get_bloginfo... replace:

    ' . get_bloginfo('name') . '

    with

    ' . get_bloginfo('name','display') . '

    and:

    <div id="site-description">' . get_bloginfo('description') . '</div>

    with:

    <div id="site-description">' . get_bloginfo('description', 'display') . '</div>

  7. joshisanonymous
    Member
    Posted 5 months ago #

    That did the trick. Thanks! Glad I can use your plugin since none of the others like it even came close to working well for me.

  8. doukeshi
    Member
    Posted 5 months ago #

    Hi.

    I have a problem with the translation of the site description, but I'm not sure the problem is the same. I can see the option in the plugin settings, and I change the text. Seems to be fine, no error. But if I go back to the same settings, I find that the short description is the same as the original version, ie, the one in the main language.
    If I translate the name of the site, I can see it properly.

    My site is http://www.telecoindustrial.com

    thanks

  9. Alessandro Senese
    Member
    Plugin Author

    Posted 5 months ago #

    Which theme are you using?

  10. doukeshi
    Member
    Posted 5 months ago #

    It's Techozoid Fluid

  11. Alessandro Senese
    Member
    Plugin Author

    Posted 5 months ago #

    Hi,
    It's the same problem of the other user...
    You have to modify the line #105 of "header.php" from:

    /"><?php bloginfo( 'name' ); ?>

    in:

    /"><?php bloginfo( 'name', 'display' ); ?>

    if you do not know how to do contact me here http://www.alessandrosenese.eu/contatti and I'll send the modified file

    Regards

  12. doukeshi
    Member
    Posted 5 months ago #

    Hi,

    Problem solved. You are right it was the same problem, but I didn't have to change the #105 line, but the same you said in the previous posts.

    Just in case somebody asks in the future, I paste here that piece of code:

    <?php } else {
    ?>
    /"><?php bloginfo( 'name' ); ?>
    <?php
    }
    if ( is_single() || is_page() || ($post_type == 'forum' || $post_type == 'topic' || $post_type == 'reply') ) {
    echo "</span>";
    } else {
    echo "</h1>";
    }
    if ( is_single() & of_get_option( 'blog_title_text', 'single' ) == "single" ) {
    $description = "" . get_bloginfo( 'name', 'display' ) . "";
    } else {
    $description = get_bloginfo( 'description', 'display' );
    }
    if ( !empty( $description ) ) {
    ?>
    <span class="description"><?php echo $description; ?></span>
    <?php }
    ?>
    </div><!--end headerimg-->
    </div><!--end headerimgwrap-->

    Thanks for your help. Your work is awesome.

    grazie

  13. Alessandro Senese
    Member
    Plugin Author

    Posted 5 months ago #

    You're welcome :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags