• Resolved Demetrius Pop

    (@demetrius-pop)


    The Site
    I have a childtheme of twenty twelve.
    I have php code in header.php for a custom logo; see below:

    <hgroup>
    			<?php if ($my_path_show_logo  == 'true') { ?>
    <h1 id="site-title"><span><a href="<?php echo get_option('home'); ?>"/><img class="site-logo" src="<?php echo get_stylesheet_directory_uri(); ?>/images/Logo.jpg" alt="site logo" /></a></span></h1><?php } ?>
    		</hgroup>

    The image is not showing up or even being registered. I have also tried get bloginfo – stylesheet directory with the same file path-with the same results.

    please help ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • where is this variable $my_path_show_logo set to 'true'?

    have you tried to check for boolean true:

    if( $my_path_show_logo == true ) {

    Thread Starter Demetrius Pop

    (@demetrius-pop)

    That variable is set in my childtheme options.php for an admin page option. It works when I use the same file path to set a background image (logo). (when the checkbox is ticked in the admin panel)

    Thread Starter Demetrius Pop

    (@demetrius-pop)

    The Site
    The code below registers the image, but it does not load it. ( it gives an error in the developer tool).
    So, at least now I’m getting it registered. I think maybe this is a path error or the fact that I’m trying to ignore twenty twelves’ bloginfo instead of overriding it?

    function logo() {
    	if( get_bloginfo('stylesheet_directory')."/../my-twentytwelve/images/Logo.jpg") { ?>
    		<?php echo '<img src="' . get_bloginfo('stylesheet_directory') . "/../my-twentytwelve/images/Logo.jpg" . '/>';
    	}
    }
    add_action('wp_head', 'logo');
    Thread Starter Demetrius Pop

    (@demetrius-pop)

    It seems that I needed to add an image to the header in the admin panel ( to use as the logo), which seems to be the way the options panel code is set up.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘childtheme custom logo’ is closed to new replies.