コード例 #1
1
ファイル: functions.php プロジェクト: besimhu/legacy
function Destro_setup()
{
    // This theme uses wp_nav_menu() in one location.
    register_nav_menus(array('mainmenu' => __('Main Navigation', 'Destro')));
    // This theme uses post thumbnails
    add_theme_support('post-thumbnails');
    add_image_size('Destrothumb', 450, 300, true);
    // Add default posts and comments RSS feed links to head
    add_theme_support('automatic-feed-links');
    // Add translation support
    load_theme_textdomain('Destro', get_template_directory() . '/languages');
    // Delete default WordPress gallery css
    add_filter('use_default_gallery_style', '__return_false');
    // Add Custom background feature
    if (of_get_option('skin_style')) {
        $custombgargsskin = of_get_option('skin_style');
    } else {
        $custombgargsskin = 'destro';
    }
    if (get_stylesheet_directory() == get_template_directory()) {
        $custombgargs = array('default-color' => '292929', 'default-image' => get_template_directory_uri() . '/images/' . $custombgargsskin . '/page_bg.png');
    } else {
        $custombgargs = array('default-image' => get_stylesheet_directory_uri() . '/images/page_bg.png');
    }
    add_theme_support('custom-background', $custombgargs);
}
コード例 #2
0
    function __construct()
    {
        add_theme_support('post-thumbnails');
        $this->defaultPostThumb = $this->getTheme() . "/img/logo-circle.png";
        // Remove stupid WP emoji support
        remove_action('wp_head', 'print_emoji_detection_script', 7);
        remove_action('wp_print_styles', 'print_emoji_styles');
        // Add projects CPT
        register_post_type('projects', array('labels' => array('menu_name' => 'Projects', 'name' => __('Project'), 'singular_name' => __('Project'), 'add_new' => __('Add'), 'add_new_item' => __('Add new project'), 'edit_item' => __('Edit project'), 'new_item' => __('New project'), 'all_items' => __('All projects'), 'view_item' => __('View project'), 'search_items' => __('Search projects'), 'not_found' => __('No projects found'), 'not_found_in_trash' => __('No projects found in trash')), 'public' => true, 'has_archive' => true, 'menu_position' => 9));
        // Add votes metabox
        function hackastory_votes_meta_box($post_type, $post)
        {
            add_post_meta($post->ID, 'project-votes-experimental', 0, true);
            add_post_meta($post->ID, 'project-votes-potential', 0, true);
            add_meta_box('votes_box', 'Votes', function ($post) {
                echo 'Best experiment: ' . get_post_meta($post->ID, 'project-votes-experimental', true) . '<br>';
                echo 'Most potential: ' . get_post_meta($post->ID, 'project-votes-potential', true);
            }, array('projects'), 'side');
        }
        add_action('add_meta_boxes', 'hackastory_votes_meta_box', 10, 2);
        // Define ajaxurl in frontend
        function hackastory_ajaxurl()
        {
            ?>
            <script type="text/javascript">
                var ajaxurl = '<?php 
            echo admin_url('admin-ajax.php');
            ?>
';
            </script>
            <?php 
        }
        add_action('wp_head', 'hackastory_ajaxurl');
    }
コード例 #3
0
 public function setUp()
 {
     parent::setUp();
     add_theme_support('infinite-scroll');
     remove_action('init', 'the_neverending_home_page_init', 20);
     $this->infinite_scroll = new The_Neverending_Home_Page();
 }
コード例 #4
0
ファイル: functions.php プロジェクト: mathg/stuff
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
 function sparkling_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      */
     load_theme_textdomain('sparkling', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     /**
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     add_image_size('sparkling-featured', 750, 410, true);
     add_image_size('tab-small', 60, 60, true);
     // Small Thumbnail
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => esc_html__('Primary Menu', 'sparkling'), 'footer-links' => esc_html__('Footer Links', 'sparkling')));
     // Enable support for Post Formats.
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('sparkling_custom_background_args', array('default-color' => 'F2F2F2', 'default-image' => '')));
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery', 'caption'));
     /*
      * Let WordPress manage the document title.
      * By adding theme support, we declare that this theme does not use a
      * hard-coded <title> tag in the document head, and expect WordPress to
      * provide it for us.
      */
     add_theme_support('title-tag');
 }
コード例 #5
0
ファイル: functions.php プロジェクト: davidgilman/Live2Give
/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which runs
 * before the init hook. The init hook is too late for some features, such as indicating
 * support post thumbnails.
 */
function omega_theme_setup()
{
    //remove_theme_mods();
    /* Load omega functions */
    require get_template_directory() . '/lib/functions/hooks.php';
    add_theme_support('title-tag');
    /* Load scripts. */
    add_theme_support('omega-scripts', array('comment-reply'));
    add_theme_support('post-thumbnails');
    add_theme_support('omega-theme-settings');
    add_theme_support('omega-content-archives');
    /* implement editor styling, so as to make the editor content match the resulting post output in the theme. */
    add_editor_style();
    /* Support pagination instead of prev/next links. */
    add_theme_support('loop-pagination');
    /* Add default posts and comments RSS feed links to <head>.  */
    add_theme_support('automatic-feed-links');
    /* Enable wraps */
    add_theme_support('omega-wraps');
    /* Enable custom post */
    add_theme_support('omega-custom-post');
    /* Enable custom css */
    add_theme_support('omega-custom-css');
    /* Enable custom logo */
    add_theme_support('omega-custom-logo');
    /* Enable child themes page */
    add_theme_support('omega-child-page');
    /* Handle content width for embeds and images. */
    omega_set_content_width(700);
}
コード例 #6
0
ファイル: setup.php プロジェクト: msoroeta/theme-name
/**
 * Theme setup
 */
function setup()
{
    // Enable features from Soil when plugin is activated
    // https://roots.io/plugins/soil/
    add_theme_support('soil-clean-up');
    add_theme_support('soil-nav-walker');
    add_theme_support('soil-nice-search');
    add_theme_support('soil-jquery-cdn');
    add_theme_support('soil-relative-urls');
    // Make theme available for translation
    // Community translations can be found at https://github.com/roots/sage-translations
    load_theme_textdomain('sage', get_template_directory() . '/lang');
    // Enable plugins to manage the document title
    // http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
    add_theme_support('title-tag');
    // Register wp_nav_menu() menus
    // http://codex.wordpress.org/Function_Reference/register_nav_menus
    register_nav_menus(['primary_navigation' => __('Primary Navigation', 'sage')]);
    // Enable post thumbnails
    // http://codex.wordpress.org/Post_Thumbnails
    // http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size
    // http://codex.wordpress.org/Function_Reference/add_image_size
    add_theme_support('post-thumbnails');
    // Enable post formats
    // http://codex.wordpress.org/Post_Formats
    add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
    // Enable HTML5 markup support
    // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
    add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']);
    // Use main stylesheet for visual editor
    // To add custom styles edit /assets/styles/layouts/_tinymce.scss
    add_editor_style(Assets\asset_path('styles/main.css'));
}
コード例 #7
0
ファイル: functions.php プロジェクト: happywebdiva/aapcse
function aapcse_themesetup()
{
    // Setup the WordPress core custom background feature.
    add_theme_support('custom-background', apply_filters('a11yall_custom_background_args', array('default-color' => 'eeeeee', 'default-image' => '')));
    // Let users add "featured images", AKA post-thumbnails
    add_theme_support('post-thumbnails');
}
コード例 #8
0
ファイル: basics.php プロジェクト: Naatan/basics
 static function setup()
 {
     load_theme_textdomain('basics', get_template_directory() . '/lang');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     register_nav_menus(array('primary_navigation' => __('Primary Navigation', 'basics'), 'utility_navigation' => __('Utility Navigation', 'basics')));
 }
コード例 #9
0
ファイル: functions.php プロジェクト: COfrost/www.example.dev
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
 function eryn_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on eryn, use a find and replace
      * to change 'eryn' to the name of your theme in all the template files
      */
     load_theme_textdomain('eryn', get_template_directory() . '/languages');
     // Feed Links
     add_theme_support('automatic-feed-links');
     // Post formats
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery'));
     // Post thumbnails
     add_theme_support('post-thumbnails');
     add_image_size('full-thumb', 940, 0, true);
     add_image_size('slider-thumb', 650, 440, true);
     add_image_size('thumb', 440, 294, true);
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Menu', 'eryn')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     // Display Title in theme
     add_theme_support('title-tag');
     // Custom Backgrounds Support
     $args = array('default-color' => 'FFFFFF');
     add_theme_support('custom-background', $args);
     // link a custom stylesheet file to the TinyMCE visual editor
     $font_url = str_replace(',', '%2C', '//fonts.googleapis.com/css?family=Droid+Serif');
     add_editor_style(array('style.css', 'css/editor-style.css', $font_url));
 }
コード例 #10
0
 function theme_setup()
 {
     /* This theme uses post thumbnails (aka "featured images")
      *  all images will be cropped to thumbnail size (below), as well as
      *  a square size (also below). You can add more of your own crop
      *  sizes with add_image_size. */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(120, 90, true);
     add_image_size('square', 380, 380, true);
     add_image_size('small-square', 185, 185, true);
     add_image_size('half', 640, 640, true);
     add_image_size('post', 600, 600, true);
     add_image_size('about', 400, 566, true);
     add_image_size('single-post', 600, 600, true);
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     /* This theme uses wp_nav_menu() in one location.
      * You can allow clients to create multiple menus by
      * adding additional menus to the array. */
     register_nav_menus(array('primary' => 'Primary Navigation'));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
 }
コード例 #11
0
/**
*
* THEME SETUP
*
**/
function SkeletonTube_Setup()
{
    /**
     *
     * Navigation Menu
     *
     **/
    register_nav_menus(array('primary' => __('Primary Menu'), 'footer' => __('Footer Menu')));
    /**
     *
     * Add featured image support
     *
     **/
    add_theme_support('post-thumbnails');
    add_image_size('banner-image', 950, 350, true);
    /**
     *
     * Search Form
     *
     **/
    add_theme_support('html5', array('search-form'));
    /**
     *
     * Add Post Format Support
     *
     **/
    add_theme_support('post-formats', array('aside', 'gallery', 'link'));
}
コード例 #12
0
ファイル: functions.php プロジェクト: ahmedghazi/tpls
function et_setup_theme()
{
    global $themename, $shortname, $et_store_options_in_one_row, $default_colorscheme;
    $themename = 'Divi';
    $shortname = 'divi';
    $et_store_options_in_one_row = true;
    $default_colorscheme = "Default";
    $template_directory = get_template_directory();
    require_once $template_directory . '/epanel/custom_functions.php';
    require_once $template_directory . '/includes/functions/comments.php';
    require_once $template_directory . '/includes/functions/sidebars.php';
    load_theme_textdomain('Divi', $template_directory . '/lang');
    require_once $template_directory . '/epanel/core_functions.php';
    require_once $template_directory . '/epanel/post_thumbnails_divi.php';
    include $template_directory . '/includes/widgets.php';
    register_nav_menus(array('primary-menu' => __('Primary Menu', 'Divi'), 'secondary-menu' => __('Secondary Menu', 'Divi'), 'footer-menu' => __('Footer Menu', 'Divi')));
    // don't display the empty title bar if the widget title is not set
    remove_filter('widget_title', 'et_widget_force_title');
    add_action('wp_enqueue_scripts', 'et_add_responsive_shortcodes_css', 11);
    add_theme_support('post-formats', array('video', 'audio', 'quote', 'gallery', 'link'));
    add_theme_support('woocommerce');
    remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
    remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    add_action('woocommerce_before_main_content', 'et_divi_output_content_wrapper', 10);
    remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
    add_action('woocommerce_after_main_content', 'et_divi_output_content_wrapper_end', 10);
    //remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
    // deactivate page templates and custom import functions
    remove_action('init', 'et_activate_features');
}
コード例 #13
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  */
 function minileven_setup()
 {
     global $wp_version;
     /**
      * Custom template tags for this theme.
      */
     require get_template_directory() . '/inc/template-tags.php';
     /**
      * Custom functions that act independently of the theme templates
      */
     require get_template_directory() . '/inc/tweaks.php';
     /* Make Minileven available for translation.
      * Translations can be added to the /languages/ directory.
      * If you're building a theme based on Minileven, use a find and replace
      * to change 'minileven' to the name of your theme in all the template files.
      */
     load_theme_textdomain('minileven', TEMPLATEPATH . '/languages');
     // Add default posts and comments RSS feed links to <head>.
     add_theme_support('automatic-feed-links');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menu('primary', __('Primary Menu', 'jetpack'));
     // Add support for a variety of post formats
     add_theme_support('post-formats', array('gallery'));
     // Add support for custom backgrounds
     if (version_compare($wp_version, '3.4', '>=')) {
         add_theme_support('custom-background');
     } else {
         add_custom_background();
     }
     // Add support for post thumbnails
     add_theme_support('post-thumbnails');
 }
コード例 #14
0
ファイル: functions.php プロジェクト: vegemite4me/goran-pest
/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which
 * runs before the init hook. The init hook is too late for some features, such
 * as indicating support for post thumbnails.
 */
function goran_setup()
{
    /*
     * Declare textdomain for this child theme.
     */
    load_child_theme_textdomain('goran', get_stylesheet_directory() . '/languages');
    /*
     * Enable support for Post Thumbnails on posts and pages.
     *
     * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
     */
    add_image_size('edin-thumbnail-landscape', 314, 228, true);
    add_image_size('edin-thumbnail-square', 314, 314, true);
    add_image_size('edin-featured-image', 772, 9999);
    add_image_size('edin-hero', 1230, 1230);
    /*
     * Unregister nav menu.
     */
    unregister_nav_menu('secondary');
    /*
     * Editor styles.
     */
    add_editor_style(array('editor-style.css', goran_noto_sans_font_url(), goran_noto_serif_font_url(), goran_droid_sans_mono_font_url()));
    /**
     * Add support for Eventbrite.
     * See: https://wordpress.org/plugins/eventbrite-api/
     */
    add_theme_support('eventbrite');
}
コード例 #15
0
ファイル: setup.php プロジェクト: WPDevHQ/actions
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
 function actions_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on actions, use a find and replace
      * to change 'actions' to the name of your theme in all the template files.
      */
     load_theme_textdomain('actions');
     /**
      * Add default posts and comments RSS feed links to head.
      */
     add_theme_support('automatic-feed-links');
     add_theme_support('customize-selective-refresh-widgets');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(640, 300);
     // This theme uses wp_nav_menu() in one locations.
     register_nav_menus(array('primary' => esc_html__('Primary Menu', 'actions')));
     /*
      * Switch default core markup for search form, comment form, comments, galleries, captions and widgets
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'widgets'));
     /*
      * Enable support for site logo.
      */
     add_theme_support('custom-logo', array('height' => 150, 'width' => 250, 'flex-height' => true, 'header-text' => array('site-title', 'site-description')));
     // Declare support for title theme feature
     add_theme_support('title-tag');
 }
コード例 #16
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
 function _act_setup()
 {
     load_theme_textdomain('_s', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     add_theme_support('title-tag');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
      */
     add_theme_support('post-thumbnails');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => esc_html__('Primary', '_act'), 'hero' => esc_html__('Hero', '_act')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     /*
      * Enable support for Post Formats.
      * See https://developer.wordpress.org/themes/functionality/post-formats/
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     // Set up the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('_act_custom_background_args', array('default-color' => 'ffffff', 'default-image' => '')));
     add_image_size('feature500', 500, 500, true);
 }
コード例 #17
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override reddle_setup() in a child theme, add your own reddle_setup to your child theme's
  * functions.php file.
  */
 function reddle_setup()
 {
     /**
      * Make theme available for translation
      * Translations can be filed in the /languages/ directory
      * If you're building a theme based on Reddle, use a find and replace
      * to change 'reddle' to the name of your theme in all the template files
      */
     load_theme_textdomain('reddle', get_template_directory() . '/languages');
     /**
      * Add default posts and comments RSS feed links to head
      */
     add_theme_support('automatic-feed-links');
     /**
      * This theme uses wp_nav_menu() in one location.
      */
     register_nav_menus(array('primary' => __('Primary Menu', 'reddle')));
     /**
      * Add support for the Aside and Gallery Post Formats
      */
     add_theme_support('post-formats', array('aside', 'image'));
     /**
      * Add in support for post thumbnails
      */
     add_theme_support('post-thumbnails');
     /**
      * Add support for custom backgrounds
      */
     add_theme_support('custom-background');
 }
コード例 #18
0
 public function add_thumbnails_for_themes()
 {
     global $ecwd_config;
     if ($ecwd_config['featured_image_for_themes']['value'] == '1') {
         add_theme_support('post-thumbnails', array('ecwd_calendar', 'ecwd_organizer', 'ecwd_event', 'ecwd_venue'));
     }
 }
コード例 #19
0
 /**
  * Initial setup
  *
  * This function is attached to the 'after_setup_theme' action hook.
  *
  * @uses	load_theme_textdomain()
  * @uses	get_locale()
  * @uses	BAVOTASAN_THEME_TEMPLATE
  * @uses	add_theme_support()
  * @uses	add_editor_style()
  * @uses	add_custom_background()
  * @uses	add_custom_image_header()
  * @uses	register_default_headers()
  *
  * @since 1.0.0
  */
 function bavotasan_setup()
 {
     load_theme_textdomain('arcade', BAVOTASAN_THEME_TEMPLATE . '/library/languages');
     // Add default posts and comments RSS feed links to <head>.
     add_theme_support('automatic-feed-links');
     // This theme styles the visual editor with editor-style.css to match the theme style.
     add_editor_style('library/css/admin/editor-style.css');
     // This theme uses wp_nav_menu() in two location.
     register_nav_menu('primary', __('Primary Menu', 'arcade'));
     // Add support for a variety of post formats
     add_theme_support('post-formats', array('gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside'));
     // This theme uses Featured Images (also known as post thumbnails) for archive pages
     add_theme_support('post-thumbnails');
     add_image_size('half', 570, 220, true);
     add_image_size('square100', 100, 100, true);
     // Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header.
     add_theme_support('custom-header', array('header-text' => false, 'flex-height' => true, 'flex-width' => true, 'random-default' => true, 'width' => apply_filters('bavotasan_header_image_width', 1800), 'height' => apply_filters('bavotasan_header_image_height', 1200)));
     // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
     register_default_headers(array('header01' => array('url' => '%s/library/images/header01.jpg', 'thumbnail_url' => '%s/library/images/header01-thumbnail.jpg', 'description' => __('Default Header 1', 'arcade'))));
     // Add support for custom backgrounds
     add_theme_support('custom-background');
     // Add HTML5 elements
     add_theme_support('html5', array('comment-list', 'comment-form'));
     // Add title tag support
     add_theme_support('title-tag');
     // Remove default gallery styles
     add_filter('use_default_gallery_style', '__return_false');
     // Infinite scroll
     add_theme_support('infinite-scroll', array('type' => 'scroll', 'container' => 'primary', 'wrapper' => false, 'footer' => false));
     // Add Woocommerce support
     add_theme_support('woocommerce');
 }
コード例 #20
0
ファイル: customizer.php プロジェクト: ziedbou/organic
/**
 * Sets up the WordPress core custom header and custom background features.
 *
 * @since www.ziedbouhejba.com 1.0
 *
 * @see twentysixteen_header_style()
 */
function twentysixteen_custom_header_and_background()
{
    $color_scheme = twentysixteen_get_color_scheme();
    $default_background_color = trim($color_scheme[0], '#');
    $default_text_color = trim($color_scheme[3], '#');
    /**
     * Filter the arguments used when adding 'custom-background' support in www.ziedbouhejba.com.
     *
     * @since www.ziedbouhejba.com 1.0
     *
     * @param array $args {
     *     An array of custom-background support arguments.
     *
     *     @type string $default-color Default color of the background.
     * }
     */
    add_theme_support('custom-background', apply_filters('twentysixteen_custom_background_args', array('default-color' => $default_background_color)));
    /**
     * Filter the arguments used when adding 'custom-header' support in www.ziedbouhejba.com.
     *
     * @since www.ziedbouhejba.com 1.0
     *
     * @param array $args {
     *     An array of custom-header support arguments.
     *
     *     @type string $default-text-color Default color of the header text.
     *     @type int      $width            Width in pixels of the custom header image. Default 1200.
     *     @type int      $height           Height in pixels of the custom header image. Default 280.
     *     @type bool     $flex-height      Whether to allow flexible-height header images. Default true.
     *     @type callable $wp-head-callback Callback function used to style the header image and text
     *                                      displayed on the blog.
     * }
     */
    add_theme_support('custom-header', apply_filters('twentysixteen_custom_header_args', array('default-text-color' => $default_text_color, 'width' => 1200, 'height' => 280, 'flex-height' => true, 'wp-head-callback' => 'twentysixteen_header_style')));
}
コード例 #21
0
ファイル: functions.php プロジェクト: jhersonn20/www
function exclusive_setup()
{
    add_theme_support('custom-header', array('default-image' => '', 'header-text' => false, 'wp-head-callback' => 'exclusive_header_style'));
    $exclusive_defaults = array('default-color' => 'E3E1E2', 'default-image' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '');
    add_theme_support('custom-background', $exclusive_defaults);
    if (!get_theme_mod('background_color', false)) {
        set_theme_mod('background_color', 'e3e1e2');
    }
    load_theme_textdomain('wd_exclusive', get_template_directory() . '/languages');
    add_editor_style();
    global $exclusive_layout_page;
    foreach ($exclusive_layout_page->options_themeoptions as $value) {
        if (isset($value['id'])) {
            if (get_theme_mod($value['id']) === FALSE) {
                ${$value}['var_name'] = $value['std'];
            } else {
                ${$value}['var_name'] = get_theme_mod($value['id']);
            }
        }
    }
    global $content_width;
    if (!isset($content_width)) {
        $content_width = $content_area;
    }
}
コード例 #22
0
ファイル: featured.php プロジェクト: ahua/www
function foundation_featured_setup()
{
    if (function_exists('add_theme_support')) {
        add_theme_support('post-thumbnails');
        add_image_size('foundation-featured-image', 900, 9999, false);
    }
    global $foundation_featured_posts;
    $settings = foundation_get_settings();
    $args = foundation_featured_get_args();
    if ($settings->featured_enabled) {
        $slides = foundation_featured_get_slides();
        $slide_count = 0;
        if ($slides->post_count > 0) {
            while ($slides->have_posts() && $slide_count < $args['num']) {
                $slides->the_post();
                $image = foundation_featured_has_image();
                if ($image) {
                    $slide_count++;
                    $foundation_featured_posts[] = get_the_ID();
                }
            }
        }
    }
    add_filter('parse_query', 'foundation_featured_modify_query');
}
コード例 #23
0
function beccamakesatheme_setup()
{
    // Post thumbnails support
    add_theme_support('post-thumbnails');
    // Register Menus
    register_nav_menus(array('primary-menu' => __('Primary Menu', 'beccamakesatheme'), 'secondary' => __('Secondary Menu', 'beccamakesatheme')));
}
コード例 #24
0
ファイル: init.php プロジェクト: sinaru/Rubi-WordPress-Theme
/**
 * Theme setup
 */
function setup()
{
    // Make theme available for translation
    // Community translations can be found at https://github.com/roots/rubi-translations
    load_theme_textdomain('rubi', get_template_directory() . '/lang');
    // Enable plugins to manage the document title
    // http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
    add_theme_support('title-tag');
    // Register wp_nav_menu() menus
    // http://codex.wordpress.org/Function_Reference/register_nav_menus
    register_nav_menus(['primary_navigation' => __('Primary Navigation', 'rubi')]);
    // Add post thumbnails
    // http://codex.wordpress.org/Post_Thumbnails
    // http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size
    // http://codex.wordpress.org/Function_Reference/add_image_size
    add_theme_support('post-thumbnails');
    // Add post formats
    // http://codex.wordpress.org/Post_Formats
    add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
    // Add HTML5 markup for captions
    // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
    add_theme_support('html5', ['caption', 'comment-form', 'comment-list']);
    // Tell the TinyMCE editor to use a custom stylesheet
    add_editor_style(Assets\asset_path('styles/editor-style.css'));
}
コード例 #25
0
ファイル: functions.php プロジェクト: solsticehc/citadel
function renova_setup()
{
    //Feed links
    add_theme_support('automatic-feed-links');
    //Nav menu
    register_nav_menu('primary', __('Primary Menu', 'renovalang'));
    //Sidebar
    $args = array('name' => __('renova_side', 'renovalang'), 'id' => 'renova01', 'description' => '', 'class' => '', 'before_widget' => '<section id="%1$s"  class="blog-side-panel %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2>', 'after_title' => '</h2>');
    register_sidebar($args);
    //Content width
    if (!isset($content_width)) {
        $content_width = 900;
    }
    //Initiate custom post types
    add_action('init', 'renova_post_types');
    add_action('init', 'renova_post_gallery');
    //Load the text domain
    load_theme_textdomain('renovalang', get_template_directory() . '/languages');
    //Post Thumbnails
    add_theme_support('post-thumbnails', array('portfolio_item', 'gallery_item', 'post'));
    //Post formats
    add_theme_support('post-formats', array('image', 'audio', 'link', 'quote', 'video'));
    set_post_thumbnail_size(300, 300, true);
    // Standard Size Thumbnails
    //Function to crop all thumbnails
    if (false === get_option("thumbnail_crop")) {
        add_option("thumbnail_crop", "1");
    } else {
        update_option("thumbnail_crop", "1");
    }
}
コード例 #26
0
function reciprocal_essential_functions()
{
    // for dynamic title
    add_theme_support('title-tag');
    // for customize Header Image
    $els_header_img = array('default-image' => get_template_directory_uri() . '/images/custom-header-bg.jpg');
    add_theme_support('custom-header', $els_header_img);
    //---------------------------
    // for customize background color
    add_theme_support('custom-background');
    //---------------------------
    // for add featured image
    add_theme_support('post-thumbnails');
    //---------------------------
    // theme textdomain
    load_theme_textdomain('reciprocal', get_template_directory_uri() . '/languages');
    //---------------------------
    // for menu register--------
    if (function_exists('register_nav_menus')) {
        register_nav_menus(array('prodhanmenu' => __('Main Menu', 'reciprocal'), 'nichermenu' => __('Footer Menu', 'reciprocal')));
    }
    //---------------------------
    function short_description($limit)
    {
        $content = explode(' ', get_the_content());
        $less_content = array_slice($content, 0, $limit);
        echo implode(' ', $less_content);
    }
}
コード例 #27
0
ファイル: jetpack.php プロジェクト: WPAddiction/test
/**
 * Jetpack setup function.
 *
 * See: https://jetpack.me/support/infinite-scroll/
 * See: https://jetpack.me/support/responsive-videos/
 */
function test_jetpack_setup()
{
    // Add theme support for Infinite Scroll.
    add_theme_support('infinite-scroll', array('container' => 'main', 'render' => 'test_infinite_scroll_render', 'footer' => 'page'));
    // Add theme support for Responsive Videos.
    add_theme_support('jetpack-responsive-videos');
}
コード例 #28
0
ファイル: functions.php プロジェクト: scotty2nd/snippets
function cw_theme_setup()
{
    add_theme_support('menus');
    register_nav_menu('primary', 'Primary Header Navigation');
    /*register_nav_menu('primary-mobile', 'Primary Mobile Header Navigation');*/
    register_nav_menu('secondary', 'Footer Navigation');
}
コード例 #29
0
	function my_setup() {
		// This theme styles the visual editor with editor-style.css to match the theme style.
		add_editor_style();

		// This theme uses post thumbnails
		if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
			add_theme_support( 'post-thumbnails' );
			set_post_thumbnail_size( 200, 150, true ); // Normal post thumbnails
			add_image_size( 'slider-post-thumbnail', 940, 446, true ); // Slider Thumbnail
			add_image_size( 'slider-thumb', 100, 50, true ); // Slider Small Thumbnail
		}

		// Add default posts and comments RSS feed links to head
		add_theme_support( 'automatic-feed-links' );

		// custom menu support
		add_theme_support( 'menus' );
		if ( function_exists( 'register_nav_menus' ) ) {
			register_nav_menus(
				array(
					'header_menu' => theme_locals("header_menu"),
					'footer_menu' => theme_locals("footer_menu")
				)
			);
		}
	}
コード例 #30
0
ファイル: functions.php プロジェクト: Arkon13/magazin2
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
 function cartel_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on Cartel, use a find and replace
      * to change 'cartel' to the name of your theme in all the template files
      */
     load_theme_textdomain('cartel', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Menu', 'cartel')));
     // Enable support for Post Formats.
     //add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
     // Setup the WordPress core custom background feature.
     /*
     	add_theme_support( 'custom-background', apply_filters( 'cartel_custom_background_args', array(
     		'default-color' => 'ffffff',
     		'default-image' => '',
     	) ) );
     */
     // Enable support for HTML5 markup.
     add_theme_support('html5', array('comment-list', 'search-form', 'comment-form', 'gallery', 'caption'));
 }