Advertisement
Guest User

Campus Theme trying to make Events+ Events display in blog

a guest
Feb 4th, 2015
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.73 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Initiate Theme Options
  5. *
  6. * @uses wp_deregister_script()
  7. * @uses wp_register_script()
  8. * @uses wp_enqueue_script()
  9. * @uses register_nav_menus()
  10. * @uses add_theme_support()
  11. * @uses is_admin()
  12. *
  13. * @access public
  14. * @since 1.0.0
  15. *
  16. * @return void
  17.  
  18. */
  19.  
  20.  
  21. // this handles redirect on activating the theme (can be amended for plugin of course)
  22. // if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {
  23. // header( 'Location: '.admin_url().'themes.php?page=ot-theme-options');
  24. // }
  25.  
  26.  
  27. /* ---------------------------------------------------------*/
  28. /* CONSTANTS & GENERIC THEME FUNCTIONS */
  29. /* ---------------------------------------------------------*/
  30.  
  31. /* THEME URL CONSTANT */
  32. if(!defined('WP_THEME_URL')) {
  33. define( 'WP_THEME_URL', get_template_directory_uri());
  34. }
  35.  
  36. /* Declare our Post-Grid global variabls for VT_RESIZE */
  37. $imgwidth = "750";
  38. $imgheight = "2000";
  39. $imagecrop = "true";
  40.  
  41. /* Image Resize */
  42. include_once( 'functions/vt_resize.php' );
  43.  
  44. add_theme_support( 'automatic-feed-links' );
  45.  
  46. /* Add "Post Thumbnails" Support */
  47. add_theme_support( 'post-thumbnails' );
  48. set_post_thumbnail_size( 750, 450, true );
  49. add_image_size( 'single-post-thumbnail', 700, 9999 );
  50.  
  51. /* Add shortcode support in widgets */
  52. add_filter('widget_text', 'do_shortcode');
  53.  
  54. /* Add comment-reply support */
  55. function theme_queue_js(){
  56. if (!is_admin()){
  57. if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
  58. wp_enqueue_script( 'comment-reply' );
  59. }
  60. }
  61. add_action('wp_print_scripts', 'theme_queue_js');
  62.  
  63. /* GET CUSTOM FIELD - Allows us to grab custom meta fields super easy */
  64. function get_custom_field($key,$echo=false) {
  65. global $post;
  66. if(!isset($post->ID)) return null;
  67. $custom_field = get_post_meta($post->ID,$key,true);
  68. if($echo==false) return $custom_field;
  69. echo $custom_field;
  70. }
  71.  
  72. /* CATEGORY SLUG FUNCTION - Allows us to grab the category slug from an ID */
  73. function get_cat_slug($cat_id) {
  74. $cat_id = (int) $cat_id;
  75. $category = &get_category($cat_id);
  76. return $category->slug;
  77. }
  78.  
  79. /* ---------------------------------------------------------*/
  80. /* THEME SUPPORT DECLARATIONS */
  81. /* ---------------------------------------------------------*/
  82.  
  83. /* WOOCOMMERCE */
  84. //if( class_exists( 'woocommerce' ) ):
  85. /*if ( ! function_exists( 'is_woocommerce_activated' ) ) {
  86. function is_woocommerce_activated() {
  87. if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
  88. }
  89. }*/
  90. /*add_action( 'after_setup_theme', 'woocommerce_support' );
  91. function woocommerce_support() {
  92. add_theme_support( 'woocommerce' );
  93. }*/
  94. add_theme_support( 'woocommerce' );
  95.  
  96. /* - WOOCOMMERCE: Primary Wrappers - */
  97. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
  98. remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
  99.  
  100. add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
  101. add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
  102.  
  103. function my_theme_wrapper_start() {
  104. echo '<main id="main" class="site-main" role="main">';
  105. }
  106.  
  107. function my_theme_wrapper_end() {
  108. echo '</main>';
  109. }
  110.  
  111. /* - WOOCOMMERCE: Theme Stylings - */
  112. remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
  113.  
  114. add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 5 );
  115.  
  116. function product_page_title_hr(){
  117. echo "<hr class='page-title-hr'>";
  118. }
  119. add_action('woocommerce_before_single_product_summary','product_page_title_hr' );
  120.  
  121. function shop_page_title_hr(){
  122. echo "<hr class='page-title-hr'>";
  123. }
  124. add_action('woocommerce_archive_description','shop_page_title_hr', 5 );
  125. //endif;
  126.  
  127.  
  128. /* ---------------------------------------------------------*/
  129. /* MYTHOLOGY-CORE - OPTION TREE LOADER SNIPPET
  130. /* Loads OT files, OT Google Fonts, and custom skins.
  131. /* ---------------------------------------------------------*/
  132.  
  133. add_filter( 'ot_theme_mode', '__return_true' );
  134. add_filter( 'ot_show_pages', '__return_true' );
  135. add_filter( 'ot_show_options_ui', '__return_true' );
  136. add_filter( 'ot_show_settings_import', '__return_true' );
  137. add_filter( 'ot_show_settings_export', '__return_true' );
  138. add_filter( 'ot_show_new_layout', '__return_false' );
  139. add_filter( 'ot_show_docs', '__return_true' );
  140.  
  141. // LOAD IT UP
  142. require_once( trailingslashit( get_template_directory() ) . '/mythology-core/option-tree/ot-loader.php' ); // Load OptionTree.
  143.  
  144. // LOAD THEME OPTIONS & META BOXES FOR POSTS/PAGES
  145. include_once( 'functions/admin/skeleton-theme-options.php' );
  146. include_once( 'functions/admin/skeleton-meta-boxes.php' );
  147.  
  148. // LOAD CUSTOM ADMIN SKINS & SCRIPTS
  149. /* NOTE that you can specify your own custom stylesheet here.
  150. We're using the "candy-admin" or "candy-admin-simple",
  151. but you can use old skin versions or your own custom mods.
  152. */
  153. add_action('admin_enqueue_scripts', 'mythology_admin_script');
  154. function mythology_admin_script(){
  155. if(ot_get_option('options_skin') != "off" ) : // Set this to "on" and add a Theme-Option to make this something the user can control.
  156. wp_enqueue_style ( 'mythology-candy-stylesheet', get_template_directory_uri(). '/mythology-core/option-tree-candy-skin/candy-admin-simple.css', array('ot-admin-css') );
  157. wp_enqueue_style ( 'mythology-admin-stylesheet', get_template_directory_uri(). '/mythology-core/option-tree-candy-skin/candy-plugin-notification.css');
  158. wp_enqueue_script('mythology-admin-js', get_template_directory_uri(). '/mythology-core/option-tree-candy-skin/candy-admin.js' );
  159. //wp_enqueue_style ( 'admin-stylesheet', WP_THEME_URL . '/functions/admin/skeleton-admin.css', array('colors', 'ot-admin-css'));
  160. //wp_enqueue_script('my-admin', get_template_directory_uri().'/functions/admin/skeleton-admin.js', array('jquery'));
  161. endif;
  162. }
  163.  
  164. /* =============================================================================
  165. Include the Option-Tree Google Fonts Plugin
  166. ========================================================================== */
  167.  
  168. global $ot_options;
  169. $ot_options = get_option( 'option_tree' );
  170.  
  171. // default fonts used in this theme, even though there are no google fonts
  172. $default_theme_fonts = array(
  173. 'arial' => 'Arial, Helvetica, sans-serif',
  174. 'helvetica' => 'Helvetica, Arial, sans-serif',
  175. 'georgia' => 'Georgia, "Times New Roman", Times, serif',
  176. 'tahoma' => 'Tahoma, Geneva, sans-serif',
  177. 'times' => '"Times New Roman", Times, serif',
  178. 'trebuchet' => '"Trebuchet MS", Arial, Helvetica, sans-serif',
  179. 'verdana' => 'Verdana, Geneva, sans-serif'
  180. );
  181.  
  182. defined('OT_FONT_DEFAULTS') or define('OT_FONT_DEFAULTS', serialize($default_theme_fonts));
  183. defined('OT_FONT_API_KEY') or define('OT_FONT_API_KEY', 'AIzaSyAeA4ipDEoRqvJKQctOhYufUmXJFkQjviY'); // enter your own Google Font API key here
  184. defined('OT_FONT_CACHE_INTERVAL') or define('OT_FONT_CACHE_INTERVAL', 0); // Checking once a week for new Fonts. The time interval for the remote XML cache in the database (21600 seconds = 6 hours)
  185.  
  186. // get the OT-Google-Font plugin file
  187. include_once( get_template_directory().'/mythology-core/option-tree-google-fonts/ot-google-fonts.php' );
  188.  
  189. /* NOTE that we have made some changes to the ot-google-fonts.php file.
  190. For starters, we've editted the $path variable so that it works in mythology-core.
  191. Next, we've removed the nag-box that shows up for errors and success messages.
  192. Last - we've also filtered out the font-color picker from OptionTree (see filter below) to prevent fix issues.
  193. */
  194.  
  195. // get the google font array - build in ot-google-fonts.php
  196. $google_font_array = ot_get_google_font(OT_FONT_API_KEY, OT_FONT_CACHE_INTERVAL);
  197.  
  198. // Now apply the fonts to the font dropdowns in theme options with the build in OptionTree hook
  199. function ot_filter_recognized_font_families( $array, $field_id ) {
  200.  
  201. global $google_font_array;
  202.  
  203. // loop through the cached google font array if available and append to default fonts
  204. $font_array = array();
  205. if($google_font_array){
  206. foreach($google_font_array as $index => $value){
  207. $font_array[$index] = $value['family'];
  208. }
  209. }
  210.  
  211. // put both arrays together
  212. $array = array_merge(unserialize(OT_FONT_DEFAULTS), $font_array);
  213.  
  214. return $array;
  215.  
  216. }
  217. add_filter( 'ot_recognized_font_families', 'ot_filter_recognized_font_families', 1, 2 );
  218.  
  219. // REMOVE FONT-COLOR FROM TYPOGRAPHY FIELDS (for OT GOOGLE FONTS).
  220. function filter_typography_headings( $array, $field_id ) {
  221. // COMMENT OUT LINES FOR FIELDS THAT YOU WANT TO REMOVE FROM VIEW
  222. $array = array(
  223. // 'font-color',
  224. 'font-family',
  225. 'font-size',
  226. 'font-style',
  227. 'font-variant',
  228. 'font-weight',
  229. 'letter-spacing',
  230. 'line-height',
  231. 'text-decoration',
  232. 'text-transform'
  233. );
  234. return $array;
  235. }
  236. add_filter( 'ot_recognized_typography_fields', 'filter_typography_headings', 10, 2 );
  237.  
  238. // REMOVE DYNAMIC AND RELOAD IT TO ENSURE THAT IT ALWAYS FIRES UP.
  239. //wp_dequeue_style( 'ot-dynamic-dynamic-css' );
  240. //wp_enqueue_style( 'main-stylesheet', get_stylesheet_uri() );
  241. //wp_enqueue_style( 'ot-dynamic-dynamic-css' );
  242. /* - End Mythology ADD - */
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250. /* ---------------------------------------------------------*/
  251. /* LOCALIZATION */
  252. /* ---------------------------------------------------------*/
  253. function mdnw_localization() {
  254. /* LOCALIZATION STUFF -
  255. Defines the text domain 'skeleton' -
  256. Instructs where the language files are -
  257. Then instructs the theme to load the language if it's in WP-CONFIG.php as WP_LANG */
  258. load_theme_textdomain('skeleton', get_template_directory() . '/languages');
  259. $locale = get_locale();
  260. $locale_file = get_template_directory()."/languages/$locale.php";
  261. if ( is_readable($locale_file) )
  262. require_once($locale_file);
  263. }
  264. add_action('init', 'mdnw_localization'); /* Run the above function at the init() hook */
  265.  
  266.  
  267.  
  268.  
  269. /* ---------------------------------------------------------*/
  270. /* SCRIPT LOADING */
  271. /* ---------------------------------------------------------*/
  272.  
  273.  
  274. function mdnw_register_scripts() {
  275. if(!is_admin()){
  276.  
  277.  
  278. function detect_ie($ie7_check = true, $ie8_check = true) {
  279. $ie7 = ($ie7_check == true) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') : false;
  280. $ie8 = ($ie8_check == true) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8.0') : false;
  281. if ($ie7 !== false || $ie8 !== false) {
  282. return true;
  283. } else {
  284. return false;
  285. }
  286. }
  287.  
  288. wp_enqueue_script( 'jquery' );
  289.  
  290. // Sortable Masonry
  291. wp_register_script( 'Isotope', WP_THEME_URL . '/assets/javascripts/isotope/jquery.isotope.js', false, null, true);
  292. wp_enqueue_script( 'Isotope' );
  293.  
  294. wp_register_script( 'Modernizer', WP_THEME_URL . '/assets/javascripts/isotope/modernizr.custom.69142.js', false, null, true);
  295. wp_enqueue_script( 'Modernizer' );
  296.  
  297. //Dropdown Menu
  298. wp_register_script( 'HoverIntent', WP_THEME_URL . '/assets/javascripts/superfish/jquery.hoverIntent.js', false, null, true);
  299. wp_enqueue_script( 'HoverIntent' );
  300.  
  301. wp_register_script( 'Superfish', WP_THEME_URL . '/assets/javascripts/superfish/superfish.js', false, null, true);
  302. wp_enqueue_script( 'Superfish' );
  303.  
  304. wp_register_script( 'SuperSubs', WP_THEME_URL . '/assets/javascripts/superfish/supersubs.js', false, null, true);
  305. wp_enqueue_script( 'SuperSubs' );
  306.  
  307. //Responsive Menu
  308. wp_register_script( 'Modernizer2', WP_THEME_URL . '/assets/javascripts/mobilemenu/js/modernizr.custom.js', false, null, true);
  309. wp_enqueue_script( 'Modernizer2' );
  310.  
  311. wp_register_script( 'ResponsiveMenu', WP_THEME_URL . '/assets/javascripts/mobilemenu/js/jquery.dlmenu.js', false, null, true);
  312. if( detect_ie() ) { } else { wp_enqueue_script( 'ResponsiveMenu' ); }
  313.  
  314. // Pre-Script Action
  315. wp_register_script( 'SkeletonKeyPreScripts', WP_THEME_URL . '/assets/javascripts/skeleton-key-prescripts.js', false, null, false);
  316. wp_enqueue_script( 'SkeletonKeyPreScripts' );
  317.  
  318. // The Activation Scripts
  319. wp_register_script( 'SkeletonKey', WP_THEME_URL . '/assets/javascripts/skeleton-key.js', false, null, true);
  320. wp_enqueue_script( 'SkeletonKey' );
  321.  
  322. }
  323. }
  324. add_action('init', 'mdnw_register_scripts'); /* Run the above function at the init() hook */
  325.  
  326.  
  327.  
  328.  
  329. /* ---------------------------------------------------------*/
  330. /* STYLESHEET LOADER */
  331. /* ---------------------------------------------------------*/
  332. function mdnw_register_styles() {
  333. if(!is_admin()){
  334. wp_register_style ( 'Base', WP_THEME_URL . '/assets/stylesheets/base.css' );
  335. wp_enqueue_style( 'Base' );
  336.  
  337. wp_register_style ( 'skeleton', WP_THEME_URL . '/assets/stylesheets/skeleton.css' );
  338. wp_enqueue_style( 'skeleton' );
  339.  
  340. wp_register_style ( 'ResponsiveMenu', WP_THEME_URL . '/assets/javascripts/mobilemenu/css/component.css' );
  341. wp_enqueue_style( 'ResponsiveMenu' );
  342.  
  343. wp_register_style ( 'comments', WP_THEME_URL . '/assets/stylesheets/comments.css' );
  344. wp_enqueue_style( 'comments' );
  345.  
  346. wp_register_style ( 'FontAwesome', WP_THEME_URL . '/assets/stylesheets/fonts/font-awesome.css' );
  347. wp_enqueue_style( 'FontAwesome' );
  348.  
  349. wp_register_style ( 'Foundation Icons', WP_THEME_URL . '/assets/stylesheets/fonts/general_foundicons.css' );
  350. wp_enqueue_style( 'Foundation Icons' );
  351.  
  352. wp_register_style ( 'Foundation Social Icons', WP_THEME_URL . '/assets/stylesheets/fonts/social_foundicons.css' );
  353. wp_enqueue_style( 'Foundation Social Icons' );
  354.  
  355. wp_register_style ( 'superfish', WP_THEME_URL . '/assets/stylesheets/superfish.css' );
  356. wp_enqueue_style( 'superfish' );
  357.  
  358. wp_register_style ( 'base-theme-stylesheet', WP_THEME_URL . '/assets/stylesheets/styles.css' );
  359. wp_enqueue_style( 'base-theme-stylesheet' );
  360.  
  361. wp_register_style ( 'type-stylesheet', WP_THEME_URL . '/assets/stylesheets/typography.css' );
  362. wp_enqueue_style( 'type-stylesheet' );
  363.  
  364. wp_register_style ( 'theme-stylesheet', WP_THEME_URL . '/assets/stylesheets/theme.css' );
  365. wp_enqueue_style( 'theme-stylesheet' );
  366.  
  367. wp_register_style ( 'base-stylesheet', WP_THEME_URL . '/style.css' );
  368. wp_enqueue_style( 'base-stylesheet' );
  369.  
  370. wp_register_style ( 'dynamic-stylesheet', WP_THEME_URL . '/dynamic.css' );
  371. wp_enqueue_style( 'dynamic-stylesheet' );
  372.  
  373. }
  374. }
  375. add_action('init', 'mdnw_register_styles'); /* Run the above function at the init() hook */
  376.  
  377.  
  378.  
  379.  
  380. /* ---------------------------------------------------------*/
  381. /* THEME OPTIONS LOADER - Loads the ThemeOptions values */
  382. /* ---------------------------------------------------------*/
  383. function mdnw_style_embed(){
  384. get_template_part( 'includes/load', 'user-styles' );
  385. }
  386. add_action('wp_head', 'mdnw_style_embed');
  387.  
  388.  
  389. /* ---------------------------------------------------------*/
  390. /* MENUS */
  391. /* ---------------------------------------------------------*/
  392. function mdnw_register_menus() {
  393. /* Register Navigation */
  394. register_nav_menus( array(
  395. 'default_menu' => __( 'Top Bar Menu', 'skeleton' ),
  396. 'responsive_menu' => __( 'Top Bar Menu - Responsive Mode', 'skeleton' ),
  397. ) );
  398. }
  399. add_action('init', 'mdnw_register_menus'); /* Run the above function at the init() hook */
  400.  
  401.  
  402.  
  403. /* ---------------------------------------------------------*/
  404. /* SIDEBARS */
  405. /* ---------------------------------------------------------*/
  406. function mdnw_register_sidebars() {
  407. register_sidebar( array(
  408. 'name' => __( 'Tophat Dropdown Column 1', 'skeleton' ),
  409. 'id' => 'dropdown-widget-1',
  410. 'description' => __( 'The first column in the tophat dropdown widget area. ', 'skeleton' ),
  411. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  412. 'after_widget' => '<hr class="partial-bottom" /></div>',
  413. 'before_title' => '<h3 class="widget-title">',
  414. 'after_title' => '</h3>',
  415. ) );
  416. register_sidebar( array(
  417. 'name' => __( 'Tophat Dropdown Column 2', 'skeleton' ),
  418. 'id' => 'dropdown-widget-2',
  419. 'description' => __( 'The second column in the tophat dropdown widget area. ', 'skeleton' ),
  420. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  421. 'after_widget' => '<hr class="partial-bottom" /></div>',
  422. 'before_title' => '<h3 class="widget-title">',
  423. 'after_title' => '</h3>',
  424. ) );
  425. register_sidebar( array(
  426. 'name' => __( 'Tophat Dropdown Column 3', 'skeleton' ),
  427. 'id' => 'dropdown-widget-3',
  428. 'description' => __( 'The third column in the tophat dropdown widget area. ', 'skeleton' ),
  429. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  430. 'after_widget' => '<hr class="partial-bottom" /></div>',
  431. 'before_title' => '<h3 class="widget-title">',
  432. 'after_title' => '</h3>',
  433. ) );
  434. register_sidebar( array(
  435. 'name' => __( 'Tophat Dropdown Column 4', 'skeleton' ),
  436. 'id' => 'dropdown-widget-4',
  437. 'description' => __( 'The fourth column in the tophat dropdown widget area. ', 'skeleton' ),
  438. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  439. 'after_widget' => '<hr class="partial-bottom" /></div>',
  440. 'before_title' => '<h3 class="widget-title">',
  441. 'after_title' => '</h3>',
  442. ) );
  443.  
  444. register_sidebar( array(
  445. 'name' => __( 'Default Post/Page Sidebar', 'skeleton' ),
  446. 'id' => 'default-widget-area',
  447. 'description' => __( 'Default widget area for posts/pages. ', 'skeleton' ),
  448. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  449. 'after_widget' => '<hr class="partial-bottom" /></div>',
  450. 'before_title' => '<h3 class="widget-title">',
  451. 'after_title' => '</h3>',
  452. ) );
  453.  
  454. register_sidebar( array(
  455. 'name' => __( 'Secondary Post/Page Sidebar 2', 'skeleton' ),
  456. 'id' => 'secondary-widget-area',
  457. 'description' => __( 'Secondary widget area for posts/pages. ', 'skeleton' ),
  458. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  459. 'after_widget' => '<hr class="partial-bottom" /></div>',
  460. 'before_title' => '<h3 class="widget-title">',
  461. 'after_title' => '</h3>',
  462. ) );
  463.  
  464. /*
  465. register_sidebar( array(
  466. 'name' => __( 'Pre-Footer Column 1', 'skeleton' ),
  467. 'id' => 'pre-footer-widget-1',
  468. 'description' => __( 'The first column in the pre-footer widget area.', 'skeleton' ),
  469. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  470. 'after_widget' => '</div>',
  471. 'before_title' => '<h4 class="footer-widget-title">',
  472. 'after_title' => '</h4>',
  473. ) );
  474. register_sidebar( array(
  475. 'name' => __( 'Pre-Footer Column 2', 'skeleton' ),
  476. 'id' => 'pre-footer-widget-2',
  477. 'description' => __( 'The second column in the pre-footer widget area.', 'skeleton' ),
  478. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  479. 'after_widget' => '</div>',
  480. 'before_title' => '<h4 class="footer-widget-title">',
  481. 'after_title' => '</h4>',
  482. ) );
  483. register_sidebar( array(
  484. 'name' => __( 'Pre-Footer Column 3', 'skeleton' ),
  485. 'id' => 'pre-footer-widget-3',
  486. 'description' => __( 'The third column in the pre-footer widget area.', 'skeleton' ),
  487. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  488. 'after_widget' => '</div>',
  489. 'before_title' => '<h4 class="footer-widget-title">',
  490. 'after_title' => '</h4>',
  491. ) );
  492. */
  493.  
  494. register_sidebar( array(
  495. 'name' => __( 'Footer Column 1', 'skeleton' ),
  496. 'id' => 'footer-widget-1',
  497. 'description' => __( 'The first column in the footer widget area.', 'skeleton' ),
  498. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  499. 'after_widget' => '</div>',
  500. 'before_title' => '<h2 class="footer-widget-title">',
  501. 'after_title' => '</h2>',
  502. ) );
  503. register_sidebar( array(
  504. 'name' => __( 'Footer Column 2', 'skeleton' ),
  505. 'id' => 'footer-widget-2',
  506. 'description' => __( 'The second column in the footer widget area.', 'skeleton' ),
  507. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  508. 'after_widget' => '</div>',
  509. 'before_title' => '<h2 class="footer-widget-title">',
  510. 'after_title' => '</h2>',
  511. ) );
  512. register_sidebar( array(
  513. 'name' => __( 'Footer Column 3', 'skeleton' ),
  514. 'id' => 'footer-widget-3',
  515. 'description' => __( 'The third column in the footer widget area.', 'skeleton' ),
  516. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  517. 'after_widget' => '</div>',
  518. 'before_title' => '<h2 class="footer-widget-title">',
  519. 'after_title' => '</h2>',
  520. ) );
  521. register_sidebar( array(
  522. 'name' => __( 'Footer Column 4', 'skeleton' ),
  523. 'id' => 'footer-widget-4',
  524. 'description' => __( 'The fourth column in the footer widget area.', 'skeleton' ),
  525. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  526. 'after_widget' => '</div>',
  527. 'before_title' => '<h2 class="footer-widget-title">',
  528. 'after_title' => '</h2>',
  529. ) );
  530.  
  531. register_sidebar( array(
  532. 'name' => __( 'Bonus Sidebar: Google News Widget', 'skeleton' ),
  533. 'id' => 'bonus-widget-1',
  534. 'description' => __( 'Add "Google News Just Better" Widget Here.', 'skeleton' ),
  535. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  536. 'after_widget' => '</div>',
  537. 'before_title' => '<h4 class="footer-widget-title">',
  538. 'after_title' => '</h4>',
  539. ) );
  540. register_sidebar( array(
  541. 'name' => __( 'Bonus Sidebar: Popular Post Widget', 'skeleton' ),
  542. 'id' => 'bonus-widget-2',
  543. 'description' => __( 'Add "Jetpack Popular Post Widget/Plugin" Here.', 'skeleton' ),
  544. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  545. 'after_widget' => '</div>',
  546. 'before_title' => '<h4 class="footer-widget-title">',
  547. 'after_title' => '</h4>',
  548. ) );
  549. register_sidebar( array(
  550. 'name' => __( 'Bonus Sidebar: Twitter Feed Widget', 'skeleton' ),
  551. 'id' => 'bonus-widget-3',
  552. 'description' => __( 'Add Text Widget Here > Create Widget in Settings Section of Your Twitter Account > And Paste Generated Embed Here.', 'skeleton' ),
  553. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  554. 'after_widget' => '</div>',
  555. 'before_title' => '<h4 class="footer-widget-title">',
  556. 'after_title' => '</h4>',
  557. ) );
  558. register_sidebar( array(
  559. 'name' => __( 'Bonus Sidebar: Ajaxy Live Search', 'skeleton' ),
  560. 'id' => 'bonus-widget-4',
  561. 'description' => __( 'Add "Ajaxy Live Search Widget" Here.', 'skeleton' ),
  562. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  563. 'after_widget' => '</div>',
  564. 'before_title' => '<h4 class="footer-widget-title">',
  565. 'after_title' => '</h4>',
  566. ) );
  567.  
  568. register_sidebar( array(
  569. 'name' => __( '404 Page Sidebar', 'skeleton' ),
  570. 'id' => '404-widget-area',
  571. 'description' => __( 'Add some widgets to help lost users find their content.', 'skeleton' ),
  572. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  573. 'after_widget' => '</div>',
  574. 'before_title' => '<h3 class="widget-title">',
  575. 'after_title' => '</h3>',
  576. ) );
  577.  
  578. }
  579. add_action('widgets_init', 'mdnw_register_sidebars');
  580.  
  581.  
  582.  
  583.  
  584. /* ---------------------------------------------------------*/
  585. /* COMMENTS */
  586. /* ---------------------------------------------------------*/
  587. if ( ! function_exists( 'twentyeleven_comment' ) ) :
  588. /**
  589. * Template for comments and pingbacks.
  590. *
  591. * To override this walker in a child theme without modifying the comments template
  592. * simply create your own twentyeleven_comment(), and that function will be used instead.
  593. *
  594. * Used as a callback by wp_list_comments() for displaying the comments.
  595. *
  596. * @since Twenty Eleven 1.0
  597. */
  598. function twentyeleven_comment( $comment, $args, $depth ) {
  599. $GLOBALS['comment'] = $comment;
  600. switch ( $comment->comment_type ) :
  601. case 'pingback' :
  602. case 'trackback' :
  603. ?>
  604. <li class="post pingback">
  605. <p><?php _e( 'Pingback:', 'skeleton' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'skeleton' ), '<span class="edit-link">', '</span>' ); ?></p>
  606. <?php
  607. break;
  608. default :
  609. ?>
  610. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  611. <article id="comment-<?php comment_ID(); ?>" class="comment">
  612. <footer class="comment-meta">
  613. <div class="comment-author vcard">
  614. <?php
  615. $avatar_size = 68;
  616. if ( '0' != $comment->comment_parent )
  617. $avatar_size = 39;
  618.  
  619. echo get_avatar( $comment, $avatar_size );
  620.  
  621. /* translators: 1: comment author, 2: date and time */
  622. printf( __( '%1$s on %2$s <span class="says">said:</span>', 'skeleton' ),
  623. sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
  624. sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
  625. esc_url( get_comment_link( $comment->comment_ID ) ),
  626. get_comment_time( 'c' ),
  627. /* translators: 1: date, 2: time */
  628. sprintf( __( '%1$s at %2$s', 'skeleton' ), get_comment_date(), get_comment_time() )
  629. )
  630. );
  631. ?>
  632.  
  633. <?php edit_comment_link( __( 'Edit', 'skeleton' ), '<span class="edit-link">', '</span>' ); ?>
  634. </div><!-- .comment-author .vcard -->
  635.  
  636. <?php if ( $comment->comment_approved == '0' ) : ?>
  637. <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'skeleton' ); ?></em>
  638. <br />
  639. <?php endif; ?>
  640.  
  641. </footer>
  642.  
  643. <div class="comment-content"><?php comment_text(); ?></div>
  644.  
  645. <div class="reply">
  646. <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>&darr;</span>', 'skeleton' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  647. </div><!-- .reply -->
  648. </article><!-- #comment-## -->
  649.  
  650. <?php
  651. break;
  652. endswitch;
  653. }
  654. endif; // ends check for twentyeleven_comment()
  655.  
  656.  
  657.  
  658.  
  659. /* ---------------------------------------------------------*/
  660. /* NAVIGATION WALKER - DESKTOP (allows for description) */
  661. /* ---------------------------------------------------------*/
  662. class description_walker extends Walker_Nav_Menu
  663. {
  664. //function start_el(&$output, $item, $depth, $args){
  665. function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
  666. global $wp_query;
  667. $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
  668.  
  669. $class_names = $value = '';
  670.  
  671. $classes = empty( $item->classes ) ? array() : (array) $item->classes;
  672.  
  673. $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
  674. $class_names = ' class="'. esc_attr( $class_names ) . '"';
  675.  
  676. $output .= $indent . '<li title="'. $item->title . '"' . $value . $class_names .'>';
  677. $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
  678. $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
  679. $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
  680. $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
  681.  
  682. $prepend = '<strong>';
  683. $append = '</strong>';
  684. $description = ! empty( $item->description ) ? '<span>'.esc_attr( $item->description ).'</span>' : '';
  685.  
  686. if($depth != 0)
  687. {
  688. $description = $append = $prepend = "";
  689. }
  690.  
  691. $item_output = $args->before;
  692. $item_output .= '<a'. $attributes .'>';
  693. $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
  694. $item_output .= $description.$args->link_after;
  695. $item_output .= '</a>';
  696. $item_output .= $args->after;
  697.  
  698. $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
  699. }
  700. }
  701.  
  702.  
  703.  
  704.  
  705. /* ---------------------------------------------------------*/
  706. /* MOBILE WALKER - MOBILE */
  707. /* ---------------------------------------------------------*/
  708. class mobile_walker extends Walker_Nav_Menu
  709. {
  710. //function start_el(&$output, $item, $depth, $args){
  711. function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
  712. global $wp_query;
  713. $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
  714.  
  715. $class_names = $value = '';
  716.  
  717. $classes = empty( $item->classes ) ? array() : (array) $item->classes;
  718.  
  719. $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
  720. $class_names = ' class="'. esc_attr( $class_names ) . '"';
  721.  
  722. $output .= $indent . '<li title="'. $item->title . '"' . $value . $class_names .'>';
  723.  
  724. $children = get_posts(array('post_type' => 'nav_menu_item', 'nopaging' => true, 'numberposts' => 1, 'meta_key' => '_menu_item_menu_item_parent', 'meta_value' => $item->ID));
  725.  
  726. $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
  727. $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
  728. $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
  729. $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
  730.  
  731. $prepend = '<div class="top sans">';
  732. $append = '</div>';
  733.  
  734. $description = ! empty( $item->title ) ? '<div class="bottom">'.esc_attr( $item->attr_title ).'</div>' : '';
  735.  
  736. if($depth != 0)
  737. {
  738. $description = $append = $prepend = "";
  739. }
  740.  
  741. $item_output = $args->before;
  742. $item_output .= '<a'. $attributes .'>';
  743. $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
  744. $item_output .= $description.$args->link_after;
  745. $item_output .= '</a>';
  746. $item_output .= $args->after;
  747.  
  748. $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
  749. }
  750.  
  751. function start_lvl(&$output, $depth) {
  752. $indent = str_repeat("\t", $depth);
  753.  
  754. $output .= "\n$indent<ul class=\"dl-submenu level-".$depth."\"><li class=\"dl-back\"><a href=\"#\">Back</a></li>";
  755. $output .= "\n";
  756. }
  757. }
  758.  
  759.  
  760. /* ---------------------------------------------------------*/
  761. /* BREADCRUMBS; */
  762. /* ---------------------------------------------------------*/
  763.  
  764. function get_breadcrumb() {
  765.  
  766. global $post;
  767.  
  768. $trail = '
  769.  
  770. ';
  771. $page_title = get_the_title($post->ID);
  772.  
  773. if($post->post_parent) {
  774. $parent_id = $post->post_parent;
  775.  
  776. while ($parent_id) {
  777. $page = get_page($parent_id);
  778. $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a> ยป ';
  779. $parent_id = $page->post_parent;
  780. }
  781.  
  782. $breadcrumbs = array_reverse($breadcrumbs);
  783. foreach($breadcrumbs as $crumb) $trail .= $crumb;
  784. }
  785.  
  786. $trail .= $page_title;
  787. $trail .= '
  788.  
  789. ';
  790.  
  791. return $trail;
  792.  
  793. }
  794.  
  795.  
  796. /* ---------------------------------------------------------*/
  797. /* CUSTOM EXCERPT - A custom excerpt length with: excerpt(20); */
  798. /* ---------------------------------------------------------*/
  799. function excerpt($limit) {
  800. $excerpt = explode(' ', get_the_excerpt(), $limit);
  801. if (count($excerpt)>=$limit) {
  802. array_pop($excerpt);
  803. $excerpt = implode(" ",$excerpt).'...';
  804. } else {
  805. $excerpt = implode(" ",$excerpt);
  806. }
  807. $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
  808. return $excerpt;
  809. }
  810.  
  811. function content($limit) {
  812. $content = explode(' ', get_the_content(), $limit);
  813. if (count($content)>=$limit) {
  814. array_pop($content);
  815. $content = implode(" ",$content).'...';
  816. } else {
  817. $content = implode(" ",$content);
  818. }
  819. $content = preg_replace('/\[.+\]/','', $content);
  820. $content = apply_filters('the_content', $content);
  821. $content = str_replace(']]>', ']]&gt;', $content);
  822. return $content;
  823. }
  824.  
  825.  
  826.  
  827.  
  828. /* ---------------------------------------------------------*/
  829. /* PRE-LOAD ANY PLUGINS FOR THEME ACTIVATION */
  830. /* ---------------------------------------------------------*/
  831. require_once( get_template_directory() . '/functions/tgm-plugin-activation/class-tgm-plugin-activation.php' );
  832. add_action( 'tgmpa_register', 'my_theme_register_required_plugins' );
  833. function my_theme_register_required_plugins() {
  834. $plugins = array(
  835.  
  836. /* === REQUIRED AND PREMIUM PLUGINS === */
  837. array(
  838. 'name' => 'Revolution Slider', // The plugin name
  839. 'slug' => 'revslider', // The plugin slug (typically the folder name)
  840. 'source' => get_stylesheet_directory() . '/functions/tgm-plugin-activation/plugins/revslider.zip', // The plugin source
  841. 'required' => true, // If false, the plugin is only 'recommended' instead of required
  842. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  843. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  844. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  845. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  846. ),
  847. array(
  848. 'name' => 'Visual Composer (Layout Builder)', // The plugin name
  849. 'slug' => 'js_composer', // The plugin slug (typically the folder name)
  850. 'source' => get_stylesheet_directory() . '/functions/tgm-plugin-activation/plugins/js_composer.zip', // The plugin source
  851. 'required' => true, // If false, the plugin is only 'recommended' instead of required
  852. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  853. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  854. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  855. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  856. ),
  857. array(
  858. 'name' => 'JackBox (Lightbox Plugin)', // The plugin name
  859. 'slug' => 'wp-jackbox', // The plugin slug (typically the folder name)
  860. 'source' => get_stylesheet_directory() . '/functions/tgm-plugin-activation/plugins/wp-jackbox.zip', // The plugin source
  861. 'required' => true, // If false, the plugin is only 'recommended' instead of required
  862. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  863. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  864. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  865. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  866. ),
  867.  
  868. /* === RECOMMENDED PLUGINS === */
  869. array(
  870. 'name' => 'Advanced Excerpt', // The plugin name
  871. 'slug' => 'advanced-excerpt', // The plugin slug (typically the folder name)
  872. 'source' => 'http://downloads.wordpress.org/plugin/advanced-excerpt.4.2.3.zip', // The plugin source
  873. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  874. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  875. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  876. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  877. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  878. ),
  879. array(
  880. 'name' => 'Ajaxy Live Search Form', // The plugin name
  881. 'slug' => 'ajaxy-search-form', // The plugin slug (typically the folder name)
  882. 'source' => 'http://downloads.wordpress.org/plugin/ajaxy-search-form.zip', // The plugin source
  883. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  884. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  885. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  886. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  887. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  888. ),
  889. array(
  890. 'name' => 'Custom Sidebars', // The plugin name
  891. 'slug' => 'custom-sidebars', // The plugin slug (typically the folder name)
  892. 'source' => 'http://downloads.wordpress.org/plugin/custom-sidebars.zip', // The plugin source
  893. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  894. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  895. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  896. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  897. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  898. ),
  899. array(
  900. 'name' => 'Contact Form 7', // The plugin name
  901. 'slug' => 'contact-form-7', // The plugin slug (typically the folder name)
  902. 'source' => 'http://downloads.wordpress.org/plugin/contact-form-7.3.9.3.zip', // The plugin source
  903. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  904. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  905. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  906. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  907. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  908. ),
  909. array(
  910. 'name' => 'Dynamic To Top', // The plugin name
  911. 'slug' => 'dynamic-to-top', // The plugin slug (typically the folder name)
  912. 'source' => 'http://downloads.wordpress.org/plugin/dynamic-to-top.3.4.2.zip', // The plugin source
  913. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  914. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  915. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  916. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  917. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  918. ),
  919. array(
  920. 'name' => 'Easy Theme And Plugin Upgrades', // The plugin name
  921. 'slug' => 'easy-theme-and-plugin-upgrades', // The plugin slug (typically the folder name)
  922. 'source' => 'http://downloads.wordpress.org/plugin/easy-theme-and-plugin-upgrades.1.0.4.zip', // The plugin source
  923. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  924. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  925. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  926. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  927. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  928. ),
  929. array(
  930. 'name' => 'Google News Widget', // The plugin name
  931. 'slug' => 'google-news-widget', // The plugin slug (typically the folder name)
  932. 'source' => 'http://downloads.wordpress.org/plugin/google-news-widget.1.4.zip', // The plugin source
  933. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  934. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  935. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  936. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  937. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  938. ),
  939. array(
  940. 'name' => 'Image Widget', // The plugin name
  941. 'slug' => 'image-widget', // The plugin slug (typically the folder name)
  942. 'source' => 'http://downloads.wordpress.org/plugin/image-widget.4.1.zip', // The plugin source
  943. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  944. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  945. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  946. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  947. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  948. ),
  949. array(
  950. 'name' => 'Popular Post Tab Widget For Jetpack', // The plugin name
  951. 'slug' => 'popular-posts-tab-widget-for-jetpack', // The plugin slug (typically the folder name)
  952. 'source' => 'http://downloads.wordpress.org/plugin/popular-posts-tab-widget-for-jetpack.1.3.zip', // The plugin source
  953. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  954. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  955. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  956. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  957. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  958. ),
  959. array(
  960. 'name' => 'Recent Post Widget Extended', // The plugin name
  961. 'slug' => 'recent-posts-widget-extended', // The plugin slug (typically the folder name)
  962. 'source' => 'http://downloads.wordpress.org/plugin/recent-posts-widget-extended.0.9.3.zip', // The plugin source
  963. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  964. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  965. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  966. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  967. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  968. ),
  969. array(
  970. 'name' => 'Shortcodes Ultimate', // The plugin name
  971. 'slug' => 'shortcodes-ultimate', // The plugin slug (typically the folder name)
  972. 'source' => 'http://downloads.wordpress.org/plugin/shortcodes-ultimate.zip', // The plugin source
  973. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  974. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  975. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  976. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  977. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  978. ),
  979. array(
  980. 'name' => 'SVG Vector Font Icons', // The plugin name
  981. 'slug' => 'svg-vector-icon-plugin', // The plugin slug (typically the folder name)
  982. 'source' => 'http://downloads.wordpress.org/plugin/svg-vector-icon-plugin.2.3.2.zip', // The plugin source
  983. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  984. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  985. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  986. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  987. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  988. ),
  989. array(
  990. 'name' => 'WP Paginate', // The plugin name
  991. 'slug' => 'wp-paginate', // The plugin slug (typically the folder name)
  992. 'source' => 'http://downloads.wordpress.org/plugin/wp-paginate.1.2.5.zip', // The plugin source
  993. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  994. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  995. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  996. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  997. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  998. ),
  999. array(
  1000. 'name' => 'Zilla Shortcodes', // The plugin name
  1001. 'slug' => 'zilla-shortcodes', // The plugin slug (typically the folder name)
  1002. 'source' => get_stylesheet_directory() . '/functions/tgm-plugin-activation/plugins/zilla-shortcodes.zip', // The plugin source
  1003. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  1004. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1005. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1006. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1007. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1008. ),
  1009.  
  1010. array(
  1011. 'name' => 'WooCommerce', // The plugin name
  1012. 'slug' => 'woocommerce', // The plugin slug (typically the folder name)
  1013. 'source' => 'http://downloads.wordpress.org/plugin/woocommerce.zip', // The plugin source
  1014. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  1015. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1016. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1017. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1018. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1019. ),
  1020. array(
  1021. 'name' => 'The Events Calander', // The plugin name
  1022. 'slug' => 'the-events-calendar', // The plugin slug (typically the folder name)
  1023. 'source' => 'http://downloads.wordpress.org/plugin/the-events-calendar.3.7.zip', // The plugin source
  1024. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  1025. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1026. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1027. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1028. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1029. ),
  1030.  
  1031. array(
  1032. 'name' => 'WordPress Importer', // The plugin name
  1033. 'slug' => 'wordpress-importer', // The plugin slug (typically the folder name)
  1034. 'source' => 'http://downloads.wordpress.org/plugin/wordpress-importer.zip', // The plugin source
  1035. 'required' => true, // If false, the plugin is only 'recommended' instead of required
  1036. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1037. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1038. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1039. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1040. ),
  1041. array(
  1042. 'name' => 'Widget Importer & Exporter', // The plugin name
  1043. 'slug' => 'widget-importer-exporter', // The plugin slug (typically the folder name)
  1044. 'source' => 'http://downloads.wordpress.org/plugin/widget-importer-exporter.zip', // The plugin source
  1045. 'required' => true, // If false, the plugin is only 'recommended' instead of required
  1046. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1047. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1048. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1049. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1050. ),
  1051.  
  1052. /* ======= */
  1053. /*array(
  1054. 'name' => 'OptionTree', // The plugin name
  1055. 'slug' => 'option-tree', // The plugin slug (typically the folder name)
  1056. 'source' => get_stylesheet_directory() . '/functions/tgm-plugin-activation/plugins/option-tree.zip', // The plugin source
  1057. 'required' => true, // If false, the plugin is only 'recommended' instead of required
  1058. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1059. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1060. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1061. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1062. ),
  1063. array(
  1064. 'name' => 'JetPack', // The plugin name
  1065. 'slug' => 'jetpack', // The plugin slug (typically the folder name)
  1066. 'source' => 'http://downloads.wordpress.org/plugin/jetpack.latest-stable.zip', // The plugin source
  1067. 'required' => false, // If false, the plugin is only 'recommended' instead of required
  1068. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
  1069. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
  1070. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
  1071. 'external_url' => '', // If set, overrides default API URL and points to an external URL
  1072. ),*/
  1073. );
  1074. $theme_text_domain = 'skeleton';
  1075. $config = array(
  1076. 'domain' => $theme_text_domain, // Text domain - likely want to be the same as your theme.
  1077. 'default_path' => '', // Default absolute path to pre-packaged plugins
  1078. 'parent_menu_slug' => 'themes.php', // Default parent menu slug
  1079. 'parent_url_slug' => 'themes.php', // Default parent URL slug
  1080. 'menu' => 'install-required-plugins', // Menu slug
  1081. 'has_notices' => true, // Show admin notices or not
  1082. 'is_automatic' => false, // Automatically activate plugins after installation or not
  1083. 'message' => '', // Message to output right before the plugins table
  1084. 'strings' => array(
  1085. 'page_title' => __( 'Install Required Plugins', $theme_text_domain ),
  1086. 'menu_title' => __( 'Install Plugins', $theme_text_domain ),
  1087. 'installing' => __( 'Installing Plugin: %s', $theme_text_domain ), // %1$s = plugin name
  1088. 'oops' => __( 'Something went wrong with the plugin API.', $theme_text_domain ),
  1089. 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme REQUIRES the following plugins: %1$s.' ), // %1$s = plugin name(s)
  1090. 'notice_can_install_recommended' => _n_noop( 'This theme recommend the following plugin: %1$s.', 'This theme RECOMMENDS the following plugins: %1$s. </br></br>Note: The recommended plugins are used in the demo and offered as helpful tools. Take what you want, and leave the rest! See your Full Start Guide for more documentation on this.' ), // %1$s = plugin name(s)
  1091. 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)
  1092. 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
  1093. 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
  1094. 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)
  1095. 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)
  1096. 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)
  1097. 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
  1098. 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),
  1099. 'return' => __( 'Return to Required Plugins Installer', $theme_text_domain ),
  1100. 'plugin_activated' => __( 'Plugin activated successfully.', $theme_text_domain ),
  1101. 'complete' => __( 'All plugins installed and activated successfully. %s', $theme_text_domain ) // %1$s = dashboard link
  1102. )
  1103. );
  1104. tgmpa( $plugins, $config );
  1105. }
  1106.  
  1107.  
  1108. // Show posts of 'post', 'incsub_event' post types on home page
  1109. add_action( 'pre_get_posts', 'add_my_post_types_to_query' );
  1110.  
  1111. function add_my_post_types_to_query( $query ) {
  1112. if ( is_home() && $query->is_main_query() )
  1113. $query->set( 'post_type', array( 'post', 'incsub_event') );
  1114. return $query;
  1115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement