private function includes() { $parent = get_template_directory() . '/setup/'; $child = get_stylesheet_directory() . '/setup/'; require_once $parent . 'class.install.php'; require_once $parent . 'class.uw-scripts.php'; require_once $parent . 'class.uw-styles.php'; require_once $parent . 'class.uw-dropdowns.php'; require_once $parent . 'class.images.php'; require_once $parent . 'class.squish_bugs.php'; require_once $parent . 'class.filters.php'; require_once $parent . 'class.uw-oembeds.php'; require_once $parent . 'class.googleapps.php'; require_once $parent . 'class.mimes.php'; require_once $parent . 'class.users.php'; require_once $parent . 'class.dropdowns_walker.php'; // no initialization needed because it extends a WP class require_once $parent . 'class.uw-basic-custom-post.php'; // no initialization needed unless a child theme makes one require_once $parent . 'class.uw-sidebar-menu-walker.php'; // sidebar menu will initialize for us require_once $parent . 'class.uw-quicklinks.php'; require_once $parent . 'class.uw-iframes.php'; require_once $parent . 'class.uw-shortcodes.php'; require_once $parent . 'class.uw-media-credit.php'; require_once $parent . 'class.uw-media-caption.php'; require_once $parent . 'class.uw-replace-media.php'; require_once $parent . 'class.uw-tinymce.php'; require_once $parent . 'class.uw-documentation-dashboard-widget.php'; require_once $parent . 'class.uw-enclosure.php'; require_once $parent . 'class.uw-carousel.php'; require_once $parent . 'class.uw-settings.php'; }
function constants($options) { define("THEME_DIR", get_template_directory()); define("THEME_DIR_URI", get_template_directory_uri()); define("THEME_NAME", $options["theme_name"]); if (defined("ICL_LANGUAGE_CODE")) { $lang = "_" . ICL_LANGUAGE_CODE; } else { $lang = ""; } define("THEME_OPTIONS", $options["theme_name"] . '_options' . $lang); define("THEME_SLUG", $options["theme_slug"]); define("THEME_STYLES", THEME_DIR_URI . "/stylesheet/css"); define("THEME_IMAGES", THEME_DIR_URI . "/images"); define("THEME_JS", THEME_DIR_URI . "/js"); define('FONTFACE_DIR', THEME_DIR . '/fontface'); define('FONTFACE_URI', THEME_DIR_URI . '/fontface'); define("THEME_FRAMEWORK", THEME_DIR . "/framework"); define("THEME_PLUGINS", THEME_FRAMEWORK . "/plugins"); define("THEME_ACTIONS", THEME_FRAMEWORK . "/actions"); define("THEME_PLUGINS_URI", THEME_DIR_URI . "/framework/plugins"); define("THEME_SHORTCODES", THEME_FRAMEWORK . "/shortcodes"); define("THEME_WIDGETS", THEME_FRAMEWORK . "/widgets"); define("THEME_SLIDERS", THEME_FRAMEWORK . "/sliders"); define("THEME_HELPERS", THEME_FRAMEWORK . "/helpers"); define("THEME_FUNCTIONS", THEME_FRAMEWORK . "/functions"); define("THEME_CLASSES", THEME_FRAMEWORK . "/classes"); define('THEME_ADMIN', THEME_FRAMEWORK . '/admin'); define('THEME_METABOXES', THEME_ADMIN . '/metaboxes'); define('THEME_ADMIN_POST_TYPES', THEME_ADMIN . '/post-types'); define('THEME_GENERATORS', THEME_ADMIN . '/generators'); define('THEME_ADMIN_URI', THEME_DIR_URI . '/framework/admin'); define('THEME_ADMIN_ASSETS_URI', THEME_DIR_URI . '/framework/admin/assets'); }
/** * 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 activello_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain('activello', 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('activello-featured', 1170, 550, true); add_image_size('activello-slider', 1920, 550, true); add_image_size('activello-thumbnail', 330, 220, true); add_image_size('activello-medium', 640, 480, true); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => esc_html__('Primary Menu', 'activello'))); // Enable support for Post Formats. add_theme_support('post-formats', array('video', 'audio')); // Setup the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('activello_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')); /* * 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'); }
/** * 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); }
function alm_get_default_repeater() { global $wpdb; $file = null; $template_dir = 'alm_templates'; // Allow user to load template from theme directory // Since 2.8.5 // load repeater template from current theme folder if (is_child_theme()) { $template_theme_file = get_stylesheet_directory() . '/' . $template_dir . '/default.php'; // if child theme does not have repeater template, then use the parent theme dir if (!file_exists($template_theme_file)) { $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php'; } } else { $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php'; } // if theme or child theme contains the template, use that file if (file_exists($template_theme_file)) { $file = $template_theme_file; } // Since 2.0 // otherwise use pre-defined plug-in templates if ($file == null) { $blog_id = $wpdb->blogid; if ($blog_id > 1) { $file = ALM_PATH . 'core/repeater/' . $blog_id . '/default.php'; // File } else { $file = ALM_PATH . 'core/repeater/default.php'; } } return $file; }
/** * Retrieve the name of the highest priority template file that exists. * * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which * inherit from a parent theme can just overload one file. If the template is * not found in either of those, it looks in the theme-compat folder last. * * Taken from bbPress * * @since v2.5 * * @param string|array $template_names Template file(s) to search for, in order. * @param bool $load If true the template file will be loaded if it is found. * @param bool $require_once Whether to require_once or require. Default true. * Has no effect if $load is false. * @return string The template filename if one is located. */ function mr_locate_template($template_names, $load = false, $require_once = true, $template_vars) { // No file found yet $located = false; // Try to find a template file foreach ((array) $template_names as $template_name) { // Continue if template is empty if (empty($template_name)) { continue; } // Trim off any slashes from the template name $template_name = ltrim($template_name, '/'); // Check child theme first if (file_exists(trailingslashit(get_stylesheet_directory()) . 'multi-rating/' . $template_name)) { $located = trailingslashit(get_stylesheet_directory()) . 'multi-rating/' . $template_name; break; // Check parent theme next } elseif (file_exists(trailingslashit(get_template_directory()) . 'multi-rating/' . $template_name)) { $located = trailingslashit(get_template_directory()) . 'multi-rating/' . $template_name; break; // Check theme compatibility last } elseif (file_exists(trailingslashit(mr_get_templates_dir()) . $template_name)) { $located = trailingslashit(mr_get_templates_dir()) . $template_name; break; } } if (true == $load && !empty($located)) { mr_load_template($located, $require_once, $template_vars); } return $located; }
function bones_ahoy() { // let's get language support going, if you need it load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation'); // launching operation cleanup add_action('init', 'bones_head_cleanup'); // A better title add_filter('wp_title', 'rw_title', 10, 3); // remove WP version from RSS add_filter('the_generator', 'bones_rss_version'); // remove pesky injected css for recent comments widget add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1); // clean up comment styles in the head add_action('wp_head', 'bones_remove_recent_comments_style', 1); // clean up gallery output in wp add_filter('gallery_style', 'bones_gallery_style'); // enqueue base scripts and styles add_action('wp_enqueue_scripts', 'bones_scripts_and_styles', 999); // ie conditional wrapper // launching this stuff after theme setup bones_theme_support(); // adding sidebars to Wordpress (these are created in functions.php) add_action('widgets_init', 'bones_register_sidebars'); // cleaning up random code around images add_filter('the_content', 'bones_filter_ptags_on_images'); // cleaning up excerpt add_filter('excerpt_more', 'bones_excerpt_more'); }
/** * load_controller_directories. * Goes through the theme and active plugins to check whether it has a wp-controllers directory * and adds this to the internal directories */ private static function load_controller_directories() { self::$_directories = array(__DIR__ . '/controllers'); $parent_theme = get_template_directory(); $child_theme = get_stylesheet_directory(); // Check & add child theme if ($parent_theme !== $child_theme) { $child_theme = apply_filters('wp_controllers_child_theme_directory', "{$child_theme}/wp-controllers"); if (is_dir($child_theme)) { self::$_directories[] = $child_theme; } } // Check & add main/parent theme $parent_theme = apply_filters('wp_controllers_theme_directory', "{$parent_theme}/wp-controllers"); if (is_dir($parent_theme)) { self::$_directories[] = $parent_theme; } // Include necessary plugin functions if front-end if (!function_exists('get_plugins')) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; } // Check & add active plugins $plugins = get_plugins(); $plugins_path = WP_PLUGIN_DIR; foreach ($plugins as $path => $data) { if (is_plugin_active($path) && basename($path) !== basename(__FILE__)) { $path = strstr($path, DIRECTORY_SEPARATOR, true); $directory = apply_filters('wp_controllers_plugin_directory', "{$plugins_path}/{$path}/wp-controllers", $path, $data); if (is_dir($directory)) { self::$_directories[] = $directory; } } } }
function az_theme_setup() { global $options_alice; // Load Translation Domain load_theme_textdomain(AZ_THEME_NAME, get_template_directory() . '/languages'); // Register Menus register_nav_menus(array('primary_menu' => __('Primary Menu', AZ_THEME_NAME))); // Add RSS Feed links to HTML add_theme_support('automatic-feed-links'); // Add Support for Post Formats // add_theme_support('post-formats', array('quote','video','audio', 'image', 'gallery','link')); // Enable excerpts for pages add_post_type_support('page', 'excerpt'); // Configure Thumbnails add_theme_support('post-thumbnails'); // WP 4.1 title tag add_theme_support('title-tag'); // Social meta if (!empty($options_alice['global_menu_share_button']) && $options_alice['global_menu_share_button'] == 'enable') { add_filter('wp_head', 'az_social_meta', 2); } // Remove Emoji's remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_print_styles', 'print_emoji_styles'); }
private function include_required_files() { /** * If Kirki is not already installed, use the included version */ if (!class_exists('Kirki')) { require get_template_directory() . '/inc/kirki/kirki.php'; } /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Include additional theme classes */ require get_template_directory() . '/inc/squarely-layout.php'; require get_template_directory() . '/inc/squarely-scripts.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; /** * If jetpack is not installed then we need to include its site-logo module */ if (!function_exists('site_logo_init')) { require get_template_directory() . '/inc/site-logo.php'; } }
/** * 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')); }
/** * Filter the stylesheet_uri to output the minified CSS file. */ function red_starter_minified_css($stylesheet_uri, $stylesheet_dir_uri) { if (file_exists(get_template_directory() . '/build/css/style.min.css')) { $stylesheet_uri = $stylesheet_dir_uri . '/build/css/style.min.css'; } return $stylesheet_uri; }
/** * 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 toolbox_setup() in a child theme, add your own toolbox_setup to your child theme's * functions.php file. */ function toolbox_setup() { /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on toolbox, use a find and replace * to change 'toolbox' to the name of your theme in all the template files */ load_theme_textdomain('toolbox', get_template_directory() . '/languages'); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/{$locale}.php"; if (is_readable($locale_file)) { require_once $locale_file; } /** * 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', 'toolbox'))); /** * Add support for the Aside and Gallery Post Formats */ add_theme_support('post-formats', array('aside', 'image', 'gallery')); }
function themeInit() { // allow editor style add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css'); // let's get language support going, if you need it load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation'); // a better title (library/bones.php) add_filter('wp_title', 'rw_title', 10, 3); // remove wp version from rss (library/bones.php) add_filter('the_generator', 'bones_rss_version'); // remove pesky injected css for recent comments widget (library/bones.php) add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1); // clean up comment styles in the head (library/bones.php) add_action('wp_head', 'bones_remove_recent_comments_style', 1); // clean up gallery output in wp (library/bones.php) add_filter('gallery_style', 'bones_gallery_style'); // launching this stuff after theme setup (library/bones.php) bones_theme_support(); // cleaning up random code around images add_filter('the_content', 'bones_filter_ptags_on_images'); // cleaning up excerpt add_filter('excerpt_more', 'bones_excerpt_more'); // add filter to prevent "slack.png" from occupying the "slack" slug add_filter('wp_unique_post_slug_is_bad_attachment_slug', '__return_true'); }
/** * 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')); }
/** * 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'); }
function roots_add_rewrites($content) { $theme_name = next(explode('/themes/', get_template_directory())); global $wp_rewrite; $roots_new_non_wp_rules = array('css/(.*)' => 'wp-content/themes/' . $theme_name . '/css/$1', 'js/(.*)' => 'wp-content/themes/' . $theme_name . '/js/$1', 'img/(.*)' => 'wp-content/themes/' . $theme_name . '/img/$1', 'plugins/(.*)' => 'wp-content/plugins/$1'); $wp_rewrite->non_wp_rules += $roots_new_non_wp_rules; }
/** * 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)); }
public static function ktz_definitions() { /* * Get slug for kentooz framework look @ define( 'ktz_theme_textdomain', ktz_theme_slug ); */ define('ktz_theme_slug', get_template()); /* * Retrieves the absolute path to the directory of the current theme, without the trailing slash. * ktz or kentooz use directory /includes for all function */ define('ktz_dir', get_template_directory() . '/'); define('ktz_inc', get_template_directory() . '/includes/'); /* * Retrieve template directory URI for the current theme. Checks for SSL. * Note: Does not return a trailing slash following the directory address. * This can use path for JS, stylesheet, or image * ktz or kentooz use directory /includes for all function */ define('ktz_url', get_template_directory_uri() . '/'); define('ktz_styleinc', get_template_directory_uri() . '/includes/'); /* * Get locale or translating for kentooz framework */ define('ktz_theme_textdomain', ktz_theme_slug); }
/** * 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); }
function lgShortcodeSupperTemplate($settings, $value) { $shortcode = $settings['shortcode']; $plg_dir_temp = TB_DIR . 'templates/'; $theme_dir_temp = get_template_directory() . '/lemongrid_templates/'; $reg = "/^({$shortcode}\\.php|{$shortcode}--.*\\.php)/"; $valueArr = json_decode($value, true); $setting_name = $settings['param_name']; $files = lgFileScanDirectory($plg_dir_temp, $reg); $files = array_merge($files, lgFileScanDirectory($theme_dir_temp, $reg)); $output = ''; $output .= "<select data-loadparambytemplate name=\"" . esc_attr($setting_name) . "\">"; foreach ($files as $name_file => $dir_file) { $params = lgGetComments($dir_file); $field_HTML = isset($params['param']) ? lgFieldTemplate($params['param'], $valueArr) : ''; $selected = $name_file == $valueArr["{$setting_name}"] ? 'selected' : ''; $output .= sprintf('<option data-fieldhtml=\'%s\' value="%s" %s>%s</option>', $field_HTML, $name_file, $selected, isset($params['template name']) ? $params['template name'] . " ({$name_file})" : $name_file); } $output .= "</select>"; $output .= sprintf('<div class="lg-params-container"></div>'); return sprintf(' <div class="lg-shortcode-supper-template"> <textarea class="lg-hidden wpb_vc_param_value" name="%s" data-jsoncontent>%s</textarea> <div class="lg-template-group-field"> %s </div> </div>', esc_attr($settings['param_name']), $value, $output); }
/** * Set up theme defaults and register 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 _tk_setup() { global $cap, $content_width; // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); /** * 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'); /** * 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('_tk_custom_background_args', array('default-color' => 'ffffff', 'default-image' => ''))); /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on _tk, use a find and replace * to change '_tk' to the name of your theme in all the template files */ load_theme_textdomain('_tk', get_template_directory() . '/languages'); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus(array('primary' => __('Header bottom menu', '_tk'))); }
function smamo_instagram() { // Klargør svar $response = array(); $num = isset($_POST['num']) ? 4 * wp_strip_all_tags($_POST['num']) : 4; // vi skal bruge et hashtag, ellers die(); if (!isset($_POST['hash'])) { $response['code'] = '400'; $response['error'] = 'No hashtag received'; wp_die(json_encode($response)); } // Indstil $tag $tag = wp_strip_all_tags($_POST['hash']); // Inkluder instagram class require get_template_directory() . '/functions/instagram/instagram.class.php'; // Opret ny instance $instagram = new Instagram(array('apiKey' => 'dd36cc7a7be445c8a00d9f383e49f8c8', 'apiSecret' => 'e750735ffba74f8a8ed753a33c7351da', 'apiCallback' => 'http://faaborg-gym.dk')); $response['images'] = array(); $inst_obj = $instagram->getTagMedia($tag, $num); $next_page = $instagram->pagination($inst_obj); $response['next'] = $next_page; foreach ($inst_obj->data as $key => $val) { $response['images'][] = $val; } wp_die(json_encode($response)); }
/** * 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')); }
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); }
/** * 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'); }
/** * Set 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 twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers * and backgrounds, and post formats. * @uses register_nav_menus() To add support for navigation menus. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Eleven 1.0 */ function twentyeleven_setup() { /* * Make Twenty Eleven available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Eleven, use * a find and replace to change 'twentyeleven' to the name * of your theme in all the template files. */ load_theme_textdomain('twentyeleven', get_template_directory() . '/languages'); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Load up our theme options page and related code. require get_template_directory() . '/inc/theme-options.php'; // Grab Twenty Eleven's Ephemera widget. require get_template_directory() . '/inc/widgets.php'; // 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', 'twentyeleven')); // Add support for a variety of post formats add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'image')); $theme_options = twentyeleven_get_theme_options(); if ('dark' == $theme_options['color_scheme']) { $default_background_color = '1d1d1d'; } else { $default_background_color = 'e2e2e2'; } // Add support for custom backgrounds. add_theme_support('custom-background', array('default-color' => $default_background_color)); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images add_theme_support('post-thumbnails'); // Add support for custom headers. $custom_header_support = array('default-text-color' => '000', 'width' => apply_filters('twentyeleven_header_image_width', 1000), 'height' => apply_filters('twentyeleven_header_image_height', 288), 'flex-height' => true, 'random-default' => true, 'wp-head-callback' => 'twentyeleven_header_style', 'admin-head-callback' => 'twentyeleven_admin_header_style', 'admin-preview-callback' => 'twentyeleven_admin_header_image'); add_theme_support('custom-header', $custom_header_support); if (!function_exists('get_custom_header')) { // This is all for compatibility with versions of WordPress prior to 3.4. define('HEADER_TEXTCOLOR', $custom_header_support['default-text-color']); define('HEADER_IMAGE', ''); define('HEADER_IMAGE_WIDTH', $custom_header_support['width']); define('HEADER_IMAGE_HEIGHT', $custom_header_support['height']); add_custom_image_header($custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback']); add_custom_background(); } /* * We'll be using post thumbnails for custom header images on posts and pages. * We want them to be the size of the header image that we just defined. * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. */ set_post_thumbnail_size($custom_header_support['width'], $custom_header_support['height'], true); /* * Add Twenty Eleven's custom image sizes. * Used for large feature (header) images. */ add_image_size('large-feature', $custom_header_support['width'], $custom_header_support['height'], true); // Used for featured posts if a large-feature doesn't exist. add_image_size('small-feature', 500, 300); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers(array('wheel' => array('url' => '%s/images/headers/wheel.jpg', 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', 'description' => __('Wheel', 'twentyeleven')), 'shore' => array('url' => '%s/images/headers/shore.jpg', 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg', 'description' => __('Shore', 'twentyeleven')), 'trolley' => array('url' => '%s/images/headers/trolley.jpg', 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg', 'description' => __('Trolley', 'twentyeleven')), 'pine-cone' => array('url' => '%s/images/headers/pine-cone.jpg', 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg', 'description' => __('Pine Cone', 'twentyeleven')), 'chessboard' => array('url' => '%s/images/headers/chessboard.jpg', 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg', 'description' => __('Chessboard', 'twentyeleven')), 'lanterns' => array('url' => '%s/images/headers/lanterns.jpg', 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg', 'description' => __('Lanterns', 'twentyeleven')), 'willow' => array('url' => '%s/images/headers/willow.jpg', 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg', 'description' => __('Willow', 'twentyeleven')), 'hanoi' => array('url' => '%s/images/headers/hanoi.jpg', 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg', 'description' => __('Hanoi Plant', 'twentyeleven')))); }
function wp_grade_start() { //load the translations load_theme_textdomain(wpGrade_txtd, get_template_directory() . '/library/languages'); // clean the head add_action('init', 'wpgrade_head_cleanup'); // no Wordpress version in the RSS feed add_filter('the_generator', 'wpgrade_rss_version'); // remove inline css for the recent comments widget add_filter('wp_head', 'wpgrade_remove_recent_comments_widget_style', 1); // clean up comment styles in the head add_action('wp_head', 'wpgrade_remove_recent_comments_style', 1); // clean up gallery output - remove the inline css add_filter('gallery_style', 'wpgrade_gallery_style'); // enqueue base scripts and styles add_action('wp_enqueue_scripts', 'wpgrade_scripts_and_styles', 1); // custom javascript add_action('wp_head', 'wpgrade_load_custom_js'); // Register theme Features add_action('after_setup_theme', 'custom_theme_features'); // cleaning up <p>s around images add_filter('the_content', 'wpgrade_filter_ptags_on_images'); // cleaning up excerpt - replace [..] with a Read more link add_filter('excerpt_more', 'wpgrade_excerpt_more'); // Add theme support for Post Formats $formats = array('quote', 'video', 'audio'); add_theme_support('post-formats', $formats); }
function gsalborz_ahoy() { //Allow editor style. //add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' ); // let's get language support going, if you need it load_theme_textdomain('gsalborz', get_template_directory() . '/languages'); // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY require_once 'library/custom-post-type.php'; // launching operation cleanup add_action('init', 'gsalborz_head_cleanup'); // A better title add_filter('wp_title', 'rw_title', 10, 3); // remove WP version from RSS add_filter('the_generator', 'gsalborz_rss_version'); // remove pesky injected css for recent comments widget add_filter('wp_head', 'gsalborz_remove_wp_widget_recent_comments_style', 1); // clean up comment styles in the head add_action('wp_head', 'gsalborz_remove_recent_comments_style', 1); // clean up gallery output in wp add_filter('gallery_style', 'gsalborz_gallery_style'); // enqueue base scripts and styles add_action('wp_enqueue_scripts', 'gsalborz_scripts_and_styles', 999); // ie conditional wrapper // launching this stuff after theme setup gsalborz_theme_support(); // adding sidebars to Wordpress (these are created in functions.php) add_action('widgets_init', 'gsalborz_register_sidebars'); // cleaning up random code around images add_filter('the_content', 'gsalborz_filter_ptags_on_images'); // cleaning up excerpt add_filter('excerpt_more', 'gsalborz_excerpt_more'); }
function avenue_setup() { if (!isset($content_width)) { global $content_width; $content_width = 1060; } define('SC_BYBLOS_VERSION', '2.0'); load_theme_textdomain('avenue', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails'); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ register_nav_menus(array('primary' => __('Primary Menu', 'avenue'))); // 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('avenue_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')); add_filter('widget_text', 'do_shortcode'); }