Advertisement
Spandabel

spandabel functions.php via filezilla

May 6th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 6.65 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package WordPress
  4.  * @subpackage Modularity
  5.  */
  6.  
  7. $themecolors = array(
  8.     'bg' => 'eeeeee',
  9.     'border' => 'eeeeee',
  10.     'text' => '111111',
  11.     'link' => '000000',
  12.     'url' => '000000'
  13. );
  14. $content_width = 950; // pixels
  15.  
  16. // Grab the theme options page
  17. require_once ( get_template_directory() . '/theme-options.php' );
  18.  
  19. // Add default posts and comments RSS feed links to head
  20. add_theme_support( 'automatic-feed-links' );
  21.  
  22. // Add post thumbnail theme support
  23. add_theme_support( 'post-thumbnails' );
  24. set_post_thumbnail_size( 150, 150, true );
  25.  
  26. // Add a new image size
  27. add_image_size( 'modularity-slideshow', 950, 425, true );
  28.  
  29. // Register nav menu locations
  30. register_nav_menus( array(
  31.     'primary' => __( 'Primary Navigation', 'text_domain' ),
  32. ) );
  33.  
  34. // Get wp_page_menu() lookin' more like wp_nav_menu()
  35. function modularity_page_menu_args( $args ) {
  36.     $args['show_home'] = true;
  37.     $args['menu_class'] = 'main-nav';
  38.     return $args;
  39. }
  40. add_filter( 'wp_page_menu_args', 'modularity_page_menu_args' );
  41.  
  42. // Give Modularity a custom background
  43. add_custom_background();
  44.  
  45. // Allow custom colors to clear the background image
  46. function modularity_custom_background_color() {
  47.     if ( get_background_image() == '' && get_background_color() != '' ) { ?>
  48.         <style type="text/css">
  49.         body {
  50.             background-image: none;
  51.         }
  52.         </style>           
  53.     <?php }
  54. }
  55. add_action( 'wp_head', 'modularity_custom_background_color' );
  56.  
  57. // To use a sidebar, or not to use a sidebar, that is the question. This generates the appropriate class
  58. function modularity_sidebar_class() {
  59.     $options = get_option( 'modularity_theme_options' );
  60.  
  61.     if ( $options['sidebar'] == 1 ) {
  62.         echo "15 colborder home";
  63.     }
  64.     else {
  65.         echo "24 last";
  66.     }  
  67. }
  68.  
  69. function include_search_box($items, $args) {
  70.    // only display search box on our primary menu
  71.    if( ‚Äòprimary‚Äô === $args -> theme_location )
  72.        $items .= ‚Äò<li class="menu-item menu-item-search">‚Äô . get_search_form(FALSE) . ‚Äò</li>‚Äô;
  73.    return $items;
  74. }
  75. add_filter( ‘wp_nav_menu_items’, ‘include_search_box’, 10, 2 );
  76.  
  77. // The header business begins here:
  78.  
  79. // No CSS, just IMG call
  80. define('HEADER_TEXTCOLOR', '');
  81. define('HEADER_IMAGE', '');
  82. define('HEADER_IMAGE_WIDTH', 950);
  83. define('HEADER_IMAGE_HEIGHT', 250);
  84. define( 'NO_HEADER_TEXT', true );
  85.  
  86. function modularity_admin_header_style() {
  87. ?>
  88. <style type="text/css">
  89. #headimg {
  90.     height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
  91.     width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
  92. }
  93.  
  94. #headimg h1, #headimg #desc {
  95.     display: none;
  96. }
  97.  
  98. </style>
  99. <?php
  100. }
  101.  
  102. add_custom_image_header( '', 'modularity_admin_header_style' );
  103. // and thus ends the header business
  104.  
  105. // Comments in the Modularity style
  106. function modularity_comment( $comment, $args, $depth ) {
  107.     $GLOBALS['comment'] = $comment;
  108.     switch ( $comment->comment_type ) :
  109.         case '' :
  110.     ?>
  111.     <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  112.         <div id="comment-<?php comment_ID(); ?>" class="comment-wrapper">
  113.             <div class="comment-meta">
  114.                 <?php echo get_avatar( $comment, 75 ); ?>
  115.                 <div class="comment-author vcard">
  116.                     <strong class="fn"><?php comment_author_link(); ?></strong>
  117.                 </div><!-- .comment-author .vcard -->
  118.             </div>
  119.             <div class="comment-entry">
  120.                 <?php if ( $comment->comment_approved == '0' ) : ?>
  121.                     <em><?php _e( 'Your comment is awaiting moderation.', 'modularity' ); ?></em>
  122.                     <br />
  123.                 <?php endif; ?>
  124.                 <?php comment_text(); ?>
  125.                 <p class="post-time">
  126.                     <?php
  127.                         /* translators: 1: date, 2: time */
  128.                         printf( __( '%1$s at %2$s', 'modularity' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'modularity' ), ' ' );
  129.                     ?>
  130.                     <br />
  131.                 </p>
  132.                 <div class="reply">
  133.                     <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  134.                 </div><!-- .reply -->              
  135.             </div>
  136.     </div><!-- #comment-##  -->
  137.  
  138.     <?php
  139.             break;
  140.         case 'pingback'  :
  141.         case 'trackback' :
  142.     ?>
  143.     <li class="pingback">
  144.         <p><?php _e( 'Pingback:', 'modularity' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'modularity'), ' ' ); ?></p>
  145.     <?php
  146.             break;
  147.     endswitch;
  148. }
  149.  
  150. // The Sidebar business
  151. $options = get_option( 'modularity_theme_options' );
  152. if ( $options['sidebar'] == 0 ) {
  153.     $optional_description = __( 'The optional Modularity Lite sidebar is currently deactivated but can be activated from Appearance > Theme Options', 'modularity' );  
  154. } else {
  155.     $optional_description = '';
  156. }
  157.  
  158. if ( function_exists('register_sidebar') ) {
  159.     register_sidebar(array(
  160.         'name' => 'Sidebar',
  161.         'id' => 'sidebar',
  162.         'description' => $optional_description,
  163.         'before_widget' => '<div id="%1$s" class="item %2$s">',
  164.         'after_widget' => '</div>',
  165.         'before_title' => '<h3 class="sub">',
  166.         'after_title' => '</h3>',
  167.     ));
  168.  
  169.     register_sidebar(array(
  170.         'name' => 'Footer 1',
  171.         'id' => 'footer-1',
  172.         'before_widget' => '<div id="%1$s" class="item %2$s">',
  173.         'after_widget' => '</div>',
  174.         'before_title' => '<h3 class="sub">',
  175.         'after_title' => '</h3>',
  176.     ));
  177.    
  178.     register_sidebar(array(
  179.         'name' => 'Footer 2',
  180.         'id' => 'footer-2',
  181.         'before_widget' => '<div id="%1$s" class="item %2$s">',
  182.         'after_widget' => '</div>',
  183.         'before_title' => '<h3 class="sub">',
  184.         'after_title' => '</h3>',
  185.     ));
  186.    
  187.     register_sidebar(array(
  188.         'name' => 'Footer 3',
  189.         'id' => 'footer-3',
  190.         'before_widget' => '<div id="%1$s" class="item %2$s">',
  191.         'after_widget' => '</div>',
  192.         'before_title' => '<h3 class="sub">',
  193.         'after_title' => '</h3>'
  194.     ));
  195.  
  196.     register_sidebar(array(
  197.         'name' => 'Footer 4',
  198.         'id' => 'footer-4',
  199.         'before_widget' => '<div id="%1$s" class="item %2$s">',
  200.         'after_widget' => '</div>',
  201.         'before_title' => '<h3 class="sub">',
  202.         'after_title' => '</h3>'
  203.     ));
  204. }
  205.  
  206.  
  207.  
  208. // Load Base Javascripts
  209. if (!is_admin()) add_action( 'init', 'load_base_js' );
  210. function load_base_js( ) {
  211.  
  212.     wp_enqueue_script('jquery');
  213.     //wp_enqueue_script('jquerynav', get_bloginfo('template_directory').'/js/nav.js', array('jquery'));
  214.     wp_enqueue_script('cycle', get_bloginfo('template_directory').'/js/jquery.cycle.js', array('jquery'));
  215.     //wp_enqueue_script('search', get_bloginfo('template_directory').'/js/search.js', array( 'jquery' ) );
  216.  
  217. }
  218.  
  219. // Load Dom Ready Javascripts
  220. function load_dom_ready_js() { ?>
  221.  
  222.     <script type="text/javascript">
  223.     /* <![CDATA[ */
  224.         jQuery(document).ready(function(){
  225.             jQuery(function() {
  226.                 jQuery("#slideshow").cycle({
  227.                     speed: '2500',
  228.                     timeout: '500',
  229.                     pause: 1
  230.                 });
  231.             });
  232.         });
  233.     /* ]]> */
  234.     </script>
  235.  
  236. <?php }
  237. add_action('wp_head', 'load_dom_ready_js');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement