function ct_tracks_theme_setup() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Theme-supported features go here. */ add_theme_support('hybrid-core-template-hierarchy'); add_theme_support('loop-pagination'); add_theme_support('cleaner-gallery'); // from WordPress core not theme hybrid add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); add_theme_support('title-tag'); register_nav_menus(array('primary' => __('Primary', 'tracks'), 'secondary' => __('Secondary', 'tracks'), 'footer' => __('Footer', 'tracks'))); // adds theme options page require_once trailingslashit(get_template_directory()) . 'theme-options.php'; // add inc folder files foreach (glob(trailingslashit(get_template_directory()) . 'inc/*.php') as $filename) { include $filename; } // add license folder files foreach (glob(trailingslashit(get_template_directory()) . 'licenses/*.php') as $filename) { include $filename; } // add license/functions folder files foreach (glob(trailingslashit(get_template_directory()) . 'licenses/functions/*.php') as $filename) { include $filename; } // load text domain load_theme_textdomain('tracks', get_template_directory() . '/languages'); }
/** * Registers the default framework dynamic sidebars based on the sidebars the theme has added support * for using add_theme_support(). * * @since 0.7.0 * @access private * @uses register_sidebar() Registers a sidebar with WordPress. * @link http://codex.wordpress.org/Function_Reference/register_sidebar * @return void */ function hybrid_register_sidebars() { /* Get the theme-supported sidebars. */ $supported_sidebars = get_theme_support('hybrid-core-sidebars'); /* If the theme doesn't add support for any sidebars, return. */ if (!is_array($supported_sidebars[0])) { return; } /* Get the available core framework sidebars. */ $core_sidebars = hybrid_get_sidebars(); /* Loop through the supported sidebars. */ foreach ($supported_sidebars[0] as $sidebar) { /* Make sure the given sidebar is one of the core sidebars. */ if (isset($core_sidebars[$sidebar])) { /* Set up some default sidebar arguments. */ $defaults = array('before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-wrap widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'); /* Allow developers to filter the default sidebar arguments. */ $defaults = apply_filters(hybrid_get_prefix() . '_sidebar_defaults', $defaults, $sidebar); /* Parse the sidebar arguments and defaults. */ $args = wp_parse_args($core_sidebars[$sidebar], $defaults); /* If no 'id' was given, use the $sidebar variable and sanitize it. */ $args['id'] = isset($args['id']) ? sanitize_key($args['id']) : sanitize_key($sidebar); /* Allow developers to filter the sidebar arguments. */ $args = apply_filters(hybrid_get_prefix() . '_sidebar_args', $args, $sidebar); /* Register the sidebar. */ register_sidebar($args); } } }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.1 */ function Squar_Banner_Item_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'squar'; $this->textdomain = 'squar'; } /* Setup URL to Tim Thumb Script*/ $this->timthumb = SQUAR_SCRIPTS_URI . '/thumb.php'; $widget_options = array( 'classname' => 'banner-item', 'description' => esc_html__( 'Adds a banner item to frontpage slider or into the inside page banner area.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '700', 'id_base' => "{$this->prefix}-banner-item", esc_attr__( 'A Banner Item', $this->textdomain ) ); $this->WP_Widget( "{$this->prefix}-banner-item", esc_attr__( 'A Banner Item', $this->textdomain ), $widget_options, $control_options ); }
function Pogidude_Event_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'pogidude'; $this->textdomain = 'pogidude'; } $this->widget_id = 'event-widget'; $widget_options = array( 'classname' => "{$this->prefix}-{$this->widget_id}", 'description' => esc_html__( 'Displays your Events in the sidebar.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '240', 'id_base' => "{$this->prefix}-{$this->widget_id}" ); $this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'TM: Event Widget', $this->textdomain ), $widget_options, $control_options ); }
function Pogidude_Twitter_Feed_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'pogidude'; $this->textdomain = 'pogidude'; } $widget_options = array( 'classname' => 'pogidude-twitter-feed', 'description' => esc_html__( 'Add your Twitter feed to your sidebar with this widget.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '240', 'id_base' => "{$this->prefix}-twitter-feed" ); $this->WP_Widget( "{$this->prefix}-twitter-feed", esc_attr__( 'Twitter Stream', $this->textdomain ), $widget_options, $control_options ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.1 */ function Pogidude_Slider_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'pogidude'; $this->textdomain = 'pogidude'; } //setup widget it $this->widget_id = 'slider-item'; //setup path to Tim Thumb script $this->timthumbUrl = trailingslashit( THEMELIB_SCRIPTS_URI ) . 'thumb.php'; $widget_options = array( 'classname' => "{$this->prefix}-{$this->widget_id}", 'description' => esc_html__( 'Adds a slider item. Use on slider widget area.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '240', 'id_base' => "{$this->prefix}-{$this->widget_id}" ); $this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'TM: Slider Item', $this->textdomain ), $widget_options, $control_options ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.1 */ function Image_Button_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'mobility21'; $this->textdomain = 'mobility21'; } $widget_options = array( 'classname' => 'image-button', 'description' => esc_html__( 'Displays an image button and can link to a URL when clicked.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '250', 'id_base' => "{$this->prefix}-image-button", esc_attr__( 'Image Button', $this->textdomain ) ); $this->WP_Widget( "{$this->prefix}-image-button", esc_attr__( 'Mobility Image Button', $this->textdomain ), $widget_options, $control_options ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.1 */ function M21_Single_Ad_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'mobility21'; $this->textdomain = 'mobility21'; } $widget_options = array( 'classname' => 'm21-single-ad', 'description' => esc_html__( 'Place a Mobility21 Partner ad.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '525', 'id_base' => "{$this->prefix}-m21-single-ad", esc_attr__( 'M21 Single Ad', $this->textdomain ) ); $this->WP_Widget( "{$this->prefix}-m21-single-ad", esc_attr__( 'Mobility Single Ad Widget', $this->textdomain ), $widget_options, $control_options ); }
function Widget_Subscribe_Box(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'pogidude'; $this->textdomain = 'pogidude'; } $this->widget_id = 'newsletter-subscribe-box'; $widget_options = array( 'classname' => "{$this->prefix}-{$this->widget_id}", 'description' => esc_html__( 'Add a newsletter subscribe box to your sidebar. Do not use this widget more than once in the same page.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '240', 'id_base' => "{$this->prefix}-{$this->widget_id}" ); $this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Newsletter Subscribe', $this->textdomain ), $widget_options, $control_options ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.1 */ function M21_Banner_Item_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'mobility21'; $this->textdomain = 'mobility21'; } $widget_options = array( 'classname' => 'm21-banner-item', 'description' => esc_html__( 'Adds a banner item to Mobility 21 site frontpage slider or into the inside page banner area.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '700', 'id_base' => "{$this->prefix}-m21-banner-item", esc_attr__( 'M21 Banner Item', $this->textdomain ) ); $this->WP_Widget( "{$this->prefix}-m21-banner-item", esc_attr__( 'Mobility Banner Item', $this->textdomain ), $widget_options, $control_options ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.1 */ function Squar_Feature_Box_Widget(){ /* Setup URL to Tim Thumb Script*/ $this->timthumburl = SQUAR_SCRIPTS_URI . '/thumb.php'; /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'squar'; $this->textdomain = 'squar'; } $widget_options = array( 'classname' => 'feature-box', 'description' => esc_html__( 'Displays a feature box with an image which can link to a URL when clicked.', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '525', 'id_base' => "{$this->prefix}-feature-box", esc_attr__( 'Feature Box', $this->textdomain ) ); $this->WP_Widget( "{$this->prefix}-feature-box", esc_attr__( 'A Feature Box', $this->textdomain ), $widget_options, $control_options ); }
/** * Initializes the theme framework, loads the required files, and calls the * functions needed to run the theme. * * @since 0.7 */ function init() { /* Define theme constants. */ $this->constants(); /* Load theme functions. */ $this->functions(); /* Load theme extensions. */ $this->extensions(); /* Load legacy files and functions. */ $this->legacy(); /* Load admin files. */ $this->admin(); /* Theme prefix for creating things such as filter hooks (i.e., "$prefix_hook_name"). */ $this->prefix = hybrid_get_prefix(); /* Load theme textdomain. */ $domain = hybrid_get_textdomain(); $locale = get_locale(); load_textdomain( $domain, locate_template( array( "languages/{$domain}-{$locale}.mo", "{$domain}-{$locale}.mo" ) ) ); /* Initialize the theme's default actions. */ $this->actions(); /* Initialize the theme's default filters. */ $this->filters(); /* Theme init hook. */ do_action( "{$this->prefix}_init" ); }
function Widget_Social_Connect(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'pogidude'; $this->textdomain = 'pogidude'; } $this->widget_id = 'social-connect'; $widget_options = array( 'classname' => "{$this->prefix}-{$this->widget_id}", 'description' => esc_html__( 'Add social icons to your sidebar', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '240', 'id_base' => "{$this->prefix}-{$this->widget_id}" ); $this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Social Connect', $this->textdomain ), $widget_options, $control_options ); }
function Widget_Class_Name_Widget(){ /* Check if Hybrid-core framework is active */ if( class_exists( 'Hybrid' ) ){ /* Set the widget prefix */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_parent_textdomain(); } else { $this->prefix = 'prefix'; $this->textdomain = 'prefix'; } $this->widget_id = 'widget-id'; $widget_options = array( 'classname' => "{$this->prefix}-{$this->widget_id}", 'description' => esc_html__( 'Description of the widget', $this->textdomain ) ); $control_options = array( 'height' => '300', 'width' => '240', 'id_base' => "{$this->prefix}-{$this->widget_id}" ); $this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Widget Name', $this->textdomain ), $widget_options, $control_options ); }
/** * Theme setup function. This function adds support for theme features and defines the default theme * actions and filters. * * @since 0.1.0 */ function prototype_theme_setup() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Add theme support for core framework features. */ add_theme_support('hybrid-core-menus', array('primary', 'secondary', 'subsidiary')); add_theme_support('hybrid-core-sidebars', array('primary', 'secondary', 'header', 'subsidiary', 'after-singular')); add_theme_support('hybrid-core-widgets'); add_theme_support('hybrid-core-shortcodes'); add_theme_support('hybrid-core-theme-settings', array('about', 'footer')); add_theme_support('hybrid-core-drop-downs'); add_theme_support('hybrid-core-seo'); add_theme_support('hybrid-core-template-hierarchy'); /* Add theme support for framework extensions. */ add_theme_support('theme-layouts', array('1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c')); add_theme_support('post-stylesheets'); add_theme_support('dev-stylesheet'); add_theme_support('loop-pagination'); add_theme_support('get-the-image'); add_theme_support('breadcrumb-trail'); add_theme_support('cleaner-gallery'); /* Add theme support for WordPress features. */ add_theme_support('automatic-feed-links'); add_custom_background(); /* Add the search form to the secondary menu. */ add_action("{$prefix}_close_menu_secondary", 'get_search_form'); /* Embed width/height defaults. */ add_filter('embed_defaults', 'prototype_embed_defaults'); /* Filter the sidebar widgets. */ add_filter('sidebars_widgets', 'prototype_disable_sidebars'); add_action('template_redirect', 'prototype_one_column'); /* Set the content width. */ hybrid_set_content_width(600); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.6 */ function Hybrid_Widget_Search() { $this->prefix = hybrid_get_prefix(); $this->textdomain = hybrid_get_textdomain(); $widget_ops = array( 'classname' => 'search', 'description' => __( 'An advanced widget that gives you total control over the output of your search form.', $this->textdomain ) ); $control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-search" ); $this->WP_Widget( "{$this->prefix}-search", __( 'Search', $this->textdomain ), $widget_ops, $control_ops ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.6 */ function Hybrid_Widget_Nav_Menu() { $this->prefix = hybrid_get_prefix(); $this->textdomain = hybrid_get_textdomain(); $widget_ops = array( 'classname' => 'nav-menu', 'description' => __( 'An advanced widget that gives you total control over the output of your menus.', $this->textdomain ) ); $control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-nav-menu" ); $this->WP_Widget( "{$this->prefix}-nav-menu", __( 'Navigation Menu', $this->textdomain ), $widget_ops, $control_ops ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.6 */ function Hybrid_Widget_Calendar() { $this->prefix = hybrid_get_prefix(); $this->textdomain = hybrid_get_textdomain(); $widget_ops = array( 'classname' => 'calendar', 'description' => __( 'An advanced widget that gives you total control over the output of your calendar.', $this->textdomain ) ); $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => "{$this->prefix}-calendar" ); $this->WP_Widget( "{$this->prefix}-calendar", __( 'Calendar', $this->textdomain ), $widget_ops, $control_ops ); }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 0.6 */ function Hybrid_Widget_Bookmarks() { $this->prefix = hybrid_get_prefix(); $this->textdomain = hybrid_get_textdomain(); $widget_ops = array( 'classname' => 'bookmarks', 'description' => __( 'An advanced widget that gives you total control over the output of your bookmarks (links).', $this->textdomain ) ); $control_ops = array( 'width' => 800, 'height' => 350, 'id_base' => "{$this->prefix}-bookmarks" ); $this->WP_Widget( "{$this->prefix}-bookmarks", __( 'Bookmarks', $this->textdomain ), $widget_ops, $control_ops ); }
/** * Theme setup function. This function adds support for theme features and defines the default theme * actions and filters. * * @since 0.1.0 */ function dschool_theme_setup() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Add theme support for core framework features. */ add_theme_support('hybrid-core-menus', array('primary', 'secondary')); add_theme_support('hybrid-core-sidebars', array('primary')); add_theme_support('hybrid-core-widgets'); add_theme_support('hybrid-core-shortcodes'); add_theme_support('hybrid-core-post-meta-box'); add_theme_support('hybrid-core-theme-settings', array('footer', 'about')); add_theme_support('hybrid-core-seo'); add_theme_support('hybrid-core-template-hierarchy'); /* Add theme support for framework extensions. */ add_theme_support('loop-pagination'); add_theme_support('get-the-image'); add_theme_support('breadcrumb-trail'); add_theme_support('cleaner-gallery'); /* Add theme support for WordPress features. */ add_theme_support('automatic-feed-links'); /* Filter the breadcrumb trail arguments. */ add_filter('breadcrumb_trail_args', 'dschool_breadcrumb_trail_args'); /* Add the search form to the header. */ add_action("{$prefix}_close_header", 'get_search_form'); /* Add the logo to the end of the primary menu. */ add_action("{$prefix}_close_menu_primary", 'add_small_logo'); /* Remove some of the built in meta tags to simplify the header. */ add_filter("{$prefix}_meta_author", '__return_false'); add_filter("{$prefix}_meta_copyright", '__return_false'); add_filter("{$prefix}_meta_revised", '__return_false'); add_filter("{$prefix}_meta_template", '__return_false'); //remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds //remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed remove_action('wp_head', 'wp_generator', 1); // WP version remove_action('wp_head', 'rsd_link'); // Really Simple Discovery service endpoint, EditURI link remove_action('wp_head', 'wlwmanifest_link'); // windows live writer remove_action('wp_head', 'index_rel_link'); // index link remove_action('wp_head', 'parent_post_rel_link_wp_head ', 10, 0); // prev link remove_action('wp_head', 'start_post_rel_link_wp_head ', 10, 0); // start link remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); // Display relational links for the posts adjacent to the current post. /* Additional dschool-core extensions */ //add_theme_support( 'share-box' ); /* Add social sharebox to single post template */ //add_theme_support( 'facebook-init' ); /* Add facebook async js to theme */ //add_theme_support( 'facebook-opengraph' ); /* Add facebook opengraph meta to header */ //add_theme_support( 'show-ids' ); /* Show ID's in dashboard */ /* Additional dschool-core shortcodes */ //add_theme_support( 'shortcode-list-posts' ); /* Shortcode for display list of posts based on category and/or tag */ if (is_admin()) { require_once trailingslashit(TEMPLATEPATH) . '/dschool-core/extensions/custom-theme-settings.php'; } }
function dschool_theme_admin_setup() { /* Get the theme prefix. */ $prefix = hybrid_get_prefix(); /* Create a settings meta box only on the theme settings page. */ add_action('load-appearance_page_theme-settings', 'dschool_theme_settings_meta_boxes'); /* Add a filter to validate/sanitize your settings. */ add_filter("sanitize_option_{$prefix}_theme_settings", 'dschool_validate_banner_settings'); }
/** * Setup function. All child themes should run their setup within this function. The idea is to add/remove * filters and actions after the parent theme has been set up. This function provides you that opportunity. * * @since 0.1 */ function hybrid_child_theme_setup() { /* Get the theme prefix ("prototype"). */ $prefix = hybrid_get_prefix(); /* Example action. */ // add_action( "{$prefix}_header", 'hybrid_child_example_action' ); /* Example filter. */ // add_filter( "{$prefix}_site_title", 'hybrid_child_example_filter' ); }
/** * Theme setup function. This function adds support for theme features and defines the default theme * actions and filters. * */ function origin_theme_setup() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Add theme support for core framework features. */ add_theme_support('hybrid-core-menus', array('primary')); add_theme_support('hybrid-core-sidebars', array('primary', 'subsidiary', 'after-singular')); add_theme_support('hybrid-core-widgets'); add_theme_support('hybrid-core-theme-settings', array('footer', 'about')); add_theme_support('hybrid-core-meta-box-footer'); add_theme_support('hybrid-core-shortcodes'); add_theme_support('hybrid-core-drop-downs'); add_theme_support('hybrid-core-template-hierarchy'); /* Add theme support for framework extensions. */ add_theme_support('loop-pagination'); add_theme_support('get-the-image'); add_theme_support('cleaner-gallery'); add_theme_support('breadcrumb-trail'); /* Add theme support for WordPress features. */ add_theme_support('automatic-feed-links'); /* Embed width/height defaults. */ add_filter('embed_defaults', 'origin_embed_defaults'); /* Filter the sidebar widgets. */ add_filter('sidebars_widgets', 'origin_disable_sidebars'); /* Image sizes */ add_action('init', 'origin_image_sizes'); /* Excerpt ending */ add_filter('excerpt_more', 'origin_excerpt_more'); /* Custom excerpt length */ add_filter('excerpt_length', 'origin_excerpt_length'); /* Filter the pagination trail arguments. */ add_filter('loop_pagination_args', 'origin_pagination_args'); /* Remove links from entry titles (shortcodes) for singular */ add_filter("{$prefix}_entry_title", 'origin_entry_title_shortcode'); /* Filter the comments arguments */ add_filter("{$prefix}_list_comments_args", 'origin_comments_args'); /* Filter the commentform arguments */ add_filter('comment_form_defaults', 'origin_commentform_args', 11, 1); /* Enqueue scripts (and related stylesheets) */ add_action('wp_enqueue_scripts', 'origin_scripts'); /* Enqueue Google fonts */ add_action('wp_enqueue_scripts', 'origin_google_fonts'); /* Style settings */ add_action('wp_head', 'origin_style_settings'); /* Add the breadcrumb trail just after the container is open. */ add_action("{$prefix}_close_header", 'breadcrumb_trail'); /* Breadcrumb trail arguments. */ add_filter('breadcrumb_trail_args', 'origin_breadcrumb_trail_args'); /* Add support for custom backgrounds */ add_theme_support('custom-background'); /* Add theme settings */ if (is_admin()) { require_once trailingslashit(TEMPLATEPATH) . 'admin/functions-admin.php'; } /* Default footer settings */ add_filter("{$prefix}_default_theme_settings", 'origin_default_footer_settings'); }
/** * Theme setup function. This function adds support for theme features and defines the default theme * actions and filters. * */ function ascetica_theme_setup() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Add theme support for core framework features. */ add_theme_support('hybrid-core-menus', array('primary')); add_theme_support('hybrid-core-sidebars', array('primary', 'secondary', 'subsidiary', 'after-singular')); add_theme_support('hybrid-core-widgets'); add_theme_support('hybrid-core-theme-settings', array('footer')); add_theme_support('hybrid-core-meta-box-footer'); add_theme_support('hybrid-core-shortcodes'); add_theme_support('hybrid-core-template-hierarchy'); /* Add theme support for framework extensions. */ add_theme_support('loop-pagination'); add_theme_support('get-the-image'); add_theme_support('cleaner-gallery'); /* Add theme support for WordPress features. */ add_theme_support('automatic-feed-links'); /* Embed width/height defaults. */ add_filter('embed_defaults', 'ascetica_embed_defaults'); /* Filter the sidebar widgets. */ add_filter('sidebars_widgets', 'ascetica_disable_sidebars'); /* Image sizes */ add_action('init', 'ascetica_image_sizes'); /* Excerpt ending */ add_filter('excerpt_more', 'ascetica_excerpt_more'); /* Custom excerpt length */ add_filter('excerpt_length', 'ascetica_excerpt_length'); /* Filter the pagination trail arguments. */ add_filter('loop_pagination_args', 'ascetica_pagination_args'); /* Filter the comments arguments */ add_filter("{$prefix}_list_comments_args", 'ascetica_comments_args'); /* Filter the commentform arguments */ add_filter('comment_form_defaults', 'ascetica_commentform_args', 11, 1); /* Enqueue scripts (and related stylesheets) */ add_action('wp_enqueue_scripts', 'ascetica_scripts'); /* Enqueue Google fonts */ add_action('wp_enqueue_scripts', 'ascetica_google_fonts'); /* Style settings */ add_action('wp_head', 'ascetica_style_settings'); /* Add support for custom backgrounds */ add_custom_background(); /* Add theme settings */ if (is_admin()) { require_once trailingslashit(TEMPLATEPATH) . 'admin/functions-admin.php'; } /* Default footer settings */ add_filter("{$prefix}_default_theme_settings", 'ascetica_default_footer_settings'); /* Widgets */ add_action('widgets_init', 'ascetica_register_widgets'); /* Undergister sidebar */ add_action('widgets_init', 'ascetica_unregister_sidebar', 999); /* Add support for Post Formats */ add_theme_support('post-formats', array('gallery')); }
function __construct() { /* Set the widget prefix. */ $this->prefix = hybrid_get_prefix(); /* Set up the widget options. */ $widget_options = array('classname' => 'ascetica-thumbnails-widget', 'description' => esc_html__('Display post images from selected category.', 'ascetica')); /* Set up the widget control options. */ $control_options = array('width' => 300, 'height' => 350); /* Create the widget. */ $this->WP_Widget('ascetica-thumbnails-widget', __('Ascetica - Thumbnails', 'ascetica'), $widget_options, $control_options); }
/** * Add the theme options to the Hybrid Core options page * * @return void * @since Cakifo 1.0 */ function cakifo_theme_admin_setup() { /* Get the theme prefix */ $prefix = hybrid_get_prefix(); /* Create a settings meta box only on the theme settings page */ add_action('load-appearance_page_theme-settings', 'cakifo_theme_settings_meta_boxes'); /* Add script and styles */ add_action('admin_enqueue_scripts', 'cakifo_theme_settings_enqueue_scripts'); /* Add a filter to validate/sanitize the settings */ add_filter("sanitize_option_{$prefix}_theme_settings", 'cakifo_theme_validate_settings'); }
/** * Theme setup function. This function adds support for theme features and defines the default theme * actions and filters. * */ function hatch_theme_setup() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Add theme support for core framework features. */ add_theme_support('hybrid-core-styles', array('style')); add_theme_support('hybrid-core-menus', array('primary')); add_theme_support('hybrid-core-sidebars', array('primary', 'subsidiary', 'after-singular')); add_theme_support('hybrid-core-widgets'); add_theme_support('hybrid-core-theme-settings', array('about', 'footer')); add_theme_support('hybrid-core-meta-box-footer'); add_theme_support('hybrid-core-shortcodes'); add_theme_support('hybrid-core-scripts', array('drop-downs')); add_theme_support('hybrid-core-template-hierarchy'); /* Add theme support for framework extensions. */ add_theme_support('loop-pagination'); add_theme_support('get-the-image'); add_theme_support('cleaner-gallery'); /* Add theme support for WordPress features. */ add_theme_support('automatic-feed-links'); /* Embed width/height defaults. */ add_filter('embed_defaults', 'hatch_embed_defaults'); /* Filter the sidebar widgets. */ add_filter('sidebars_widgets', 'hatch_disable_sidebars'); /* Image sizes */ add_action('init', 'hatch_image_sizes'); /* Excerpt ending */ add_filter('excerpt_more', 'hatch_excerpt_more'); /* Custom excerpt length */ add_filter('excerpt_length', 'hatch_excerpt_length'); /* Filter the pagination trail arguments. */ add_filter('loop_pagination_args', 'hatch_pagination_args'); /* Filter the comments arguments */ add_filter("{$prefix}_list_comments_args", 'hatch_comments_args'); /* Filter the commentform arguments */ add_filter('comment_form_defaults', 'hatch_commentform_args', 11, 1); /* Enqueue scripts (and related stylesheets) */ add_action('wp_enqueue_scripts', 'hatch_scripts'); /* Enqueue Google fonts */ add_action('wp_enqueue_scripts', 'hatch_google_fonts'); /* Style settings */ add_action('wp_head', 'hatch_style_settings'); /* Add support for custom backgrounds */ add_theme_support('custom-background'); /* Add theme settings */ if (is_admin()) { require_once trailingslashit(get_template_directory()) . 'admin/functions-admin.php'; } /* Default footer settings */ add_filter("{$prefix}_default_theme_settings", 'hatch_default_footer_settings'); /* Add support for custom headers. */ $args = array('width' => 640, 'height' => 360, 'header-text' => false, 'default-image' => trailingslashit(get_stylesheet_directory_uri()) . 'images/header_default.png', 'uploads' => true); add_theme_support('custom-header', $args); }
function clea_base_header_setup() { /* Get the theme prefix. */ $prefix = hybrid_get_prefix(); /* Add social icons and search bar * is done in header.php */ /* add a logo on the left of site name and description * uses an hybrid contextual header */ add_action("{$prefix}_open_header", 'clea_base_add_logo_to_header'); }
/** * Loads some additional functions. * * @since 1.5 */ function satu_load_libraries() { /* Get action/filter hook prefix. */ $prefix = hybrid_get_prefix(); /* Loads additional functions file. */ require_once trailingslashit(THEME_DIR) . 'inc/theme-functions.php'; /* Loads custom template tags. */ require_once trailingslashit(THEME_DIR) . 'inc/templates.php'; /* Loads enqueue scripts for theme usage. */ require_once trailingslashit(THEME_DIR) . 'inc/enqueue.php'; /* Loads customizer functions. */ require_once trailingslashit(THEME_DIR) . 'inc/customize.php'; }
/** * Set up the widget's unique name, ID, class, description, and other options. * @since 1.2.0 */ function __construct() { /* Set the widget prefix. */ $this->prefix = hybrid_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = hybrid_get_textdomain(); /* Set up the widget options. */ $widget_options = array('classname' => 'authors', 'description' => esc_html__('An advanced widget that gives you total control over the output of your author lists.', $this->textdomain)); /* Set up the widget control options. */ $control_options = array('width' => 525, 'height' => 350); /* Create the widget. */ $this->WP_Widget('hybrid-authors', __('Authors', $this->textdomain), $widget_options, $control_options); }