Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if( get_theme_mod( 'display_logo' , '1' ) == '1') { ?>
- <?php if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) : ?>
- <?php the_custom_logo(); ?>
- <?php else : ?>
- <h1 class="site-logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" title="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>" width="100" height="50" /></a></h1>
- <?php endif; ?>
- <?php } ?>
- <?php if( get_theme_mod( 'display_site_title' , '0' ) == '1') { ?>
- <?php if ( is_front_page() && is_home() ) : ?>
- <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
- <?php else : ?>
- <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
- <?php endif; ?>
- <?php } ?>
- // Display Logo
- $wp_customize->add_setting( 'display_logo', array(
- 'default' => true,
- 'transport' => 'postMessage'
- ) );
- $wp_customize->add_control( 'display_logo', array(
- 'label' => __( 'Display Logo', 'myTheme' ),
- 'type' => 'checkbox'
- ) );
- // Display Site Title
- $wp_customize->add_setting( 'display_site_title', array(
- 'default' => false,
- 'transport' => 'postMessage'
- ) );
- $wp_customize->add_control( 'display_site_title', array(
- 'label' => __( 'Display Site Title', 'myTheme' ),
- 'type' => 'checkbox'
- ) );
- // Display Logo
- wp.customize( 'display_logo', function( value ) {
- value.bind( function( to ) {
- if ( true === to ) {
- $( '.site-logo' ).removeClass( 'hidden' );
- } else {
- $( '.site-logo' ).addClass( 'hidden' );
- }
- });
- });
- // Display Site Title
- wp.customize( 'display_site_title', function( value ) {
- value.bind( function( to ) {
- if ( true === to ) {
- $( '.site-title' ).removeClass( 'hidden' );
- } else {
- $( '.site-title' ).addClass( 'hidden' );
- }
- });
- });
- /*
- ** show site title or hide it
- */
- function showtitle_slogan() {
- $showttlslogan = get_theme_mod('display_site_title');
- if ($showttlslogan == true) {
- ?>
- <style type="text/css">
- .site-title { display:none;}
- </style>
- <?php
- }
- }
- add_action('wp_head', 'showtitle_slogan');
Add Comment
Please, Sign In to add comment