Advertisement
Guest User

nicnack_functions

a guest
Jan 2nd, 2013
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. <?php
  2. // Set path to theme specific functions
  3. define( 'CELTA_LIB', TEMPLATEPATH . '/lib/' );
  4. $theme_path = get_bloginfo( 'template_directory' );
  5.  
  6. // Set variables with theme names
  7. $themename = 'Temptation';
  8. $shortname = 'celta';
  9. $prefix = 'celta_';
  10. define ( 'LANGUAGE', 'manifest' );
  11.  
  12. // Add Theme Options Panel Functions
  13. require_once ( CELTA_LIB . 'theme-options.php' );
  14.  
  15. // Set Theme Setup
  16. add_action( 'after_setup_theme', 'celta_theme_setup' );
  17.  
  18. function celta_theme_setup() {
  19. // Set path to theme specific functions
  20. global $theme_path;
  21.  
  22. if ( ! isset( $content_width ) ) $content_width = 610;
  23.  
  24. add_theme_support( 'automatic-feed-links' );
  25.  
  26. // Load Theme Scripts
  27. require_once ( CELTA_LIB . 'theme-scripts.php' );
  28.  
  29. // Apply Translation
  30. load_theme_textdomain( LANGUAGE, TEMPLATEPATH . '/languages' );
  31.  
  32. // Add Theme Thumbnails
  33. require_once ( CELTA_LIB . 'theme-thumbnails.php' );
  34.  
  35. // Add Custom Post Types
  36. add_action( 'init', 'celta_post_types' );
  37.  
  38. // Add Meta Boxes Actions
  39. add_action( 'admin_menu', 'celta_page_add_box' );
  40. add_action( 'save_post', 'celta_page_save_data' );
  41. add_action( 'admin_menu', 'celta_portfolio_add_box' );
  42. add_action( 'save_post', 'celta_portfolio_save_data' );
  43.  
  44. // Add Shortcodes Interface Action
  45. add_action( 'admin_init', 'celta_add_shortcodes_interface' );
  46.  
  47. // Add CSS3 Support in IE Action
  48. add_action( 'wp_head', 'celta_render_ie' );
  49.  
  50. // Add Custom Widgets Action
  51. add_action( 'widgets_init', 'celta_load_widgets' );
  52.  
  53. }
  54.  
  55. // Add Custom Comments Function
  56. require_once ( CELTA_LIB . 'theme-comments.php' );
  57.  
  58. // Add Custom Post Types Function
  59. require_once ( CELTA_LIB . 'theme-post-types.php' );
  60.  
  61. // Add Custom Meta Boxes Functions
  62. require_once ( CELTA_LIB . 'theme-page-meta-boxes.php' );
  63. require_once ( CELTA_LIB . 'theme-portfolio-meta-boxes.php' );
  64.  
  65. // Add Shortcodes Interface Functions
  66. require_once ( CELTA_LIB . 'theme-shortcodes-interface.php' );
  67.  
  68. // Add CSS3 Support in IE Function
  69. require_once ( CELTA_LIB . 'theme-iefixes.php' );
  70.  
  71. // Add Theme Shortcodes
  72. require_once ( CELTA_LIB . 'theme-shortcodes.php' );
  73.  
  74. // Add Custom Widgets Function
  75. require_once ( CELTA_LIB . 'theme-widgets.php' );
  76.  
  77. // Add Images Resize Function
  78. require_once ( CELTA_LIB . 'theme-thumbnails-resize.php' );
  79.  
  80. // Fixes Shortcodes empty paragraphs
  81. add_filter('the_content', 'shortcode_empty_paragraph_fix');
  82. function shortcode_empty_paragraph_fix($content) {
  83. $array = array (
  84. '<p>[' => '[',
  85. ']</p>' => ']',
  86. ']<br />' => ']'
  87. );
  88. $content = strtr($content, $array);
  89. return $content;
  90. }
  91. ?>
  92. <?php
  93. /**
  94. * Register our sidebars and widgetized areas.
  95. *
  96. */
  97. function arphabet_widgets_init() {
  98.  
  99. register_sidebar( array(
  100. 'name' => 'Home right sidebar',
  101. 'id' => 'home_right_1',
  102. 'before_widget' => '<div>',
  103. 'after_widget' => '</div>',
  104. 'before_title' => '<h2 class="rounded">',
  105. 'after_title' => '</h2>',
  106. ) );
  107. }
  108. add_action( 'widgets_init', 'arphabet_widgets_init' );
  109. ?>
  110. <?php
  111. // This adds more than one menu location
  112. add_action( 'init', 'paukai_register_multiple_menus' );
  113. function paukai_register_multiple_menus() {
  114. register_nav_menus(
  115. array(
  116. 'header-nav' => 'Left Navigation',
  117. 'footer-nav' => 'Footer Navigation'
  118. )
  119. );
  120. }
  121.  
  122. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement