Advertisement
Guest User

Untitled

a guest
May 13th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.07 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Charitas functions and definitions
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Charitas
  7.  * @since Charitas 1.0
  8.  */
  9.  
  10.  
  11. /*-----------------------------------------------------------------------------------*/
  12. /*  Content Width
  13. /*-----------------------------------------------------------------------------------*/
  14.  
  15. if ( ! isset( $content_width ) )
  16.     $content_width = 790; /* pixels */
  17.  
  18. /*-----------------------------------------------------------------------------------*/
  19. /*  Include Option Tree
  20. /*-----------------------------------------------------------------------------------*/
  21.  
  22.     /*-----------------------------------------------------------
  23.         Optional: set 'ot_show_pages' filter to false.
  24.         This will hide the settings & documentation pages.
  25.     -----------------------------------------------------------*/
  26.  
  27.     add_filter( 'ot_show_pages', '__return_true' );
  28.  
  29.  
  30.     /*-----------------------------------------------------------
  31.         Optional: set 'ot_show_new_layout' filter to false.
  32.         This will hide the "New Layout" section on the Theme Options page.
  33.     -----------------------------------------------------------*/
  34.  
  35.     add_filter( 'ot_show_new_layout', '__return_false' );
  36.  
  37.  
  38.     /*-----------------------------------------------------------
  39.         Required: set 'ot_theme_mode' filter to true.
  40.     -----------------------------------------------------------*/
  41.  
  42.     add_filter( 'ot_theme_mode', '__return_true' );
  43.  
  44.  
  45.     /*-----------------------------------------------------------
  46.         Required: include OptionTree.
  47.     -----------------------------------------------------------*/
  48.  
  49.     include_once( get_template_directory() . '/option-tree/ot-loader.php' );
  50.     include_once( get_template_directory() . '/inc/theme-options.php' );
  51.     include_once( get_template_directory() . '/inc/custom-post-type/meta-boxes.php' );
  52.  
  53.  
  54. /*-----------------------------------------------------------------------------------*/
  55. /*  Theme setup
  56. /*-----------------------------------------------------------------------------------*/
  57.  
  58. if ( ! function_exists( 'wplook_setup' ) ) :
  59.  
  60. function wplook_setup() {
  61.  
  62.  
  63.     /*-----------------------------------------------------------
  64.         Make theme available for translation
  65.     -----------------------------------------------------------*/
  66.  
  67.     load_theme_textdomain( 'wplook', get_template_directory() . '/languages' );
  68.  
  69. function mycustom_filter_gettext( $translated, $original, $domain ) {
  70.  
  71.     // This is an array of original strings
  72.     // and what they should be replaced with
  73.     $strings = array(
  74.         'Attendee %d' => 'Participant %d Details',
  75.         'Attendee Information' => 'Participant Details',
  76.         'Billable Registrations:' => 'Number of Tickets',
  77.         // Add some more strings here
  78.     );
  79.  
  80.     // See if the current string is in the $strings array
  81.     // If so, replace its translation
  82.     if ( isset( $strings[$original] ) ) {
  83.         // This accomplishes the same thing as __()
  84.         // but without running it through the filter again
  85.         $translations = get_translations_for_domain( $domain );
  86.         $translated = $translations->translate( $strings[$original] );
  87.     }
  88.  
  89.     return $translated;
  90. }
  91.  
  92. add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 );
  93.  
  94.  
  95.     /*-----------------------------------------------------------
  96.         Theme style for the visual editor
  97.     -----------------------------------------------------------*/
  98.    
  99.     add_editor_style( 'css/editor-style.css' );
  100.  
  101.     /*-----------------------------------------------------------
  102.         Add default posts and comments RSS feed links to head
  103.     -----------------------------------------------------------*/
  104.    
  105.     add_theme_support( 'automatic-feed-links' );
  106.  
  107.     /*-----------------------------------------------------------
  108.         Enable support for Post Thumbnails on posts and pages
  109.     -----------------------------------------------------------*/
  110.    
  111.     add_theme_support( 'post-thumbnails' );
  112.     add_image_size( 'small-thumb', 272, 150, true );
  113.     add_image_size( 'medium-thumb', 500, 277, true );
  114.     add_image_size( 'big-thumb', 1200, 661, true );
  115.     add_image_size( 'candidate-thumb', 225, 235, true );
  116.     add_image_size( 'parallax-thumb', 1920, 714, true );
  117.     add_image_size( 'publications-thumb', 200, 9999 );
  118.    
  119.     /*-----------------------------------------------------------
  120.         Register menu
  121.     -----------------------------------------------------------*/
  122.    
  123.     function register_my_menus() {
  124.         register_nav_menus(
  125.                 array(
  126.                     'primary' => __( 'Main Menu', 'wplook' ),
  127.                     'language' => __( 'Language Menu', 'wplook' ),
  128.                 )
  129.         );
  130.     }
  131.        
  132.     add_action( 'init', 'register_my_menus' );
  133.     wp_create_nav_menu( 'Main Menu', array( 'slug' => 'primary' ) );
  134.     wp_create_nav_menu( 'Language Menu', array( 'slug' => 'language' ) );
  135.    
  136.     /*-----------------------------------------------------------
  137.         Enable support for Post Formats
  138.     -----------------------------------------------------------*/
  139.    
  140.     add_theme_support( 'post-formats', array( 'gallery', 'video', 'status' ) );
  141.  
  142.  
  143.     /*-----------------------------------------------------------
  144.         Add theme Support Custom Background
  145.     -----------------------------------------------------------*/
  146.    
  147.     add_theme_support( 'custom-background' );
  148.  
  149.  
  150.     /*-----------------------------------------------------------
  151.         Add theme Support  Custom Header
  152.     -----------------------------------------------------------*/
  153.    
  154.     add_theme_support( 'custom-header' );
  155.  
  156. }
  157. endif; // wplook_setup
  158. add_action( 'after_setup_theme', 'wplook_setup' );
  159.  
  160.  
  161.  
  162. /*-----------------------------------------------------------------------------------*/
  163. /*  Include Theme specific functionality
  164. /*-----------------------------------------------------------------------------------*/
  165.  
  166. if ( ! function_exists( 'wpl_initiate_files' ) ) {
  167.  
  168.     function wpl_initiate_files() {
  169.         include_once( get_template_directory() . '/inc/widgets/widget-init.php' );              // Initiate all widgets
  170.         include_once( get_template_directory() . '/inc/headerdata.php' );                       // Include header data
  171.         include_once( get_template_directory() . '/inc/library.php' );                          // Include other functions
  172.         include_once( get_template_directory() . '/inc/custom-post-type/causes.php' );          // Include Post Type Causes
  173.         include_once( get_template_directory() . '/inc/custom-post-type/projects.php' );            // Include Post Type Projects
  174.         include_once( get_template_directory() . '/inc/custom-post-type/events.php' );          // Include Post Type Events
  175.         include_once( get_template_directory() . '/inc/custom-post-type/staff.php' );           // Include Post Type Staff
  176.         include_once( get_template_directory() . '/inc/custom-post-type/publications.php' );    // Include Post Type Publications
  177.         include_once( get_template_directory() . '/inc/custom-post-type/pledges.php' );         // Include Post Type Pledges
  178.         include_once( get_template_directory() . '/inc/custom-post-type/gallery.php' );         // Include Post Type Gallery
  179.         require_once (get_template_directory() . '/inc/' . 'comment.php');                      // Comments
  180.     }
  181.     add_action( 'after_setup_theme', 'wpl_initiate_files' );
  182.  
  183. }
  184.  
  185. /*-----------------------------------------------------------------------------------*/
  186. /*  Custom Background
  187. /*-----------------------------------------------------------------------------------*/
  188.  
  189. $defaults = array(
  190.     'default-color'          => 'ffffff',
  191.     'default-image'          => '',
  192.     'wp-head-callback'       => '_custom_background_cb',
  193.     'admin-head-callback'    => '',
  194.     'admin-preview-callback' => ''
  195. );
  196. add_theme_support( 'custom-background', $defaults );
  197.  
  198.  
  199. /*-----------------------------------------------------------
  200.     Custom Header
  201. -----------------------------------------------------------*/
  202.  
  203. $defaults = array(
  204.     'default-image'          => '',
  205.     'random-default'         => false,
  206.     'width'                  => '1920',
  207.     'height'                 => '636',
  208.     'flex-height'            => true,
  209.     'flex-width'             => true,
  210.     'default-text-color'     => '',
  211.     'header-text'            => false,
  212.     'uploads'                => true,
  213.     'wp-head-callback'       => '',
  214.     'admin-head-callback'    => '',
  215.     'admin-preview-callback' => '',
  216. );
  217. add_theme_support( 'custom-header', $defaults );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement