Advertisement
John-E

WordPress Theme install and customize Widgets format

May 25th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1.     /* Install Theme */
  2.     if(!function_exists('nitron_setup')){
  3.         function nitron_setup(){
  4.             add_theme_support("title-tag");
  5.             add_theme_support('automatic-feed-links');
  6.             add_theme_support('post-thumbnails');
  7.             add_image_size('thumbnail_250_250', '250', '250', TRUE);
  8.             add_theme_support('thumbnail_250_250');
  9.             register_nav_menus(array('header'=>esc_html__('Header','nitron')));
  10.         }
  11.     }
  12.     add_action('after_setup_theme','nitron_setup');
  13.  
  14.     /* Register Sidebar & define the Widget HTML format */
  15.     if (!function_exists('nitron_sidebars')){
  16.         function nitron_sidebars(){
  17.             register_sidebar(array(
  18.                 'name' => esc_html__('aSidebar', 'nitron'),
  19.                 'id' => 'asidebar',
  20.                 'description' => esc_html__('Aggiungi/Togli i Widget che vuoi.', 'nitron'),
  21.                 'before_widget' => '<div id="%1$s" class="sidebox widget %2$s">',
  22.                 'after_widget' => '</div><!-- .widget-content --></div><!-- .sidebox -->',
  23.                 'before_title' => '<h4 class="toggle">',
  24.                 'after_title' => '<img class="col-icon" src="'.get_template_directory_uri().'/img/Maximize-Window.svg" /></h4><div class="widget-toggle-content">'
  25.             ));
  26.         }
  27.     }
  28.     add_action('widgets_init', 'nitron_sidebars');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement