Guest User

functions.php

a guest
Apr 6th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.73 KB | None | 0 0
  1. <?php
  2.  
  3. namespace BaseTheme;
  4.  
  5.  
  6. include_once('filters-actions.php');
  7.  
  8.  
  9. /**
  10. * Loads the base theme class.  The base_theme_class is extended here.
  11. * Please see wiki documentation for full set of features and helpers available in the base_theme_class.
  12. */
  13. include_once( 'core/base-theme-class.php' );
  14.  
  15. function strip_events_for_from_titles( $title ) {
  16.     return str_replace( "Events for", "", $title );
  17. }
  18. add_filter( 'tribe_get_events_title', 'strip_events_for_from_titles' );
  19.  
  20. show_admin_bar(false);
  21. define('ENABLE_CACHE', true);
  22.  
  23. class Theme extends base_theme_class {
  24.  
  25.     var $version = '2.0';
  26.  
  27.     var $theme_name = THEME_NAME;
  28.  
  29.     var $include_jquery = true;
  30.  
  31.     var $load_options_panel = true;
  32.  
  33.  
  34.     /* Load more custom post types here */
  35.     public function load_custom_post_types()
  36.     {
  37.         register_post_type( 'apartments',
  38.             array(
  39.                 'labels' => array(
  40.                     'name' => __( 'Apartments' ),
  41.                     'singular_name' => __( 'Apartment' )
  42.                 ),
  43.                 'public' => true,
  44.                 'show_ui' => true,
  45.                 'has_archive' => true,
  46.                 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'page-attributes', 'revisions' ),
  47.                 'rewrite' => true
  48.             )
  49.         );
  50.     }
  51.  
  52.     public function load_shortcodes()
  53.     {
  54.  
  55.  
  56.     }
  57.  
  58.     public function load_sidebars()
  59.     {
  60.  
  61.  
  62.     }
  63.  
  64.     public function load_options_panel()
  65.     {
  66.  
  67.         acf_add_options_page(array(
  68.             'page_title'    => 'Theme Options',
  69.             'menu_title'    => 'Options',
  70.             'menu_slug'     => 'theme-options-settings',
  71.             'capability'    => 'edit_posts',
  72.             'redirect'      => true
  73.         ));
  74.  
  75.  
  76.         acf_add_options_sub_page(array(
  77.             // 'page_title'    => 'JavaScript & CSS Options',
  78.             // 'menu_title'    => 'Javascript / CSS',
  79.             'parent_slug'   => 'theme-options-settings',
  80.         ));
  81.  
  82.         acf_add_options_sub_page(array(
  83.             'page_title'    => 'Header & Footer Options',
  84.             'menu_title'    => 'Header / Footer',
  85.             'parent_slug'   => 'theme-options-settings',
  86.         ));
  87.  
  88.         acf_add_options_sub_page(array(
  89.             'page_title'    => 'Social Media Options',
  90.             'menu_title'    => 'Social Media',
  91.             'parent_slug'   => 'theme-options-settings',
  92.         ));
  93.  
  94.         acf_add_options_sub_page(array(
  95.             'page_title'    => 'Bottom Call to Action Options',
  96.             'menu_title'    => 'Footer CTA Section',
  97.             'parent_slug'   => 'theme-options-settings',
  98.         ));
  99.     }
  100.  
  101.     public function set_menus()
  102.     {
  103.  
  104.         $this->menus = array(
  105.             'main_nav' => 'Main Navigation',
  106.             'footer_nav' => 'Footer Navigation'
  107.         );
  108.  
  109.     }
  110.  
  111.     /**
  112.     * Set the image size array.
  113.     *
  114.     * $image_sizes[] = array('name' => 'image-size-name', 'width' => 600, 'height' => 400, 'crop' => true)
  115.     * set width/height to 9999 to not force that size.
  116.     * set crop to false to not force the size.
  117.     */
  118.     public function set_image_sizes()
  119.     {
  120.  
  121.         $this->image_sizes[] = array(
  122.             'name' => 'coffee-cup',
  123.             'width' => 494,
  124.             'height' => 322,
  125.             'crop' =>true
  126.         );
  127.  
  128.  
  129.         $this->image_sizes[] = array(
  130.             'name' => 'apartment-thumbnail',
  131.             'width' => 518,
  132.             'height' => 300,
  133.             'crop' =>true
  134.         );
  135.  
  136.         $this->image_sizes[] = array(
  137.             'name' => 'home-banner',
  138.             'width' => 1400,
  139.             'height' => 843,
  140.             'crop' =>true
  141.         );
  142.  
  143.         $this->image_sizes[] = array(
  144.             'name' => 'outdoor-image',
  145.             'width' => 9999,
  146.             'height' => 223,
  147.             'crop' =>true
  148.         );
  149.  
  150.         $this->image_sizes[] = array(
  151.             'name' => 'inquire',
  152.             'width' => 275,
  153.             'height' => 103,
  154.             'crop' =>true
  155.         );
  156.  
  157.         $this->image_sizes[] = array(
  158.             'name' => 'circle-image',
  159.             'width' => 107,
  160.             'height' => 107,
  161.             'crop' =>true
  162.         );
  163.  
  164.  
  165.         $this->image_sizes[] = array(
  166.             'name' => 'square-area-image',
  167.             'width' => 324,
  168.             'height' => 182,
  169.             'crop' =>true
  170.         );
  171.  
  172.         $this->image_sizes[] = array(
  173.             'name' => 'community-image',
  174.             'width' => 504,
  175.             'height' => 468,
  176.             'crop' =>true
  177.         );
  178.  
  179.         $this->image_sizes[] = array(
  180.             'name' => 'pet-bg',
  181.             'width' => 1400,
  182.             'height' => 800,
  183.             'crop' =>true
  184.         );
  185.  
  186.         $this->image_sizes[] = array(
  187.             'name' => 'home-banner-alt',
  188.             'width' => 1400,
  189.             'height' => 694,
  190.             'crop' =>true
  191.         );
  192.  
  193.         $this->image_sizes[] = array(
  194.             'name' => 'small-square',
  195.             'width' => 222,
  196.             'height' => 157,
  197.             'crop' =>true
  198.         );
  199.  
  200.         $this->image_sizes[] = array(
  201.             'name' => 'large-square',
  202.             'width' => 468,
  203.             'height' => 478,
  204.             'crop' =>true
  205.         );
  206.  
  207.         $this->image_sizes[] = array(
  208.             'name' => 'medium-square',
  209.             'width' => 222,
  210.             'height' => 300,
  211.             'crop' =>true
  212.         );
  213.  
  214.         $this->image_sizes[] = array(
  215.             'name' => 'apartment-image',
  216.             'width' => 843,
  217.             'height' => 563,
  218.             'crop' =>true
  219.         );
  220.  
  221.         $this->image_sizes[] = array(
  222.             'name' => 'apartment-image-small',
  223.             'width' => 272,
  224.             'height' => 192,
  225.             'crop' =>true
  226.         );
  227.  
  228.         $this->image_sizes[] = array(
  229.             'name' => 'amenities',
  230.             'width' => 249,
  231.             'height' => 154,
  232.             'crop' =>true
  233.         );
  234.  
  235.         $this->image_sizes[] = array(
  236.             'name' => 'amenities-gallery',
  237.             'width' => 515,
  238.             'height' => 339,
  239.             'crop' =>true
  240.         );
  241.  
  242.         $this->image_sizes[] = array(
  243.             'name' => 'apartment-image-small-2',
  244.             'width' => 273,
  245.             'height' => 192,
  246.             'crop' =>true
  247.         );
  248.  
  249.         $this->image_sizes[] = array(
  250.             'name' => 'featured-apartment',
  251.             'width' => 318,
  252.             'height' => 198,
  253.             'crop' =>true
  254.         );
  255.  
  256.         $this->image_sizes[] = array(
  257.             'name' => 'floor-plan',
  258.             'width' => 614,
  259.             'height' => 9999,
  260.             'crop' =>true
  261.         );
  262.     }
  263.  
  264. }
  265.  
  266. $theme = new \BaseTheme\Theme;
Advertisement
Add Comment
Please, Sign In to add comment