PageRenderTime 47ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/wordpress/wp-content/themes/responsive/includes/functions.php

https://bitbucket.org/mpizza/aws-pizza
PHP | 696 lines | 396 code | 142 blank | 158 comment | 61 complexity | 622f1791c95292d50d0de12b61de38ca MD5 | raw file
  1. <?php
  2. // Exit if accessed directly
  3. if ( !defined('ABSPATH')) exit;
  4. /**
  5. * Theme's Functions and Definitions
  6. *
  7. *
  8. * @file functions.php
  9. * @package Responsive
  10. * @author Emil Uzelac
  11. * @copyright 2003 - 2013 ThemeID
  12. * @license license.txt
  13. * @version Release: 1.2.1
  14. * @filesource wp-content/themes/responsive/includes/functions.php
  15. * @link http://codex.wordpress.org/Theme_Development#Functions_File
  16. * @since available since Release 1.0
  17. */
  18. ?>
  19. <?php
  20. /**
  21. * Fire up the engines boys and girls let's start theme setup.
  22. */
  23. add_action('after_setup_theme', 'responsive_setup');
  24. if (!function_exists('responsive_setup')):
  25. function responsive_setup() {
  26. global $content_width;
  27. /**
  28. * Global content width.
  29. */
  30. if (!isset($content_width))
  31. $content_width = 550;
  32. /**
  33. * Responsive is now available for translations.
  34. * Add your files into /languages/ directory.
  35. * @see http://codex.wordpress.org/Function_Reference/load_theme_textdomain
  36. */
  37. load_theme_textdomain('responsive', get_template_directory().'/languages');
  38. $locale = get_locale();
  39. $locale_file = get_template_directory().'/languages/$locale.php';
  40. if (is_readable( $locale_file))
  41. require_once( $locale_file);
  42. /**
  43. * Add callback for custom TinyMCE editor stylesheets. (editor-style.css)
  44. * @see http://codex.wordpress.org/Function_Reference/add_editor_style
  45. */
  46. add_editor_style();
  47. /**
  48. * This feature enables post and comment RSS feed links to head.
  49. * @see http://codex.wordpress.org/Function_Reference/add_theme_support#Feed_Links
  50. */
  51. add_theme_support('automatic-feed-links');
  52. /**
  53. * This feature enables post-thumbnail support for a theme.
  54. * @see http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
  55. */
  56. add_theme_support('post-thumbnails');
  57. /**
  58. * This feature enables custom-menus support for a theme.
  59. * @see http://codex.wordpress.org/Function_Reference/register_nav_menus
  60. */
  61. register_nav_menus(array(
  62. 'top-menu' => __('Top Menu', 'responsive'),
  63. 'header-menu' => __('Header Menu', 'responsive'),
  64. 'sub-header-menu' => __('Sub-Header Menu', 'responsive'),
  65. 'footer-menu' => __('Footer Menu', 'responsive')
  66. )
  67. );
  68. if ( function_exists('get_custom_header')) {
  69. add_theme_support('custom-background');
  70. } else {
  71. // < 3.4 Backward Compatibility
  72. /**
  73. * This feature allows users to use custom background for a theme.
  74. * @see http://codex.wordpress.org/Function_Reference/add_custom_background
  75. */
  76. add_custom_background();
  77. }
  78. // WordPress 3.4 >
  79. if (function_exists('get_custom_header')) {
  80. add_theme_support('custom-header', array (
  81. // Header image default
  82. 'default-image' => get_template_directory_uri() . '/images/default-logo.png',
  83. // Header text display default
  84. 'header-text' => false,
  85. // Header image flex width
  86. 'flex-width' => true,
  87. // Header image width (in pixels)
  88. 'width' => 300,
  89. // Header image flex height
  90. 'flex-height' => true,
  91. // Header image height (in pixels)
  92. 'height' => 100,
  93. // Admin header style callback
  94. 'admin-head-callback' => 'responsive_admin_header_style'));
  95. // gets included in the admin header
  96. function responsive_admin_header_style() {
  97. ?><style type="text/css">
  98. .appearance_page_custom-header #headimg {
  99. background-repeat:no-repeat;
  100. border:none;
  101. }
  102. </style><?php
  103. }
  104. } else {
  105. // Backward Compatibility
  106. /**
  107. * This feature adds a callbacks for image header display.
  108. * In our case we are using this to display logo.
  109. * @see http://codex.wordpress.org/Function_Reference/add_custom_image_header
  110. */
  111. define('HEADER_TEXTCOLOR', '');
  112. define('HEADER_IMAGE', '%s/images/default-logo.png'); // %s is the template dir uri
  113. define('HEADER_IMAGE_WIDTH', 300); // use width and height appropriate for your theme
  114. define('HEADER_IMAGE_HEIGHT', 100);
  115. define('NO_HEADER_TEXT', true);
  116. // gets included in the admin header
  117. function responsive_admin_header_style() {
  118. ?><style type="text/css">
  119. #headimg {
  120. background-repeat:no-repeat;
  121. border:none !important;
  122. width:<?php echo HEADER_IMAGE_WIDTH; ?>px;
  123. height:<?php echo HEADER_IMAGE_HEIGHT; ?>px;
  124. }
  125. </style><?php
  126. }
  127. add_custom_image_header('', 'responsive_admin_header_style');
  128. }
  129. }
  130. endif;
  131. /**
  132. * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
  133. */
  134. function responsive_page_menu_args( $args ) {
  135. $args['show_home'] = true;
  136. return $args;
  137. }
  138. add_filter( 'wp_page_menu_args', 'responsive_page_menu_args' );
  139. /**
  140. * This function removes .menu class from custom menus
  141. * in widgets only and fallback's on default widget lists
  142. * and assigns new unique class called .menu-widget
  143. *
  144. * Marko Heijnen Contribution
  145. *
  146. */
  147. class responsive_widget_menu_class {
  148. public function __construct() {
  149. add_action( 'widget_display_callback', array( $this, 'menu_different_class' ), 10, 2 );
  150. }
  151. public function menu_different_class( $settings, $widget ) {
  152. if( $widget instanceof WP_Nav_Menu_Widget )
  153. add_filter( 'wp_nav_menu_args', array( $this, 'wp_nav_menu_args' ) );
  154. return $settings;
  155. }
  156. public function wp_nav_menu_args( $args ) {
  157. remove_filter( 'wp_nav_menu_args', array( $this, 'wp_nav_menu_args' ) );
  158. if( 'menu' == $args['menu_class'] )
  159. $args['menu_class'] = 'menu-widget';
  160. return $args;
  161. }
  162. }
  163. new responsive_widget_menu_class();
  164. /**
  165. * Removes div from wp_page_menu() and replace with ul.
  166. */
  167. function responsive_wp_page_menu ($page_markup) {
  168. preg_match('/^<div class=\"([a-z0-9-_]+)\">/i', $page_markup, $matches);
  169. $divclass = $matches[1];
  170. $replace = array('<div class="'.$divclass.'">', '</div>');
  171. $new_markup = str_replace($replace, '', $page_markup);
  172. $new_markup = preg_replace('/^<ul>/i', '<ul class="'.$divclass.'">', $new_markup);
  173. return $new_markup; }
  174. add_filter('wp_page_menu', 'responsive_wp_page_menu');
  175. /**
  176. * wp_title() Filter for better SEO.
  177. *
  178. * Adopted from Twenty Twelve
  179. * @see http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title
  180. *
  181. */
  182. function responsive_wp_title( $title, $sep ) {
  183. global $paged, $page;
  184. if ( is_feed() )
  185. return $title;
  186. // Add the site name.
  187. $title .= get_bloginfo( 'name' );
  188. // Add the site description for the home/front page.
  189. $site_description = get_bloginfo( 'description', 'display' );
  190. if ( $site_description && ( is_home() || is_front_page() ) )
  191. $title = "$title $sep $site_description";
  192. // Add a page number if necessary.
  193. if ( $paged >= 2 || $page >= 2 )
  194. $title = "$title $sep " . sprintf( __( 'Page %s', 'responsive' ), max( $paged, $page ) );
  195. return $title;
  196. }
  197. add_filter( 'wp_title', 'responsive_wp_title', 10, 2 );
  198. /**
  199. * wp_title() Filter removal for the sake of SEO plugins
  200. *
  201. */
  202. function responsive_wp_title_check() {
  203. if ( defined( 'AIOSEOP_VERSION' ) ) {
  204. remove_filter( 'wp_title', 'responsive_wp_title', 10, 2 );
  205. }
  206. }
  207. add_action( 'after_setup_theme', 'responsive_wp_title_check', 5 );
  208. /**
  209. * Filter 'get_comments_number'
  210. *
  211. * Filter 'get_comments_number' to display correct
  212. * number of comments (count only comments, not
  213. * trackbacks/pingbacks)
  214. *
  215. * Chip Bennett Contribution
  216. */
  217. function responsive_comment_count( $count ) {
  218. if ( ! is_admin() ) {
  219. global $id;
  220. $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
  221. return count($comments_by_type['comment']);
  222. } else {
  223. return $count;
  224. }
  225. }
  226. add_filter('get_comments_number', 'responsive_comment_count', 0);
  227. /**
  228. * wp_list_comments() Pings Callback
  229. *
  230. * wp_list_comments() Callback function for
  231. * Pings (Trackbacks/Pingbacks)
  232. */
  233. function responsive_comment_list_pings( $comment ) {
  234. $GLOBALS['comment'] = $comment;
  235. ?>
  236. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"><?php echo comment_author_link(); ?></li>
  237. <?php }
  238. /**
  239. * Sets the post excerpt length to 40 words.
  240. * Adopted from Coraline
  241. */
  242. function responsive_excerpt_length($length) {
  243. return 40;
  244. }
  245. add_filter('excerpt_length', 'responsive_excerpt_length');
  246. /**
  247. * Returns a "Read more" link for excerpts
  248. */
  249. function responsive_read_more() {
  250. return '<div class="read-more"><a href="' . get_permalink() . '">' . __('Read more &#8250;', 'responsive') . '</a></div><!-- end of .read-more -->';
  251. }
  252. /**
  253. * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and responsive_read_more_link().
  254. */
  255. function responsive_auto_excerpt_more($more) {
  256. return '<span class="ellipsis">&hellip;</span>' . responsive_read_more();
  257. }
  258. add_filter('excerpt_more', 'responsive_auto_excerpt_more');
  259. /**
  260. * Adds a pretty "Read more" link to custom post excerpts.
  261. */
  262. function responsive_custom_excerpt_more($output) {
  263. if (has_excerpt() && !is_attachment()) {
  264. $output .= responsive_read_more();
  265. }
  266. return $output;
  267. }
  268. add_filter('get_the_excerpt', 'responsive_custom_excerpt_more');
  269. /**
  270. * This function removes inline styles set by WordPress gallery.
  271. */
  272. function responsive_remove_gallery_css($css) {
  273. return preg_replace("#<style type='text/css'>(.*?)</style>#s", '', $css);
  274. }
  275. add_filter('gallery_style', 'responsive_remove_gallery_css');
  276. /**
  277. * This function removes default styles set by WordPress recent comments widget.
  278. */
  279. function responsive_remove_recent_comments_style() {
  280. global $wp_widget_factory;
  281. remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
  282. }
  283. add_action( 'widgets_init', 'responsive_remove_recent_comments_style' );
  284. /**
  285. * This function prints post meta data.
  286. *
  287. * Ulrich Pogson Contribution
  288. *
  289. */
  290. if (!function_exists('responsive_post_meta_data')) :
  291. function responsive_post_meta_data() {
  292. printf( __( '<span class="%1$s">Posted on </span>%2$s<span class="%3$s"> by </span>%4$s', 'responsive' ),
  293. 'meta-prep meta-prep-author posted',
  294. sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="timestamp">%3$s</span></a>',
  295. get_permalink(),
  296. esc_attr( get_the_time() ),
  297. get_the_date()
  298. ),
  299. 'byline',
  300. sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  301. get_author_posts_url( get_the_author_meta( 'ID' ) ),
  302. sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ),
  303. get_the_author()
  304. )
  305. );
  306. }
  307. endif;
  308. /**
  309. * This function removes WordPress generated category and tag atributes.
  310. * For W3C validation purposes only.
  311. *
  312. */
  313. function responsive_category_rel_removal ($output) {
  314. $output = str_replace(' rel="category tag"', '', $output);
  315. return $output;
  316. }
  317. add_filter('wp_list_categories', 'responsive_category_rel_removal');
  318. add_filter('the_category', 'responsive_category_rel_removal');
  319. /**
  320. * Breadcrumb Lists
  321. * Allows visitors to quickly navigate back to a previous section or the root page.
  322. *
  323. * Adopted from Dimox
  324. *
  325. */
  326. if (!function_exists('responsive_breadcrumb_lists')) :
  327. function responsive_breadcrumb_lists() {
  328. $chevron = '<span class="chevron">&#8250;</span>';
  329. $home = __('Home','responsive'); // text for the 'Home' link
  330. $before = '<span class="breadcrumb-current">'; // tag before the current crumb
  331. $after = '</span>'; // tag after the current crumb
  332. if ( !is_home() && !is_front_page() || is_paged() ) {
  333. echo '<div class="breadcrumb-list">';
  334. global $post;
  335. $homeLink = home_url();
  336. echo '<a href="' . $homeLink . '">' . $home . '</a> ' . $chevron . ' ';
  337. if ( is_category() ) {
  338. global $wp_query;
  339. $cat_obj = $wp_query->get_queried_object();
  340. $thisCat = $cat_obj->term_id;
  341. $thisCat = get_category($thisCat);
  342. $parentCat = get_category($thisCat->parent);
  343. if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $chevron . ' '));
  344. echo $before; printf( __( 'Archive for %s', 'responsive' ), single_cat_title('', false) ); $after;
  345. } elseif ( is_day() ) {
  346. echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $chevron . ' ';
  347. echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $chevron . ' ';
  348. echo $before . get_the_time('d') . $after;
  349. } elseif ( is_month() ) {
  350. echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $chevron . ' ';
  351. echo $before . get_the_time('F') . $after;
  352. } elseif ( is_year() ) {
  353. echo $before . get_the_time('Y') . $after;
  354. } elseif ( is_single() && !is_attachment() ) {
  355. if ( get_post_type() != 'post' ) {
  356. $post_type = get_post_type_object(get_post_type());
  357. $slug = $post_type->rewrite;
  358. echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a> ' . $chevron . ' ';
  359. echo $before . get_the_title() . $after;
  360. } else {
  361. $cat = get_the_category(); $cat = $cat[0];
  362. echo get_category_parents($cat, TRUE, ' ' . $chevron . ' ');
  363. echo $before . get_the_title() . $after;
  364. }
  365. } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
  366. $post_type = get_post_type_object(get_post_type());
  367. echo $before . $post_type->labels->singular_name . $after;
  368. } elseif ( is_attachment() ) {
  369. $parent = get_post($post->post_parent);
  370. $cat = get_the_category($parent->ID); $cat = $cat[0];
  371. echo get_category_parents($cat, TRUE, ' ' . $chevron . ' ');
  372. echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a> ' . $chevron . ' ';
  373. echo $before . get_the_title() . $after;
  374. } elseif ( is_page() && !$post->post_parent ) {
  375. echo $before . get_the_title() . $after;
  376. } elseif ( is_page() && $post->post_parent ) {
  377. $parent_id = $post->post_parent;
  378. $breadcrumbs = array();
  379. while ($parent_id) {
  380. $page = get_page($parent_id);
  381. $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
  382. $parent_id = $page->post_parent;
  383. }
  384. $breadcrumbs = array_reverse($breadcrumbs);
  385. foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $chevron . ' ';
  386. echo $before . get_the_title() . $after;
  387. } elseif ( is_search() ) {
  388. echo $before; printf( __( 'Search results for: %s', 'responsive' ), get_search_query() ); $after;
  389. } elseif ( is_tag() ) {
  390. echo $before; printf( __( 'Posts tagged %s', 'responsive' ), single_tag_title('', false) ); $after;
  391. } elseif ( is_author() ) {
  392. global $author;
  393. $userdata = get_userdata($author);
  394. echo $before; printf( __( 'View all posts by %s', 'responsive' ), $userdata->display_name ); $after;
  395. } elseif ( is_404() ) {
  396. echo $before . __('Error 404 ','responsive') . $after;
  397. }
  398. if ( get_query_var('paged') ) {
  399. if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
  400. echo __('Page','responsive') . ' ' . get_query_var('paged');
  401. if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
  402. }
  403. echo '</div>';
  404. }
  405. }
  406. endif;
  407. /**
  408. * A safe way of adding JavaScripts to a WordPress generated page.
  409. */
  410. if (!is_admin())
  411. add_action('wp_enqueue_scripts', 'responsive_js');
  412. if (!function_exists('responsive_js')) {
  413. function responsive_js() {
  414. // JS at the bottom for fast page loading.
  415. // except for Modernizr which enables HTML5 elements & feature detects.
  416. wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/responsive-modernizr.js', array('jquery'), '2.6.1', false);
  417. wp_enqueue_script('responsive-scripts', get_template_directory_uri() . '/js/responsive-scripts.js', array('jquery'), '1.2.3', true);
  418. wp_enqueue_script('responsive-plugins', get_template_directory_uri() . '/js/responsive-plugins.js', array('jquery'), '1.2.2', true);
  419. }
  420. }
  421. /**
  422. * A comment reply.
  423. */
  424. function responsive_enqueue_comment_reply() {
  425. if ( is_singular() && comments_open() && get_option('thread_comments')) {
  426. wp_enqueue_script('comment-reply');
  427. }
  428. }
  429. add_action( 'wp_enqueue_scripts', 'responsive_enqueue_comment_reply' );
  430. /**
  431. * Theme Options Support and Information
  432. */
  433. function responsive_theme_support () {
  434. ?>
  435. <div id="info-box-wrapper" class="grid col-940">
  436. <div class="info-box notice">
  437. <a class="button" href="<?php echo esc_url(__('http://themeid.com/support/','responsive')); ?>" title="<?php esc_attr_e('Theme Support', 'responsive'); ?>" target="_blank">
  438. <?php printf(__('Theme Support','responsive')); ?></a>
  439. <a class="button" href="<?php echo esc_url(__('http://themeid.com/themes/','responsive')); ?>" title="<?php esc_attr_e('More Themes', 'responsive'); ?>" target="_blank">
  440. <?php printf(__('More Themes','responsive')); ?></a>
  441. <a class="button" href="<?php echo esc_url(__('http://themeid.com/showcase/','responsive')); ?>" title="<?php esc_attr_e('Showcase', 'responsive'); ?>" target="_blank">
  442. <?php printf(__('Showcase','responsive')); ?></a>
  443. <a class="button-primary" href="<?php echo esc_url(__('http://themeid.com/donate/','responsive')); ?>" title="<?php esc_attr_e('Donate Now', 'responsive'); ?>" target="_blank">
  444. <?php printf(__('Donate Now','responsive')); ?></a>
  445. </div>
  446. </div>
  447. <?php }
  448. add_action('responsive_theme_options','responsive_theme_support');
  449. /**
  450. * WordPress Widgets start right here.
  451. */
  452. function responsive_widgets_init() {
  453. register_sidebar(array(
  454. 'name' => __('Main Sidebar', 'responsive'),
  455. 'description' => __('Area 1 - sidebar.php', 'responsive'),
  456. 'id' => 'main-sidebar',
  457. 'before_title' => '<div class="widget-title">',
  458. 'after_title' => '</div>',
  459. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  460. 'after_widget' => '</div>'
  461. ));
  462. register_sidebar(array(
  463. 'name' => __('Right Sidebar', 'responsive'),
  464. 'description' => __('Area 2 - sidebar-right.php', 'responsive'),
  465. 'id' => 'right-sidebar',
  466. 'before_title' => '<div class="widget-title">',
  467. 'after_title' => '</div>',
  468. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  469. 'after_widget' => '</div>'
  470. ));
  471. register_sidebar(array(
  472. 'name' => __('Left Sidebar', 'responsive'),
  473. 'description' => __('Area 3 - sidebar-left.php', 'responsive'),
  474. 'id' => 'left-sidebar',
  475. 'before_title' => '<div class="widget-title">',
  476. 'after_title' => '</div>',
  477. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  478. 'after_widget' => '</div>'
  479. ));
  480. register_sidebar(array(
  481. 'name' => __('Left Sidebar Half Page', 'responsive'),
  482. 'description' => __('Area 4 - sidebar-left-half.php', 'responsive'),
  483. 'id' => 'left-sidebar-half',
  484. 'before_title' => '<div class="widget-title">',
  485. 'after_title' => '</div>',
  486. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  487. 'after_widget' => '</div>'
  488. ));
  489. register_sidebar(array(
  490. 'name' => __('Right Sidebar Half Page', 'responsive'),
  491. 'description' => __('Area 5 - sidebar-right-half.php', 'responsive'),
  492. 'id' => 'right-sidebar-half',
  493. 'before_title' => '<div class="widget-title">',
  494. 'after_title' => '</div>',
  495. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  496. 'after_widget' => '</div>'
  497. ));
  498. register_sidebar(array(
  499. 'name' => __('Home Widget 1', 'responsive'),
  500. 'description' => __('Area 6 - sidebar-home.php', 'responsive'),
  501. 'id' => 'home-widget-1',
  502. 'before_title' => '<div id="widget-title-one" class="widget-title-home"><h3>',
  503. 'after_title' => '</h3></div>',
  504. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  505. 'after_widget' => '</div>'
  506. ));
  507. register_sidebar(array(
  508. 'name' => __('Home Widget 2', 'responsive'),
  509. 'description' => __('Area 7 - sidebar-home.php', 'responsive'),
  510. 'id' => 'home-widget-2',
  511. 'before_title' => '<div id="widget-title-two" class="widget-title-home"><h3>',
  512. 'after_title' => '</h3></div>',
  513. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  514. 'after_widget' => '</div>'
  515. ));
  516. register_sidebar(array(
  517. 'name' => __('Home Widget 3', 'responsive'),
  518. 'description' => __('Area 8 - sidebar-home.php', 'responsive'),
  519. 'id' => 'home-widget-3',
  520. 'before_title' => '<div id="widget-title-three" class="widget-title-home"><h3>',
  521. 'after_title' => '</h3></div>',
  522. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  523. 'after_widget' => '</div>'
  524. ));
  525. register_sidebar(array(
  526. 'name' => __('Gallery Sidebar', 'responsive'),
  527. 'description' => __('Area 9 - sidebar-gallery.php', 'responsive'),
  528. 'id' => 'gallery-widget',
  529. 'before_title' => '<div class="widget-title">',
  530. 'after_title' => '</div>',
  531. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  532. 'after_widget' => '</div>'
  533. ));
  534. register_sidebar(array(
  535. 'name' => __('Colophon Widget', 'responsive'),
  536. 'description' => __('Area 10 - sidebar-colophon.php', 'responsive'),
  537. 'id' => 'colophon-widget',
  538. 'before_title' => '<div class="widget-title">',
  539. 'after_title' => '</div>',
  540. 'before_widget' => '<div id="%1$s" class="colophon-widget widget-wrapper %2$s">',
  541. 'after_widget' => '</div>'
  542. ));
  543. register_sidebar(array(
  544. 'name' => __('Top Widget', 'responsive'),
  545. 'description' => __('Area 11 - sidebar-top.php', 'responsive'),
  546. 'id' => 'top-widget',
  547. 'before_title' => '<div class="widget-title">',
  548. 'after_title' => '</div>',
  549. 'before_widget' => '<div id="%1$s" class="%2$s">',
  550. 'after_widget' => '</div>'
  551. ));
  552. }
  553. add_action('widgets_init', 'responsive_widgets_init');
  554. ?>