Option Tree default logo

I don’t understand how I get an default image from theme folder when Option Tree logo is not selected.

<div id="logo-section">
            <?php if ( function_exists( 'ot_get_option' ) ) : ?>
            <?php $logo = ot_get_option( 'pp_logo_upload' ); ?>
            <a href="<?php bloginfo('url'); ?>">
            <img src="<?php echo $logo; ?>" class="logo" />
            </a>
            <?php endif; ?>

Related posts

1 comment

  1. Option Tree accepts a second parameter for ot_get_option that is the default in case no option is saved.

    <?php if ( function_exists( 'ot_get_option' ) && ( $logo = ot_get_option( 'pp_logo_upload', 'some-image.png' ) ) != '' ){ ?>
        <div id="logo-section">
            <a href="<?php bloginfo('url'); ?>"><img src="<?php echo esc_attr( $logo ); ?>" class="logo" /></a>
        </div>
    <?php } ?>
    

Comments are closed.