PageRenderTime 49ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/metrobee/tr.deconord.eu
PHP | 686 lines | 390 code | 142 blank | 154 comment | 60 complexity | d0b09e14daa39a90d8effae59033b290 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. * Filter 'get_comments_number'
  200. *
  201. * Filter 'get_comments_number' to display correct
  202. * number of comments (count only comments, not
  203. * trackbacks/pingbacks)
  204. *
  205. * Chip Bennett Contribution
  206. */
  207. function responsive_comment_count( $count ) {
  208. if ( ! is_admin() ) {
  209. global $id;
  210. $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
  211. return count($comments_by_type['comment']);
  212. } else {
  213. return $count;
  214. }
  215. }
  216. add_filter('get_comments_number', 'responsive_comment_count', 0);
  217. /**
  218. * wp_list_comments() Pings Callback
  219. *
  220. * wp_list_comments() Callback function for
  221. * Pings (Trackbacks/Pingbacks)
  222. */
  223. function responsive_comment_list_pings( $comment ) {
  224. $GLOBALS['comment'] = $comment;
  225. ?>
  226. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"><?php echo comment_author_link(); ?></li>
  227. <?php }
  228. /**
  229. * Sets the post excerpt length to 40 words.
  230. * Adopted from Coraline
  231. */
  232. function responsive_excerpt_length($length) {
  233. return 40;
  234. }
  235. add_filter('excerpt_length', 'responsive_excerpt_length');
  236. /**
  237. * Returns a "Read more" link for excerpts
  238. */
  239. function responsive_read_more() {
  240. return '<div class="read-more"><a href="' . get_permalink() . '">' . __('Read more &#8250;', 'responsive') . '</a></div><!-- end of .read-more -->';
  241. }
  242. /**
  243. * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and responsive_read_more_link().
  244. */
  245. function responsive_auto_excerpt_more($more) {
  246. return '<span class="ellipsis">&hellip;</span>' . responsive_read_more();
  247. }
  248. add_filter('excerpt_more', 'responsive_auto_excerpt_more');
  249. /**
  250. * Adds a pretty "Read more" link to custom post excerpts.
  251. */
  252. function responsive_custom_excerpt_more($output) {
  253. if (has_excerpt() && !is_attachment()) {
  254. $output .= responsive_read_more();
  255. }
  256. return $output;
  257. }
  258. add_filter('get_the_excerpt', 'responsive_custom_excerpt_more');
  259. /**
  260. * This function removes inline styles set by WordPress gallery.
  261. */
  262. function responsive_remove_gallery_css($css) {
  263. return preg_replace("#<style type='text/css'>(.*?)</style>#s", '', $css);
  264. }
  265. add_filter('gallery_style', 'responsive_remove_gallery_css');
  266. /**
  267. * This function removes default styles set by WordPress recent comments widget.
  268. */
  269. function responsive_remove_recent_comments_style() {
  270. global $wp_widget_factory;
  271. remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
  272. }
  273. add_action( 'widgets_init', 'responsive_remove_recent_comments_style' );
  274. /**
  275. * This function prints post meta data.
  276. *
  277. * Ulrich Pogson Contribution
  278. *
  279. */
  280. if (!function_exists('responsive_post_meta_data')) :
  281. function responsive_post_meta_data() {
  282. printf( __( '<span class="%1$s">Posted on </span>%2$s<span class="%3$s"> by </span>%4$s', 'responsive' ),
  283. 'meta-prep meta-prep-author posted',
  284. sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="timestamp">%3$s</span></a>',
  285. get_permalink(),
  286. esc_attr( get_the_time() ),
  287. get_the_date()
  288. ),
  289. 'byline',
  290. sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  291. get_author_posts_url( get_the_author_meta( 'ID' ) ),
  292. sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ),
  293. get_the_author()
  294. )
  295. );
  296. }
  297. endif;
  298. /**
  299. * This function removes WordPress generated category and tag atributes.
  300. * For W3C validation purposes only.
  301. *
  302. */
  303. function responsive_category_rel_removal ($output) {
  304. $output = str_replace(' rel="category tag"', '', $output);
  305. return $output;
  306. }
  307. add_filter('wp_list_categories', 'responsive_category_rel_removal');
  308. add_filter('the_category', 'responsive_category_rel_removal');
  309. /**
  310. * Breadcrumb Lists
  311. * Allows visitors to quickly navigate back to a previous section or the root page.
  312. *
  313. * Adopted from Dimox
  314. *
  315. */
  316. if (!function_exists('responsive_breadcrumb_lists')) :
  317. function responsive_breadcrumb_lists() {
  318. $chevron = '<span class="chevron">&#8250;</span>';
  319. $home = __('Home','responsive'); // text for the 'Home' link
  320. $before = '<span class="breadcrumb-current">'; // tag before the current crumb
  321. $after = '</span>'; // tag after the current crumb
  322. if ( !is_home() && !is_front_page() || is_paged() ) {
  323. echo '<div class="breadcrumb-list">';
  324. global $post;
  325. $homeLink = home_url();
  326. echo '<a href="' . $homeLink . '">' . $home . '</a> ' . $chevron . ' ';
  327. if ( is_category() ) {
  328. global $wp_query;
  329. $cat_obj = $wp_query->get_queried_object();
  330. $thisCat = $cat_obj->term_id;
  331. $thisCat = get_category($thisCat);
  332. $parentCat = get_category($thisCat->parent);
  333. if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $chevron . ' '));
  334. echo $before; printf( __( 'Archive for %s', 'responsive' ), single_cat_title('', false) ); $after;
  335. } elseif ( is_day() ) {
  336. echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $chevron . ' ';
  337. echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $chevron . ' ';
  338. echo $before . get_the_time('d') . $after;
  339. } elseif ( is_month() ) {
  340. echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $chevron . ' ';
  341. echo $before . get_the_time('F') . $after;
  342. } elseif ( is_year() ) {
  343. echo $before . get_the_time('Y') . $after;
  344. } elseif ( is_single() && !is_attachment() ) {
  345. if ( get_post_type() != 'post' ) {
  346. $post_type = get_post_type_object(get_post_type());
  347. $slug = $post_type->rewrite;
  348. echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a> ' . $chevron . ' ';
  349. echo $before . get_the_title() . $after;
  350. } else {
  351. $cat = get_the_category(); $cat = $cat[0];
  352. echo get_category_parents($cat, TRUE, ' ' . $chevron . ' ');
  353. echo $before . get_the_title() . $after;
  354. }
  355. } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
  356. $post_type = get_post_type_object(get_post_type());
  357. echo $before . $post_type->labels->singular_name . $after;
  358. } elseif ( is_attachment() ) {
  359. $parent = get_post($post->post_parent);
  360. $cat = get_the_category($parent->ID); $cat = $cat[0];
  361. echo get_category_parents($cat, TRUE, ' ' . $chevron . ' ');
  362. echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a> ' . $chevron . ' ';
  363. echo $before . get_the_title() . $after;
  364. } elseif ( is_page() && !$post->post_parent ) {
  365. echo $before . get_the_title() . $after;
  366. } elseif ( is_page() && $post->post_parent ) {
  367. $parent_id = $post->post_parent;
  368. $breadcrumbs = array();
  369. while ($parent_id) {
  370. $page = get_page($parent_id);
  371. $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
  372. $parent_id = $page->post_parent;
  373. }
  374. $breadcrumbs = array_reverse($breadcrumbs);
  375. foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $chevron . ' ';
  376. echo $before . get_the_title() . $after;
  377. } elseif ( is_search() ) {
  378. echo $before; printf( __( 'Search results for: %s', 'responsive' ), get_search_query() ); $after;
  379. } elseif ( is_tag() ) {
  380. echo $before; printf( __( 'Posts tagged %s', 'responsive' ), single_tag_title('', false) ); $after;
  381. } elseif ( is_author() ) {
  382. global $author;
  383. $userdata = get_userdata($author);
  384. echo $before; printf( __( 'View all posts by %s', 'responsive' ), $userdata->display_name ); $after;
  385. } elseif ( is_404() ) {
  386. echo $before . __('Error 404 ','responsive') . $after;
  387. }
  388. if ( get_query_var('paged') ) {
  389. if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
  390. echo __('Page','responsive') . ' ' . get_query_var('paged');
  391. if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
  392. }
  393. echo '</div>';
  394. }
  395. }
  396. endif;
  397. /**
  398. * A safe way of adding JavaScripts to a WordPress generated page.
  399. */
  400. if (!is_admin())
  401. add_action('wp_enqueue_scripts', 'responsive_js');
  402. if (!function_exists('responsive_js')) {
  403. function responsive_js() {
  404. // JS at the bottom for fast page loading.
  405. // except for Modernizr which enables HTML5 elements & feature detects.
  406. wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/responsive-modernizr.js', array('jquery'), '2.6.1', false);
  407. wp_enqueue_script('responsive-scripts', get_template_directory_uri() . '/js/responsive-scripts.js', array('jquery'), '1.2.2', true);
  408. wp_enqueue_script('responsive-plugins', get_template_directory_uri() . '/js/responsive-plugins.js', array('jquery'), '1.2.2', true);
  409. }
  410. }
  411. /**
  412. * A comment reply.
  413. */
  414. function responsive_enqueue_comment_reply() {
  415. if ( is_singular() && comments_open() && get_option('thread_comments')) {
  416. wp_enqueue_script('comment-reply');
  417. }
  418. }
  419. add_action( 'wp_enqueue_scripts', 'responsive_enqueue_comment_reply' );
  420. /**
  421. * Theme Options Support and Information
  422. */
  423. function responsive_theme_support () {
  424. ?>
  425. <div id="info-box-wrapper" class="grid col-940">
  426. <div class="info-box notice">
  427. <a class="blue button" href="<?php echo esc_url(__('http://themeid.com/support/','responsive')); ?>" title="<?php esc_attr_e('Theme Support', 'responsive'); ?>" target="_blank">
  428. <?php printf(__('Theme Support','responsive')); ?></a>
  429. <a class="gray button" href="<?php echo esc_url(__('http://themeid.com/themes/','responsive')); ?>" title="<?php esc_attr_e('More Themes', 'responsive'); ?>" target="_blank">
  430. <?php printf(__('More Themes','responsive')); ?></a>
  431. <a class="gray button" href="<?php echo esc_url(__('http://themeid.com/showcase/','responsive')); ?>" title="<?php esc_attr_e('Showcase', 'responsive'); ?>" target="_blank">
  432. <?php printf(__('Showcase','responsive')); ?></a>
  433. <a class="gold button" href="<?php echo esc_url(__('http://themeid.com/donate/','responsive')); ?>" title="<?php esc_attr_e('Donate Now', 'responsive'); ?>" target="_blank">
  434. <?php printf(__('Donate Now','responsive')); ?></a>
  435. </div>
  436. </div>
  437. <?php }
  438. add_action('responsive_theme_options','responsive_theme_support');
  439. /**
  440. * WordPress Widgets start right here.
  441. */
  442. function responsive_widgets_init() {
  443. register_sidebar(array(
  444. 'name' => __('Main Sidebar', 'responsive'),
  445. 'description' => __('Area 1 - sidebar.php', 'responsive'),
  446. 'id' => 'main-sidebar',
  447. 'before_title' => '<div class="widget-title">',
  448. 'after_title' => '</div>',
  449. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  450. 'after_widget' => '</div>'
  451. ));
  452. register_sidebar(array(
  453. 'name' => __('Right Sidebar', 'responsive'),
  454. 'description' => __('Area 2 - sidebar-right.php', 'responsive'),
  455. 'id' => 'right-sidebar',
  456. 'before_title' => '<div class="widget-title">',
  457. 'after_title' => '</div>',
  458. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  459. 'after_widget' => '</div>'
  460. ));
  461. register_sidebar(array(
  462. 'name' => __('Left Sidebar', 'responsive'),
  463. 'description' => __('Area 3 - sidebar-left.php', 'responsive'),
  464. 'id' => 'left-sidebar',
  465. 'before_title' => '<div class="widget-title">',
  466. 'after_title' => '</div>',
  467. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  468. 'after_widget' => '</div>'
  469. ));
  470. register_sidebar(array(
  471. 'name' => __('Left Sidebar Half Page', 'responsive'),
  472. 'description' => __('Area 4 - sidebar-left-half.php', 'responsive'),
  473. 'id' => 'left-sidebar-half',
  474. 'before_title' => '<div class="widget-title">',
  475. 'after_title' => '</div>',
  476. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  477. 'after_widget' => '</div>'
  478. ));
  479. register_sidebar(array(
  480. 'name' => __('Right Sidebar Half Page', 'responsive'),
  481. 'description' => __('Area 5 - sidebar-right-half.php', 'responsive'),
  482. 'id' => 'right-sidebar-half',
  483. 'before_title' => '<div class="widget-title">',
  484. 'after_title' => '</div>',
  485. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  486. 'after_widget' => '</div>'
  487. ));
  488. register_sidebar(array(
  489. 'name' => __('Home Widget 1', 'responsive'),
  490. 'description' => __('Area 6 - sidebar-home.php', 'responsive'),
  491. 'id' => 'home-widget-1',
  492. 'before_title' => '<div id="widget-title-one" class="widget-title-home"><h3>',
  493. 'after_title' => '</h3></div>',
  494. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  495. 'after_widget' => '</div>'
  496. ));
  497. register_sidebar(array(
  498. 'name' => __('Home Widget 2', 'responsive'),
  499. 'description' => __('Area 7 - sidebar-home.php', 'responsive'),
  500. 'id' => 'home-widget-2',
  501. 'before_title' => '<div id="widget-title-two" class="widget-title-home"><h3>',
  502. 'after_title' => '</h3></div>',
  503. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  504. 'after_widget' => '</div>'
  505. ));
  506. register_sidebar(array(
  507. 'name' => __('Home Widget 3', 'responsive'),
  508. 'description' => __('Area 8 - sidebar-home.php', 'responsive'),
  509. 'id' => 'home-widget-3',
  510. 'before_title' => '<div id="widget-title-three" class="widget-title-home"><h3>',
  511. 'after_title' => '</h3></div>',
  512. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  513. 'after_widget' => '</div>'
  514. ));
  515. register_sidebar(array(
  516. 'name' => __('Gallery Sidebar', 'responsive'),
  517. 'description' => __('Area 9 - sidebar-gallery.php', 'responsive'),
  518. 'id' => 'gallery-widget',
  519. 'before_title' => '<div class="widget-title">',
  520. 'after_title' => '</div>',
  521. 'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
  522. 'after_widget' => '</div>'
  523. ));
  524. register_sidebar(array(
  525. 'name' => __('Colophon Widget', 'responsive'),
  526. 'description' => __('Area 10 - sidebar-colophon.php', 'responsive'),
  527. 'id' => 'colophon-widget',
  528. 'before_title' => '<div class="widget-title">',
  529. 'after_title' => '</div>',
  530. 'before_widget' => '<div id="%1$s" class="colophon-widget widget-wrapper %2$s">',
  531. 'after_widget' => '</div>'
  532. ));
  533. register_sidebar(array(
  534. 'name' => __('Top Widget', 'responsive'),
  535. 'description' => __('Area 11 - sidebar-top.php', 'responsive'),
  536. 'id' => 'top-widget',
  537. 'before_title' => '<div class="widget-title">',
  538. 'after_title' => '</div>',
  539. 'before_widget' => '<div id="%1$s" class="%2$s">',
  540. 'after_widget' => '</div>'
  541. ));
  542. }
  543. add_action('widgets_init', 'responsive_widgets_init');
  544. ?>