Support » Theme: Hannari » Logo and Text

  • Resolved Vik999


    I am very new to wordpress,I don’t know if I did something wrong, I found I can only use text logo and descriptions on the header area. If I add a logo to the header, the text is not appearing beside the logo and the header area looking very empty. Do I have to add php code to header to display header text?

    <?php if ( of_get_option(‘logo_image’) ) { ?>
    “><img src=”<?php echo esc_url(of_get_option(‘logo_image’)); ?>” />

    <div class=”headertxt”>
    <?php echo esc_html(of_get_option(‘header_logo_text1’)); ?>
    <h1> <span style=”line-height:100%;”>
    <?php echo esc_html(of_get_option(‘header_logo_text2’)); ?>

    many thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey there.

    If you look at the code there it’s saying if there is a logo image defined then use that, else it checks is the header_logo_text1 exists and if it does then it does this:

    <h1 class="textlogo"><a href="<?php echo esc_url(home_url('/')); ?>"><?php echo esc_html(of_get_option('header_logo_text1')); ?> <span><?php echo esc_html(of_get_option('header_logo_text2')); ?></span></a></h1><p class="usr"><?php bloginfo('description'); ?></p>

    And finally if none of those return true it will then echo the blog name and description. The question is what exactly do you want next to the logo?

    If it’s the site description you could do something like this on the first part of this conditional:

    <?php if ( of_get_option('logo_image') ) { ?>
    	<a class="logo" href="<?php echo esc_url(home_url('/')); ?>"><img src="<?php echo esc_url(of_get_option('logo_image')); ?>" /></a>
    	<p class="usr"><?php bloginfo('description'); ?></p>
    <?php } else if (of_get_option('header_logo_text1')){  ?>

    That simply gets the site description next to the logo.

    I’ve not tested this but it should be fine.

    You could do this in a child theme:

    Hope this helps.

    Hi Timothoy,
    yes, the above code is works, I think the problem was my text too long therefore push the text just below the logo instead.

    many thanks for your reply

    Hey again.

    You could float them like this:

    .logo, .usr {float:left}
    .usr {margin:15px;}

    Add that CSS either to the theme, a child theme or with a plugin like this:

    Hope this helps.

    Yes!! You are the man! sorted.

    thank you so much!!!

    I have another question, don’t know if I should start another topic. The boxes below the image slide are looking very narrow once view in a mobile phone, so I put a min-width for 200px, it appearing as 1 column, however if I rotate the phone it still showing as one column and not responsive, do you have any idea to solve that?

    once again thanks

    Yes!! You are the man!

    I’ll have to let my wife know that. 🙂

    You’re welcome 🙂

    For you new question, probably best a new thread but I don’t mind. Could you please share a link though, this isn’t a theme I use and when I looked at the demo the author has on WP it all looked fine on my iPhone.

    With a link hopefully I’ll see what you see 🙂

    Take care.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Logo and Text’ is closed to new replies.