Advertisement
Guest User

Theme Functions.php File

a guest
Apr 18th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. <?php
  2. add_action( 'after_setup_theme', 'et_setup_theme' );
  3. if ( ! function_exists( 'et_setup_theme' ) ){
  4. function et_setup_theme(){
  5. global $themename, $shortname;
  6. $themename = "Webly";
  7. $shortname = "Webly";
  8.  
  9. require_once(TEMPLATEPATH . '/epanel/custom_functions.php');
  10.  
  11. require_once(TEMPLATEPATH . '/includes/functions/comments.php');
  12.  
  13. require_once(TEMPLATEPATH . '/includes/functions/sidebars.php');
  14.  
  15. load_theme_textdomain('Webly',get_template_directory().'/lang');
  16.  
  17. require_once(TEMPLATEPATH . '/epanel/options_webly.php');
  18.  
  19. require_once(TEMPLATEPATH . '/epanel/core_functions.php');
  20.  
  21. require_once(TEMPLATEPATH . '/epanel/post_thumbnails_webly.php');
  22.  
  23. include(TEMPLATEPATH . '/includes/widgets.php');
  24.  
  25. require_once(TEMPLATEPATH . '/includes/additional_functions.php');
  26. }
  27. }
  28.  
  29. add_action('wp_head','et_portfoliopt_additional_styles',100);
  30. function et_portfoliopt_additional_styles(){ ?>
  31. <style type="text/css">
  32. #et_pt_portfolio_gallery { margin-left: -10px; }
  33. .et_pt_portfolio_item { margin-left: 11px; }
  34. .et_portfolio_small { margin-left: 0px !important; }
  35. .et_portfolio_small .et_pt_portfolio_item { margin-left: 26px !important; }
  36. .et_portfolio_large { margin-left: -12px !important; }
  37. .et_portfolio_large .et_pt_portfolio_item { margin-left: 13px !important; }
  38. </style>
  39. <?php }
  40.  
  41. function register_main_menus() {
  42. register_nav_menus(
  43. array(
  44. 'primary-menu' => __( 'Primary Menu' ),
  45. 'footer-menu' => __( 'Footer Menu' )
  46. )
  47. );
  48. }
  49. if (function_exists('register_nav_menus')) add_action( 'init', 'register_main_menus' );
  50.  
  51. // add Home link to the custom menu WP-Admin page
  52. function et_add_home_link( $args ) {
  53. $args['show_home'] = true;
  54. return $args;
  55. }
  56. add_filter( 'wp_page_menu_args', 'et_add_home_link' );
  57.  
  58. add_action('wp_head','et_add_meta_javascript');
  59. function et_add_meta_javascript(){
  60. global $shortname;
  61. echo '<!-- used in scripts -->';
  62. echo '<meta name="et_featured_auto_speed" content="'.get_option($shortname.'_slider_autospeed').'" />';
  63. echo '<meta name="et_featured_slider_effect" content="'.get_option($shortname.'_slider_effect').'" />';
  64.  
  65. $disable_toptier = get_option($shortname.'_disable_toptier') == 'on' ? 1 : 0;
  66. echo '<meta name="et_disable_toptier" content="'.$disable_toptier.'" />';
  67.  
  68. $featured_slider_auto = get_option($shortname.'_slider_auto') == 'on' ? 1 : 0;
  69. echo '<meta name="et_featured_slider_auto" content="'.$featured_slider_auto.'" />';
  70.  
  71. $featured_slider_pause = get_option($shortname.'_pause_hover') == 'on' ? 1 : 0;
  72. echo '<meta name="et_featured_slider_pause" content="'.$featured_slider_pause.'" />';
  73. }
  74.  
  75. if ( ! function_exists( 'et_list_pings' ) ){
  76. function et_list_pings($comment, $args, $depth) {
  77. $GLOBALS['comment'] = $comment; ?>
  78. <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> - <?php comment_excerpt(); ?>
  79. <?php }
  80. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement