Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Periodic Theme Functions
- *
- * This file will contain all of the parent theme's custom functions. The majority of these
- * functions are fired inside of the wap8_periodic_theme_setup function.
- *
- * If you are developing a child theme, know that your child theme's function.php file will
- * execute before the parent's. We recommend creating your own child theme setup function
- * and giving it a lower priority so that it executes after the parent.
- *
- * Example:
- *
- * add_action( 'after_setup_theme', 'my_periodic_theme_setup', 11 );
- * function my_periodic_theme_setup() {
- * write all of your actions and filters inside the brackets
- * }
- *
- * We set a priority of 11 so that it executes after the parent theme's function.php file.
- *
- * @package WordPress
- * @subpackage Periodic
- * @since Periodic 2.4.6
- * @author We Are Pixel8 http://www.wearepixel8.com
- *
- */
- /*-----------------------------------------------------------------------------------*/
- /* Load Theme Options Page
- /*-----------------------------------------------------------------------------------*/
- $functions_path = TEMPLATEPATH . '/functions/';
- require_once ( $functions_path . 'theme-options.php' );
- /*-----------------------------------------------------------------------------------*/
- /* Version cache for custom stylesheets and custom javascript files
- /*-----------------------------------------------------------------------------------*/
- function wap8_version_cache() {
- return '2.4.10';
- }
- /*-----------------------------------------------------------------------------------*/
- /* Periodic Theme Setup
- /*-----------------------------------------------------------------------------------*/
- add_action( 'after_setup_theme', 'wap8_periodic_theme_setup' );
- function wap8_periodic_theme_setup() {
- // Set the $content_width
- global $content_width;
- if ( !isset( $content_width ) ) $content_width = 620;
- // Add custom editor styles
- add_editor_style( 'periodic-editor-style.css' );
- // Add theme support for automatic-feed-links
- add_theme_support( 'automatic-feed-links' );
- // Add theme support for post-thumbnails
- add_theme_support( 'post-thumbnails' );
- // Add action for custom menus
- add_action( 'init', 'periodic_register_menus' );
- // Add action for registering sidebars
- add_action( 'widgets_init', 'periodic_register_sidebars' );
- // Add action for registering, deregistering and enqueueing global javascripts
- add_action( 'init', 'wap8_register_js' );
- // Add action for registering, deregistering and enqueueing global stylesheets
- add_action( 'init', 'wap8_register_css' );
- // Load custom theme widgets
- require_once( TEMPLATEPATH . '/widgets/widget-twitter.php' ); // Twitter Feed
- require_once( TEMPLATEPATH . '/widgets/widget-flickr.php' ); // Flickr Feed
- require_once( TEMPLATEPATH . '/widgets/widget-customcategories.php' ); // Custom Categories
- require_once( TEMPLATEPATH . '/widgets/widget-recentvideo.php' ); // Recent Video
- require_once( TEMPLATEPATH . '/widgets/widget-tabs.php' ); // Tabs
- require_once( TEMPLATEPATH . '/widgets/widget-rpcurrentcat.php' ); // Recent Posts from Current Categories
- require_once( TEMPLATEPATH . '/widgets/widget-125banner.php' ); // 125x125 Ad
- require_once( TEMPLATEPATH . '/widgets/widget-120banner.php' ); // 120x240 Ad
- require_once( TEMPLATEPATH . '/widgets/widget-120skyscraper.php' ); // 120x600 Ad
- require_once( TEMPLATEPATH . '/widgets/widget-300banner.php' ); // 300x250 Ad
- require_once( TEMPLATEPATH . '/widgets/widget-300half.php' ); // 300x600 Ad
- // Allow shortcodes in text widgets
- add_filter( 'widget_text', 'do_shortcode' );
- // Add action for theme options link in admin nav bar
- add_action( 'wp_before_admin_bar_render', 'periodic_options_link' );
- // Load custom theme plugins
- require_once( TEMPLATEPATH . '/plugins/wap8-browser-bodyclass.php' ); // Add browser client to body class
- require_once( TEMPLATEPATH . '/plugins/wap8-excerpt.php' ); // customize the post excerpt output
- require_once( TEMPLATEPATH . '/plugins/wap8-html-declaration.php' ); // add valid markup to the <html> tag
- require_once( TEMPLATEPATH . '/plugins/wap8-shortcodes.php' ); // shortcodes
- require_once( TEMPLATEPATH . '/plugins/wap8-commentcount.php' ); // the count for user generated comments
- require_once( TEMPLATEPATH . '/plugins/wap8-breadcrumbs.php' ); // breadcrumbs
- require_once( TEMPLATEPATH . '/plugins/wap8-contributors.php' ); // list contributors
- require_once( TEMPLATEPATH . '/plugins/wap8-imagerel.php' ); // add a rel tag to linked images in a post
- require_once( TEMPLATEPATH . '/plugins/wap8-postpassword.php' ); // modify the post password form
- // Load textdomain for localization
- load_theme_textdomain( 'periodic', TEMPLATEPATH . '/languages' );
- $locale = get_locale();
- $locale_file = TEMPLATEPATH . '/lang/$locale.php';
- if ( is_readable( $locale_file ) )
- require_once( $locale_file );
- }
- /*-----------------------------------------------------------------------------------*/
- /* Set post thumbnail image sizes
- /*-----------------------------------------------------------------------------------*/
- set_post_thumbnail_size(150, 150, true); // Standard Thumbnail Size
- add_image_size('thumbnail-archive', 270, 120, true); // Archives Thumbnail Size
- add_image_size('thumbnail-feature', 390, 280, true); // Features Thumbnail Size
- add_image_size('thumbnail-featurenav', 130, 60, true); // Feature Slider Nav Thumbnail Size
- add_image_size('thumbnail-leadimg', 610, 225, true); // Lead Image Thumbnail Size
- add_image_size('thumbnail-search', 130, 130, true); // Search Results Thumbnail Size
- add_image_size('thumbnail-sidebar', 60, 60, true); // Sidebar Thumbnail Size
- add_image_size('thumbnail-sidebarvid', 290, 215, true); // Sidebar Video Thumbnail Size
- add_image_size('thumbnail-sticky', 210, 100, true); // Sticky Post Thumbnail Size
- add_image_size('thumbnail-home', 290, 125, true); // Home lead Category Block Thumbnail Size
- /*-----------------------------------------------------------------------------------*/
- /* Register WP 3+ custom menus
- /*-----------------------------------------------------------------------------------*/
- function periodic_register_menus() {
- if ( function_exists( 'register_nav_menus' ) ) {
- register_nav_menus(
- array(
- 'utility-menu' => __( 'Utility Menu','periodic' ),
- 'main-menu' => __( 'Main Menu','periodic' ),
- )
- );
- }
- }
- /*-----------------------------------------------------------------------------------*/
- /* Fallback Page Menu
- /*-----------------------------------------------------------------------------------*/
- function periodic_page_menu() {
- echo '<ul class="header-menu">';
- wp_list_pages('title_li=');
- echo '</ul>';
- }
- /*-----------------------------------------------------------------------------------*/
- /* Fallback Category Menu
- /*-----------------------------------------------------------------------------------*/
- function periodic_category_menu() {
- echo '<ul>';
- wp_list_categories('title_li=');
- echo '</ul>';
- }
- /*-----------------------------------------------------------------------------------*/
- /* Register sidebars
- /*-----------------------------------------------------------------------------------*/
- function periodic_register_sidebars() {
- // Register sidebar for Home Page
- register_sidebar(
- array(
- 'id' => 'home',
- 'name' => __( 'Sidebar for Home Page', 'periodic' ),
- 'description' => __( 'Drag, organize and save widgets for the sidebar that will appear on your Home page.', 'periodic' ),
- 'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3 class="widget-head">',
- 'after_title' => '</h3>'
- )
- );
- // Register Right Sidebar
- register_sidebar(
- array(
- 'id' => 'right',
- 'name' => __( 'Right Sidebar', 'periodic' ),
- 'description' => __( 'Drag, organize and save widgets for the Right Sidebar.', 'periodic' ),
- 'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3 class="widget-head">',
- 'after_title' => '</h3>'
- )
- );
- // Register Left Sidebar
- register_sidebar(
- array(
- 'id' => 'left',
- 'name' => __( 'Left Sidebar', 'periodic' ),
- 'description' => __( 'Drag, organize and save widgets for the Left Sidebar.', 'periodic' ),
- 'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3 class="widget-head">',
- 'after_title' => '</h3>'
- )
- );
- // Register Footer Column 1
- register_sidebar(
- array(
- 'id' => 'footer-column-one',
- 'name' => __( 'Footer Column One', 'periodic' ),
- 'description' => __( 'Drag, organize and save widgets for the first Footer Column.', 'periodic' ),
- 'before_widget' => '<div id="%1$s" class="footer-widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>'
- )
- );
- // Register Footer Column 2
- register_sidebar(
- array(
- 'id' => 'footer-column-two',
- 'name' => __( 'Footer Column Two', 'periodic' ),
- 'description' => __( 'Drag, organize and save widgets for the second Footer Column.', 'periodic' ),
- 'before_widget' => '<div id="%1$s" class="footer-widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>'
- )
- );
- // Register Footer Column 3
- register_sidebar(
- array(
- 'id' => 'footer-column-three',
- 'name' => __( 'Footer Column Three', 'periodic' ),
- 'description' => __( 'Drag, organize and save widgets for the third Footer Column.', 'periodic' ),
- 'before_widget' => '<div id="%1$s" class="footer-widget %2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>'
- )
- );
- }
- /*-----------------------------------------------------------------------------------*/
- /* Register, deregister and enqueue global javascripts
- /*-----------------------------------------------------------------------------------*/
- function wap8_register_js() {
- if ( !is_admin() ) {
- // Register javascripts
- wp_register_script( 'jquery-easing', get_template_directory_uri() . '/js/jquery.easing.1.3.min.js', 'jquery', '1.3', true );
- wp_register_script( 'jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery', 'jquery-easing' ), '2.99', true );
- wp_register_script( 'jquery-fancybox', get_template_directory_uri() . '/js/jquery.fancybox-1.3.4.min.js', array( 'jquery', 'jquery-easing' ), '1.3.4', true );
- wp_register_script( 'jquery-superfish', get_template_directory_uri() . '/js/jquery.superfish-1.4.8.min.js', 'jquery', '1.4.8', true );
- wp_register_script( 'jquery-supersubs', get_template_directory_uri() . '/js/jquery.supersubs-0.2b.min.js', array( 'jquery', 'jquery-superfish' ), '0.2b', true );
- wp_register_script( 'periodic-jquery', get_template_directory_uri() . '/js/periodic.js', array( 'jquery', 'jquery-easing', 'jquery-cycle', 'jquery-fancybox', 'jquery-superfish', 'jquery-supersubs', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-tabs' ), wap8_version_cache(), true );
- wp_register_script( 'digg-share', get_template_directory_uri() . '/js/digg.js', array( 'jquery' ) , wap8_version_cache(), true );
- wp_register_script( 'twitter-platform-script', 'http://platform.twitter.com/widgets.js', array( 'jquery' ), wap8_version_cache(), true );
- wp_register_script( 'google-plus-script', get_template_directory_uri() . '/js/google-plusone.js', array( 'jquery' ), wap8_version_cache(), true );
- // Enqueue javascripts
- wp_enqueue_script( 'jquery' );
- wp_enqueue_script( 'periodic-jquery' );
- wp_enqueue_script( 'jquery-easing' );
- wp_enqueue_script( 'jquery-cycle' );
- wp_enqueue_script( 'jquery-fancybox' );
- wp_enqueue_script( 'jquery-superfish' );
- wp_enqueue_script( 'jquery-supersubs' );
- wp_enqueue_script( 'jquery-ui-core' );
- wp_enqueue_script( 'jquery-ui-widget' );
- wp_enqueue_script( 'jquery-ui-tabs' );
- }
- }
- /*-----------------------------------------------------------------------------------*/
- /* Register, deregister and enqueue global stylesheets
- /*-----------------------------------------------------------------------------------*/
- function wap8_register_css() {
- if ( !is_admin() ) {
- // Register core stylesheet
- wp_register_style( 'periodic-core', get_template_directory_uri() . '/style.css', '', wap8_version_cache(), 'screen' );
- wp_register_style( 'periodic-print', get_template_directory_uri() . '/css/print.css', 'periodic-core', wap8_version_cache(), 'print' );
- wp_register_style( 'black-blue', get_template_directory_uri() . '/css/black-blue.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'black-green', get_template_directory_uri() . '/css/black-green.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'black-orange', get_template_directory_uri() . '/css/black-orange.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'black-pink', get_template_directory_uri() . '/css/black-pink.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'black-purple', get_template_directory_uri() . '/css/black-purple.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'black-red', get_template_directory_uri() . '/css/black-red.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'legacy-blue', get_template_directory_uri() . '/css/blue.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'legacy-green', get_template_directory_uri() . '/css/green.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'legacy-orange', get_template_directory_uri() . '/css/orange.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'legacy-pink', get_template_directory_uri() . '/css/pink.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'legacy-purple', get_template_directory_uri() . '/css/purple.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'legacy-red', get_template_directory_uri() . '/css/red.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'spectrum-blue', get_template_directory_uri() . '/css/spectrum-blue.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'spectrum-green', get_template_directory_uri() . '/css/spectrum-green.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'spectrum-orange', get_template_directory_uri() . '/css/spectrum-orange.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'spectrum-pink', get_template_directory_uri() . '/css/spectrum-pink.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'spectrum-purple', get_template_directory_uri() . '/css/spectrum-purple.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'spectrum-red', get_template_directory_uri() . '/css/spectrum-red.css', 'periodic-core', wap8_version_cache(), 'screen' );
- wp_register_style( 'fancybox-styles', get_template_directory_uri() . '/fancybox/jquery.fancybox-1.3.4.css', '', '1.3.4', 'screen' );
- wp_register_style( 'wap8_google-fonts', 'http://fonts.googleapis.com/css?family=Vollkorn:400italic,400', '', wap8_version_cache(), 'screen' );
- // Enqueue stylesheets
- wp_enqueue_style( 'fancybox-styles' );
- wp_enqueue_style( 'wap8_google-fonts' );
- wp_enqueue_style( 'periodic-print' );
- if ( get_option( 'wap8_css' ) == 'Black and Blue' ) {
- wp_enqueue_style( 'black-blue' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Black and Green' ) {
- wp_enqueue_style( 'black-green' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Black and Orange' ) {
- wp_enqueue_style( 'black-orange' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Black and Pink' ) {
- wp_enqueue_style( 'black-pink' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Black and Purple' ) {
- wp_enqueue_style( 'black-purple' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Black and Red' ) {
- wp_enqueue_style( 'black-red' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Legacy Blue' ) {
- wp_enqueue_style( 'legacy-blue' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Legacy Green' ) {
- wp_enqueue_style( 'legacy-green' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Legacy Orange' ) {
- wp_enqueue_style( 'legacy-orange' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Legacy Pink' ) {
- wp_enqueue_style( 'legacy-pink' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Legacy Purple' ) {
- wp_enqueue_style( 'legacy-purple' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Legacy Red' ) {
- wp_enqueue_style( 'legacy-red' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Dark Spectrum Blue' ) {
- wp_enqueue_style( 'spectrum-blue' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Dark Spectrum Green' ) {
- wp_enqueue_style( 'spectrum-green' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Dark Spectrum Orange' ) {
- wp_enqueue_style( 'spectrum-orange' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Dark Spectrum Pink' ) {
- wp_enqueue_style( 'spectrum-pink' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Dark Spectrum Purple' ) {
- wp_enqueue_style( 'spectrum-purple' );
- }
- elseif ( get_option( 'wap8_css' ) == 'Dark Spectrum Red' ) {
- wp_enqueue_style( 'spectrum-red' );
- }
- }
- }
- /*-----------------------------------------------------------------------------------*/
- /* Add Theme Options link to WordPress Admin Nav Bar
- /*-----------------------------------------------------------------------------------*/
- function periodic_options_link() {
- global $wp_admin_bar;
- $wp_admin_bar -> add_menu( array(
- 'parent' => 'appearance',
- 'id' => 'periodic_options_link',
- 'title' => __( 'Periodic Settings', 'periodic' ),
- 'href' => admin_url( 'themes.php?page=theme-options.php' )
- ));
- }
- /*-----------------------------------------------------------------------------------*/
- /* Custom comments callback
- /*-----------------------------------------------------------------------------------*/
- function periodic_comments($comment, $args, $depth) {
- $GLOBALS['comment'] = $comment; ?>
- <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
- <div id="comment-<?php comment_ID(); ?>">
- <div class="comment-author vcard">
- <p><?php echo get_avatar($comment,$size='50',$default=get_option('wap8_comment_avatar') ); ?></p>
- </div>
- <div class="comment-body clear">
- <div class="comment-meta commentmetadata">
- <?php printf(__('<cite class="comment-cite">%s</cite>'), get_comment_author_link()) ?>
- <p><?php printf(__('%1$s at %2$s','periodic'), get_comment_date(),get_comment_time()) ?></p>
- <p><?php edit_comment_link(__('(Edit)','periodic'),' ','') ?></p>
- </div>
- <div class="comment-text">
- <?php if ($comment->comment_approved == '0') : ?>
- <p><em><?php _e('Your comment is awaiting moderation.','periodic') ?></em></p>
- <?php endif; ?>
- <?php comment_text() ?>
- </div>
- <?php if($args['max_depth']!=$depth) { ?>
- <div class="reply">
- <p><?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></p>
- </div>
- </div>
- <?php } ?>
- </div>
- <?php
- }
- /*-----------------------------------------------------------------------------------*/
- /* Custom trackbacks callback
- /*-----------------------------------------------------------------------------------*/
- function periodic_trackbacks($comment) {
- $GLOBALS['comment'] = $comment; ?>
- <li><?php printf(__('<cite class="trackback-cite">%s</cite>'), get_comment_author_link()) ?> <?php edit_comment_link(__('(Edit)','periodic'),' ','') ?></li>
- <?php
- }
- /*-----------------------------------------------------------------------------------*/
- /* TGM Plugin Activation
- /*-----------------------------------------------------------------------------------*/
- require_once dirname( __FILE__ ) . '/lib/class-tgm-plugin-activation.php';
- add_action( 'tgmpa_register', 'wap8_theme_register_required_plugins' );
- function wap8_theme_register_required_plugins() {
- $plugins = array(
- // WP-PageNavi
- array(
- 'name' => 'WP-PageNavi',
- 'slug' => 'wp-pagenavi',
- 'required' => false,
- 'version' => '2.82'
- ),
- // Contact Form 7
- array(
- 'name' => 'Contact Form 7',
- 'slug' => 'contact-form-7',
- 'required' => false,
- 'version' => '3.1'
- ),
- // Simple Video Embedder
- array(
- 'name' => 'Simple Video Embedder',
- 'slug' => 'simple-video-embedder',
- 'required' => false,
- 'version' => '2.2'
- ),
- // Google Analytics for WordPress
- array(
- 'name' => 'Google Analytics for WordPress',
- 'slug' => 'google-analytics-for-wordpress',
- 'required' => false,
- 'version' => '4.2.4'
- ),
- // Regenerate Thumbnails
- array(
- 'name' => 'Regenerate Thubmnails',
- 'slug' => 'regenerate-thumbnails',
- 'required' => false,
- 'version' => '2.2.3'
- ),
- // Codestyling Localization
- array(
- 'name' => 'Codestyling Localization',
- 'slug' => 'codestyling-localization',
- 'required' => false,
- 'version' => '1.99.16'
- )
- );
- $theme_text_domain = 'periodic';
- /**
- * Array of configuration settings. Amend each line as needed.
- * If you want the default strings to be available under your own theme domain,
- * leave the strings uncommented.
- * Some of the strings are added into a sprintf, so see the comments at the
- * end of each line for what each argument will be.
- */
- $config = array(
- 'domain' => $theme_text_domain, // Text domain - likely want to be the same as your theme.
- 'default_path' => '', // Default absolute path to pre-packaged plugins
- 'parent_menu_slug' => 'themes.php', // Default parent menu slug
- 'parent_url_slug' => 'themes.php', // Default parent URL slug
- 'menu' => 'install-required-plugins', // Menu slug
- 'has_notices' => true, // Show admin notices or not
- 'is_automatic' => false, // Automatically activate plugins after installation or not
- 'message' => '', // Message to output right before the plugins table
- 'strings' => array(
- 'page_title' => __( 'Install Required Periodic Plugins', $theme_text_domain ),
- 'menu_title' => __( 'Install Periodic Plugins', $theme_text_domain ),
- 'installing' => __( 'Installing Periodic Plugin: %s', $theme_text_domain ), // %1$s = plugin name
- 'oops' => __( 'Something went wrong with the plugin API.', $theme_text_domain ),
- 'notice_can_install_required' => _n_noop( 'Periodic requires the following plugin: %1$s.', 'Periodic requires the following plugins: %1$s.' ), // %1$s = plugin name(s)
- 'notice_can_install_recommended' => _n_noop( 'Periodic recommends the following plugin: %1$s.', 'Periodic recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)
- '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)
- '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)
- '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)
- '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)
- 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with Periodic: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with Periodic: %1$s.' ), // %1$s = plugin name(s)
- '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)
- 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
- 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),
- 'return' => __( 'Return to Required Plugins Installer', $theme_text_domain ),
- 'plugin_activated' => __( 'Plugin activated successfully.', $theme_text_domain ),
- 'complete' => __( 'All plugins installed and activated successfully. %s', $theme_text_domain ) // %1$s = dashboard link
- )
- );
- tgmpa( $plugins, $config );
- }
- /*-----------------------------------------------------------------------------------*/
- /* Misc. URL's used throughtout the theme
- /*-----------------------------------------------------------------------------------*/
- // Twitter Share URL
- function wap8_twitter_share_url() {
- return '"http://twitter.com/share"';
- }
- function my_em_posttype_fix(){
- register_taxonomy_for_object_type('category',EM_POST_TYPE_EVENT);
- register_taxonomy_for_object_type('category',EM_POST_TYPE_LOCATION);
- }
- add_action('init','my_em_posttype_fix',100);
- function my_em_posttype_cat_default($EM_Object){
- global $post;
- if( $post->post_type == EM_POST_TYPE_EVENT || $post->post_type == EM_POST_TYPE_LOCATION ){
- $categories = get_the_category();
- if( count($categories) == 0 ){
- //assign a category to this
- wp_set_object_terms($post->ID, 'uncategorized','category');
- }
- }
- }
- add_action('template_redirect','my_em_posttype_cat_default', 1,1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement