Guest User

Untitled

a guest
Feb 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. <?php if( get_theme_mod( 'display_logo' , '1' ) == '1') { ?>
  2. <?php if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) : ?>
  3. <?php the_custom_logo(); ?>
  4. <?php else : ?>
  5. <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>
  6. <?php endif; ?>
  7. <?php } ?>
  8.  
  9. <?php if( get_theme_mod( 'display_site_title' , '0' ) == '1') { ?>
  10. <?php if ( is_front_page() && is_home() ) : ?>
  11. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  12. <?php else : ?>
  13. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  14. <?php endif; ?>
  15. <?php } ?>
  16.  
  17. // Display Logo
  18. $wp_customize->add_setting( 'display_logo', array(
  19. 'default' => true,
  20. 'transport' => 'postMessage'
  21. ) );
  22. $wp_customize->add_control( 'display_logo', array(
  23. 'label' => __( 'Display Logo', 'myTheme' ),
  24. 'type' => 'checkbox'
  25. ) );
  26.  
  27. // Display Site Title
  28. $wp_customize->add_setting( 'display_site_title', array(
  29. 'default' => false,
  30. 'transport' => 'postMessage'
  31. ) );
  32. $wp_customize->add_control( 'display_site_title', array(
  33. 'label' => __( 'Display Site Title', 'myTheme' ),
  34. 'type' => 'checkbox'
  35. ) );
  36.  
  37. // Display Logo
  38. wp.customize( 'display_logo', function( value ) {
  39. value.bind( function( to ) {
  40. if ( true === to ) {
  41. $( '.site-logo' ).removeClass( 'hidden' );
  42. } else {
  43. $( '.site-logo' ).addClass( 'hidden' );
  44. }
  45. });
  46. });
  47.  
  48. // Display Site Title
  49. wp.customize( 'display_site_title', function( value ) {
  50. value.bind( function( to ) {
  51. if ( true === to ) {
  52. $( '.site-title' ).removeClass( 'hidden' );
  53. } else {
  54. $( '.site-title' ).addClass( 'hidden' );
  55. }
  56. });
  57. });
  58.  
  59. /*
  60. ** show site title or hide it
  61. */
  62.  
  63. function showtitle_slogan() {
  64. $showttlslogan = get_theme_mod('display_site_title');
  65. if ($showttlslogan == true) {
  66. ?>
  67. <style type="text/css">
  68. .site-title { display:none;}
  69. </style>
  70. <?php
  71. }
  72. }
  73. add_action('wp_head', 'showtitle_slogan');
Add Comment
Please, Sign In to add comment