Advertisement
RodrigoCasttro

functions.php

May 15th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. <?php
  2.  
  3. $functions_path = TEMPLATEPATH . '/functions/';
  4. $includes_path = TEMPLATEPATH . '/includes/';
  5.  
  6. //Loading jQuery and Scripts
  7. require_once $includes_path . 'theme-scripts.php';
  8.  
  9. //Widget and Sidebar
  10. require_once $includes_path . 'sidebar-init.php';
  11. require_once $includes_path . 'register-widgets.php';
  12.  
  13. //Theme initialization
  14. require_once $includes_path . 'theme-init.php';
  15.  
  16. //Additional function
  17. require_once $includes_path . 'theme-function.php';
  18.  
  19. //Shortcodes
  20. require_once $includes_path . 'theme_shortcodes/shortcodes.php';
  21. include_once(TEMPLATEPATH . '/includes/theme_shortcodes/alert.php');
  22. include_once(TEMPLATEPATH . '/includes/theme_shortcodes/tabs.php');
  23. include_once(TEMPLATEPATH . '/includes/theme_shortcodes/toggle.php');
  24. include_once(TEMPLATEPATH . '/includes/theme_shortcodes/html.php');
  25.  
  26. //tinyMCE includes
  27. include_once(TEMPLATEPATH . '/includes/theme_shortcodes/tinymce/tinymce_shortcodes.php');
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. // removes detailed login error information for security
  39. add_filter('login_errors',create_function('$a', "return null;"));
  40.  
  41. if ( !function_exists( 'optionsframework_init' ) ) {
  42.  
  43.  
  44. /*-----------------------------------------------------------------------------------*/
  45. /* Options Framework Theme
  46. /*-----------------------------------------------------------------------------------*/
  47.  
  48. /* Set the file path based on whether the Options Framework Theme is a parent theme or child theme */
  49.  
  50. if ( STYLESHEETPATH == TEMPLATEPATH ) {
  51. define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
  52. define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/');
  53. } else {
  54. define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
  55. define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('stylesheet_directory') . '/admin/');
  56. }
  57.  
  58. require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
  59.  
  60. }
  61.  
  62. // Removes Trackbacks from the comment cout
  63. add_filter('get_comments_number', 'comment_count', 0);
  64. function comment_count( $count ) {
  65. if ( ! is_admin() ) {
  66. global $id;
  67. $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
  68. return count($comments_by_type['comment']);
  69. } else {
  70. return $count;
  71. }
  72. }
  73.  
  74.  
  75. // enable shortcodes in sidebar
  76. add_filter('widget_text', 'do_shortcode');
  77.  
  78. // custom excerpt ellipses for 2.9+
  79. function custom_excerpt_more($more) {
  80. return 'Read More &raquo;';
  81. }
  82. add_filter('excerpt_more', 'custom_excerpt_more');
  83. // no more jumping for read more link
  84. function no_more_jumping($post) {
  85. return '&nbsp;<a href="'.get_permalink($post->ID).'" class="read-more">'.'Continue Reading'.'</a>';
  86. }
  87. add_filter('excerpt_more', 'no_more_jumping');
  88.  
  89.  
  90. // category id in body and post class
  91. function category_id_class($classes) {
  92. global $post;
  93. foreach((get_the_category($post->ID)) as $category)
  94. $classes [] = 'cat-' . $category->cat_ID . '-id';
  95. return $classes;
  96. }
  97.  
  98. add_filter('post_class', 'category_id_class');
  99. add_filter('body_class', 'category_id_class');
  100.  
  101. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement