• SteveCeaton

    (@steveceaton)


    Hi there,
    I’m developing a custom theme and have added a custom logo option in functions.php. I’ve used the code so kindly provided by isme here.

    My problem is it uses short code for the output. This goes into header.php:

    <?php do_shortcode(‘[sitelogo]’); ?>

    I have this code which will add the page title and description if no logo is added, and it contains the shortcode for the output:

    function get_site_logo(){
    $option=get_option(“logo_options_group”);
    if($option[‘url’]){
    echo “<div class=\’logo2\’><img src='”. $option[‘url’] .”‘ /></div>”;
    } else {echo “<div class=’logo’><h1 class=’site-title’>” . $bloginfo = get_bloginfo( $show, $filter ) . “</h1></div><div class=’tagline’>” . $blog_title = get_bloginfo( ‘description’ ) . “</div>”;}}

    add_shortcode(‘sitelogo’, ‘get_site_logo’);

    Can anyone tell me how I output the results without using short code?

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    just use this part:

    $option=get_option("logo_options_group");
    if($option['url']){
    echo "<div class=\'logo2\'><img src='". $option['url'] ."' /></div>";
    } else {echo "<div class='logo'><h1 class='site-title'>" . $bloginfo = get_bloginfo( $show, $filter ) . "</h1></div><div class='tagline'>" . $blog_title = get_bloginfo( 'description' ) . "</div>";}
    Thread Starter SteveCeaton

    (@steveceaton)

    Hi Michael, thanks.

    I’ve tried this in header.php but it doesn’t work:

    <?php echo $options[‘logo_options_group’]; ?>

    Do you know what goes in header.php to display the output of:

    echo “<div class=\’logo2\’><img src='”. $option[‘url’] .”‘ /></div>”;
    } else {echo “<div class=’logo’><h1 class=’site-title’>” . $bloginfo = get_bloginfo( $show, $filter ) . “</h1></div><div class=’tagline’>” . $blog_title = get_bloginfo( ‘description’ ) . “</div>”;}

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom logo to theme’ is closed to new replies.