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');
- // 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;
- }
- /** Pagination */
- function pagination_funtion() {
- // Get total number of pages
- global $wp_query;
- $total = $wp_query->max_num_pages;
- // Only paginate if we have more than one page
- if ( $total > 1 ) {
- // Get the current page
- if ( !$current_page = get_query_var('paged') )
- $current_page = 1;
- $big = 999999999;
- // Structure of "format" depends on whether we’re using pretty permalinks
- $permalink_structure = get_option('permalink_structure');
- $format = emptyempty( $permalink_structure ) ? '&page=%#%' : 'page/%#%/';
- echo paginate_links(array(
- 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
- 'format' => $format,
- 'current' => $current_page,
- 'total' => $total,
- 'mid_size' => 2,
- 'type' => 'list'
- ));
- }
- }
- /** END Pagination */
- add_filter('post_class', 'category_id_class');
- add_filter('body_class', 'category_id_class');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement