Advertisement
Guest User

More than one custom section - customize.php wordpress

a guest
Sep 19th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. <?php
  2. function moto_section($wp_customize){
  3. // Showcase Section
  4. $wp_customize->add_section('section-1', array(
  5. 'title' => __('Sekcja I', 'moto_cms'),
  6. 'description' => sprintf(__('Modyfikacja karuzeli','moto_cms')),
  7. 'priority' => 130
  8. ));
  9. $wp_customize->add_setting('graphic-1', array(
  10. 'default' => get_bloginfo('template_directory').'/img/slider-1.jpg',
  11. 'type' => 'theme_mod'
  12. ));
  13. $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'graphic-1', array(
  14. 'label' => __('Grafika I', 'moto_cms'),
  15. 'section' => 'section-1',
  16. 'settings' => 'graphic-1',
  17. 'priority' => 90
  18. )));
  19. $wp_customize->add_setting('title-1', array(
  20. 'default' => _x('WITAM SERDECZNIE NA STRONIE', 'moto_cms'),
  21. 'type' => 'theme_mod'
  22. ));
  23.  
  24. $wp_customize->add_control('title-1', array(
  25. 'label' => __('Tytuł grafiki', 'moto_cms'),
  26. 'section' => 'section-1',
  27. 'priority' => 100
  28. ));
  29. $wp_customize->add_setting('text-1', array(
  30. 'default' => _x('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, iste.', 'moto_cms'),
  31. 'type' => 'theme_mod'
  32. ));
  33. $wp_customize->add_control('text-1', array(
  34. 'label' => __('Opis/podtytuł', 'moto_cms'),
  35. 'section' => 'section-1',
  36. 'priority' => 110
  37. ));
  38.  
  39. $wp_customize->add_setting('graphic-2', array(
  40. 'default' => get_bloginfo('template_directory').'/img/slider-2.jpg',
  41. 'type' => 'theme_mod'
  42. ));
  43. $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'graphic-2', array(
  44. 'label' => __('Grafika II', 'moto_cms'),
  45. 'section' => 'section-1',
  46. 'settings' => 'graphic-2',
  47. 'priority' => 120
  48. )));
  49. $wp_customize->add_setting('title-2', array(
  50. 'default' => _x('WITAM SERDECZNIE NA STRONIE', 'moto_cms'),
  51. 'type' => 'theme_mod'
  52. ));
  53.  
  54. $wp_customize->add_control('title-2', array(
  55. 'label' => __('Tytuł grafiki', 'moto_cms'),
  56. 'section' => 'section-1',
  57. 'priority' => 130
  58. ));
  59. $wp_customize->add_setting('text-2', array(
  60. 'default' => _x('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, iste.', 'moto_cms'),
  61. 'type' => 'theme_mod'
  62. ));
  63. $wp_customize->add_control('text-2', array(
  64. 'label' => __('Opis/podtytuł', 'moto_cms'),
  65. 'section' => 'section-1',
  66. 'priority' => 140
  67. ));
  68.  
  69. $wp_customize->add_setting('graphic-3', array(
  70. 'default' => get_bloginfo('template_directory').'/img/slider-3.jpg',
  71. 'type' => 'theme_mod'
  72. ));
  73. $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'graphic-3', array(
  74. 'label' => __('Grafika III', 'moto_cms'),
  75. 'section' => 'section-1',
  76. 'settings' => 'graphic-3',
  77. 'priority' => 150
  78. )));
  79. $wp_customize->add_setting('title-3', array(
  80. 'default' => _x('WITAM SERDECZNIE NA STRONIE', 'moto_cms'),
  81. 'type' => 'theme_mod'
  82. ));
  83.  
  84. $wp_customize->add_control('title-3', array(
  85. 'label' => __('Tytuł grafiki', 'moto_cms'),
  86. 'section' => 'section-1',
  87. 'priority' => 160
  88. ));
  89. $wp_customize->add_setting('text-3', array(
  90. 'default' => _x('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, iste.', 'moto_cms'),
  91. 'type' => 'theme_mod'
  92. ));
  93. $wp_customize->add_control('text-3', array(
  94. 'label' => __('Opis/podtytuł', 'moto_cms'),
  95. 'section' => 'section-1',
  96. 'priority' => 170
  97. ));
  98.  
  99. $wp_customize->add_section(
  100. 'section-2',
  101. array(
  102. 'title' => esc_html__('Sekcja II', 'moto_cms'),
  103. 'priority' => 140,
  104. 'description' => __('Tutaj jest dowolny tekst', 'moto_cms'),
  105. )
  106. );
  107. $wp_customize->add_setting('text-4', array(
  108. 'default' => _x('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores, iste.', 'moto_cms'),
  109. 'type' => 'theme_mod'
  110. ));
  111. $wp_customize->add_control('text-4', array(
  112. 'label' => __('Opis/podtytuł', 'moto_cms'),
  113. 'section' => 'section-2',
  114. 'priority' => 170 ));
  115. }
  116. add_action('customize_register', 'moto_section');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement