function bp_enqueue_defaults_init() { global $cssPath; // Load the theme's BuddyPress CSS file theme_register_css('buddypress', $cssPath . 'buddypress.css', 1); // Load the default BuddyPress javascript wp_enqueue_script('bp-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery'), bp_get_version()); // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'show_x_comments' => __('Show all %d comments', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'view' => __('View', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress')); wp_localize_script('bp-ajax-js', 'BP_DTheme', $params); }
* theme_register_css( $handle, $src, $priority (optional), $id (optional), $class (optional) ); * * You must include the following paramaters: * * $handle - string or plain text name for registering the file * $src - the path to the file */ theme_register_css('base', $cssPath . 'base.css', 1); // Base CSS styles for browsers theme_register_css('default', get_stylesheet_directory_uri() . '/style-default.css', 2); // Default theme styles theme_register_css('colorbox', $cssPath . 'colorbox.css'); // Lightbox styles theme_register_css('fontawesome', $cssPath . 'font-awesome.min.css'); // Icons (FontAwesome) theme_register_css('qtip', $cssPath . 'qtip.css'); // Tool tip styles // Disabled (scheduled for v1.2 release) // theme_register_css( 'videoplayer', $cssPath.'videoplayer.css' ); // Video player styles #----------------------------------------------------------------- # Enqueue required scripts #----------------------------------------------------------------- if (!function_exists('bp_core_register_common_scripts_patch')) { function bp_core_register_common_scripts_patch() { $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; $url = buddypress()->plugin_url . 'bp-core/js/'; $scripts = apply_filters('bp_core_register_common_scripts', array('bp-confirm' => array('file' => "{$url}confirm{$min}.js", 'dependencies' => array('jquery')), 'bp-widget-members' => array('file' => "{$url}widget-members{$min}.js", 'dependencies' => array('jquery')), 'bp-jquery-query' => array('file' => "{$url}jquery-query{$min}.js", 'dependencies' => array('jquery')), 'bp-jquery-cookie' => array('file' => "{$url}jquery-cookie{$min}.js", 'dependencies' => array('jquery')), 'jquery-caret' => array('file' => "{$url}jquery.caret{$min}.js", 'dependencies' => array('jquery')), 'jquery-atwho' => array('file' => "{$url}jquery.atwho{$min}.js", 'dependencies' => array('jquery', 'jquery-caret')))); $version = bp_get_version(); foreach ($scripts as $id => $script) { wp_register_script($id, $script['file'], $script['dependencies'], $version);
<?php #----------------------------------------------------------------- # bbPress Forums Related Functions #----------------------------------------------------------------- // Add support - tells bbPress the theme has templates and own styles //................................................................ add_theme_support('bbpress'); // Include bbPress JS and CSS functions //................................................................ // bbPress CSS files. These provide the base styles, theme specific styling in main theme CSS and skin specific CSS files. if (is_rtl()) { theme_register_css('bbPress-rtl', $cssPath . 'bbpress-rtl.css', 1); // bbPress base styles (RTL) } else { theme_register_css('bbPress', $cssPath . 'bbpress.css', 1); // bbPress base styles } // bbPress scripts if (bbp_is_single_topic()) { wp_enqueue_script('bbp_topic', $jsPath . 'bbPress-topic.js', array('wp-lists'), '20110921'); } if (bbp_is_single_user_edit()) { wp_enqueue_script('user-profile'); } // bbPress - Enqueue theme script localization //................................................................ // bbPress - Output some extra JS in the <head> //................................................................ if (!function_exists('bbPress_head_scripts')) { function bbPress_head_scripts()