WordPress.org

Ready to get started?Download WordPress

Forums

Hannari
[resolved] Logo and Text (6 posts)

  1. Vik999
    Member
    Posted 1 month ago #

    Hi,
    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')); ?>
    </span></h1>
    </div>

    many thanks

  2. 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:

    http://codex.wordpress.org/Child_Themes
    http://premium.wpmudev.org/blog/create-wordpress-child-theme/

    Hope this helps.

  3. Vik999
    Member
    Posted 1 month ago #

    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

  4. 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:

    http://wordpress.org/plugins/custom-css-manager-plugin/screenshots/

    http://wordpress.org/plugins/my-custom-css/screenshots/

    http://wordpress.org/plugins/pc-custom-css/

    http://wordpress.org/plugins/imporved-simpler-css/screenshots/

    Hope this helps.

  5. Vik999
    Member
    Posted 1 month ago #

    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

  6. 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.

Reply

You must log in to post.

About this Theme

About this Topic