Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $functions_path = TEMPLATEPATH . '/functions/';
- $includes_path = TEMPLATEPATH . '/includes/';
- //Loading jQuery and Scripts
- require_once $includes_path . 'theme-scripts.php';
- //Widget and Sidebar
- require_once $includes_path . 'sidebar-init.php';
- require_once $includes_path . 'register-widgets.php';
- //Theme initialization
- require_once $includes_path . 'theme-init.php';
- //Additional function
- require_once $includes_path . 'theme-function.php';
- //Shortcodes
- require_once $includes_path . 'theme_shortcodes/shortcodes.php';
- include_once(TEMPLATEPATH . '/includes/theme_shortcodes/alert.php');
- include_once(TEMPLATEPATH . '/includes/theme_shortcodes/tabs.php');
- include_once(TEMPLATEPATH . '/includes/theme_shortcodes/toggle.php');
- include_once(TEMPLATEPATH . '/includes/theme_shortcodes/html.php');
- //tinyMCE includes
- include_once(TEMPLATEPATH . '/includes/theme_shortcodes/tinymce/tinymce_shortcodes.php');
- /*// Add support for Featured Images
- add_theme_support( 'post-thumbnails' );
- set_post_thumbnail_size( 50, 50 );*/
- // removes detailed login error information for security
- add_filter('login_errors',create_function('$a', "return null;"));
- if ( !function_exists( 'optionsframework_init' ) ) {
- /*-----------------------------------------------------------------------------------*/
- /* Options Framework Theme
- /*-----------------------------------------------------------------------------------*/
- /* Set the file path based on whether the Options Framework Theme is a parent theme or child theme */
- if ( STYLESHEETPATH == TEMPLATEPATH ) {
- define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
- define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/');
- } else {
- define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
- define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('stylesheet_directory') . '/admin/');
- }
- require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
- }
- // Removes Trackbacks from the comment cout
- add_filter('get_comments_number', 'comment_count', 0);
- function comment_count( $count ) {
- if ( ! is_admin() ) {
- global $id;
- $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
- return count($comments_by_type['comment']);
- } else {
- return $count;
- }
- }
- // enable shortcodes in sidebar
- add_filter('widget_text', 'do_shortcode');
- // custom excerpt ellipses for 2.9+
- function custom_excerpt_more($more) {
- return 'Read More »';
- }
- add_filter('excerpt_more', 'custom_excerpt_more');
- // no more jumping for read more link
- function no_more_jumping($post) {
- return ' <a href="'.get_permalink($post->ID).'" class="read-more">'.'Continue Reading'.'</a>';
- }
- add_filter('excerpt_more', 'no_more_jumping');
- // category id in body and post class
- function category_id_class($classes) {
- global $post;
- foreach((get_the_category($post->ID)) as $category)
- $classes [] = 'cat-' . $category->cat_ID . '-id';
- return $classes;
- }
- add_filter('post_class', 'category_id_class');
- add_filter('body_class', 'category_id_class');
- function em_location_by_region(){
- $args = array();
- $arr_location = EM_Locations::get($args);
- /*Get regions as header*/
- $arr_region = array();
- foreach ( $arr_location as $EM_Location_region ) {
- if ( !in_array($EM_Location_region->region,$arr_region) && !empty($EM_Location_region->region) ){
- array_push($arr_region,$EM_Location_region->region);
- }
- }
- /*Get state*/
- $arr_state = array();
- $arr_region_state = array();
- foreach ( $arr_region as $key => $value ) {
- foreach ( $arr_location as $EM_Location_state ) {
- if ( $EM_Location_state->region == $value ){
- array_push($arr_state,'<a href="'.$EM_Location_state->get_permalink().'">'.$EM_Location_state->name.'</a>');
- }
- }
- $arr_region_state[$value] = $arr_state;
- if ( !empty($arr_state) )$arr_state = array();
- }
- /*display the result*/
- foreach ( $arr_region_state as $key => $value ) {
- echo '<h4>'.$key.'</h4>';
- echo '<ul>';
- foreach ( $value as $em_state ) {
- echo '<li>'.$em_state.'</li>';
- }
- echo '</ul>';
- }
- }
- add_shortcode('location_group', 'em_location_by_region');
- remove_filter( 'the_content', 'wpautop' );
- function em_location_event_count($replace, $EM_Location, $result){
- global $wp_query, $wp_rewrite;
- switch( $result ){
- case '#_LOCATIONEVENTCOUNT':
- $replace = "0";
- $events = EM_Events::get(array('location'=>$EM_Location->location_id,'scope'=>'future'));
- if ( count($events) > 0 ){
- $replace = count($events);
- }
- $replace = "Currently ".$replace." courses in this location";
- break;
- }
- return $replace;
- }
- add_filter('em_location_output_placeholder','em_location_event_count',1,3);
- add_theme_support( 'post-thumbnails' );
- set_post_thumbnail_size( 150, 150 ); // 150 pixels wide by 150 pixels tall, box resize option
- add_image_size( 'post-thumbnails-header', 940, 203,true ); // Header thumbnail size
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement