/** * 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. * * @since clearly 1.0 */ function clearly_setup() { // Initialize SiteOrigin settings siteorigin_settings_init(); // Make the theme translatable load_theme_textdomain('clearly', 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 add_theme_support('post-thumbnails'); add_theme_support('siteorigin-panels', array('home-page' => true, 'home-page-template' => 'home-panels.php')); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'clearly'))); // Enable support for Post Formats add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); add_image_size('clearly-slide', 960, 480, true); set_post_thumbnail_size(650, 260, true); if (!defined('SITEORIGIN_PANELS_VERSION') && !siteorigin_plugin_activation_is_activating('siteorigin-panels')) { // Only include panels lite if the panels plugin doesn't exist include get_template_directory() . '/extras/panels-lite/panels-lite.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 post thumbnails. * * @since vantage 1.0 */ function vantage_setup() { // Initialize SiteOrigin settings siteorigin_settings_init(); // Make the theme translatable load_theme_textdomain('vantage', 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 add_theme_support('post-thumbnails'); add_theme_support('siteorigin-panels', array('home-page' => true, 'margin-bottom' => 35, 'home-page-default' => 'default-home', 'home-demo-template' => 'home-panels.php', 'responsive' => siteorigin_setting('layout_responsive'))); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'vantage'))); // Enable support for Post Formats add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); // We support WooCommerce add_theme_support('woocommerce'); // define('WOOCOMMERCE_USE_CSS', false); set_post_thumbnail_size(720, 380, true); add_image_size('vantage-thumbnail-no-sidebar', 1080, 380, true); add_image_size('vantage-slide', 960, 480, true); add_image_size('vantage-carousel', 272, 182, true); add_image_size('vantage-grid-loop', 436, 272, true); add_theme_support('site-logo', array('size' => 'full')); if (!defined('SITEORIGIN_PANELS_VERSION') && !siteorigin_plugin_activation_is_activating('siteorigin-panels')) { // Only include panels lite if the panels plugin doesn't exist include get_template_directory() . '/inc/panels-lite/panels-lite.php'; } add_theme_support('siteorigin-premium-teaser', array('customizer' => true, 'settings' => true)); global $content_width, $vantage_site_width; if (!isset($content_width)) { $content_width = 720; } /* pixels */ if (!isset($vantage_site_width)) { $vantage_site_width = siteorigin_setting('layout_bound') == 'full' ? 1080 : 1010; } }
/** * 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. * * @since vantage 1.0 */ function vantage_setup() { // Initialize SiteOrigin settings siteorigin_settings_init(); // Make the theme translatable load_theme_textdomain('vantage', 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 add_theme_support('post-thumbnails'); add_theme_support('siteorigin-panels', array('home-page' => true, 'margin-bottom' => 35, 'home-page-default' => 'default-home', 'home-demo-template' => 'home-panels.php', 'responsive' => siteorigin_setting('layout_responsive'))); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'vantage'))); // Enable support for Post Formats add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); // We support WooCommerce add_theme_support('woocommerce'); // define('WOOCOMMERCE_USE_CSS', false); set_post_thumbnail_size(720, 380, true); add_image_size('vantage-thumbnail-no-sidebar', 1080, 380, true); add_image_size('vantage-slide', 960, 480, true); add_image_size('vantage-carousel', 272, 182, true); add_image_size('vantage-grid-loop', 436, 272, true); add_theme_support('site-logo', array('size' => 'full')); if (!defined('SITEORIGIN_PANELS_VERSION') && !siteorigin_plugin_activation_is_activating('siteorigin-panels')) { // Only include panels lite if the panels plugin doesn't exist include get_template_directory() . '/inc/panels-lite/panels-lite.php'; } add_theme_support('siteorigin-premium-teaser', array('customizer' => true, 'settings' => true)); global $content_width, $vantage_site_width; if (!isset($content_width)) { $content_width = 720; } /* pixels */ if (!isset($vantage_site_width)) { $vantage_site_width = siteorigin_setting('layout_bound') == 'full' ? 1080 : 1010; } $container = 'content'; $render_function = ''; $wrapper = true; // The posts_per_page setting only works when type is 'scroll'. // When type is set to 'click' either explicitly or automatically, // due to there being footer widgets, it uses the "Blog pages show at most X posts" setting // under Settings > Reading instead. :( // https://wordpress.org/support/topic/posts_per_page-not-having-any-effect $posts_per_page = 7; if (siteorigin_setting('blog_archive_layout') == 'circleicon') { $container = 'vantage-circleicon-loop'; $render_function = 'vantage_infinite_scroll_render'; $wrapper = false; $posts_per_page = 6; } else { if (siteorigin_setting('blog_archive_layout') == 'grid') { $container = 'vantage-grid-loop'; $render_function = 'vantage_infinite_scroll_render'; $wrapper = false; $posts_per_page = 8; } } add_filter('infinite_scroll_settings', 'vantage_infinite_scroll_settings'); add_theme_support('infinite-scroll', array('container' => $container, 'footer' => 'page', 'render' => $render_function, 'wrapper' => $wrapper, 'posts_per_page' => $posts_per_page, 'type' => 'click')); }
<?php if (!defined('SITEORIGIN_PANELS_VERSION') && function_exists('siteorigin_plugin_activation_is_activating') && !siteorigin_plugin_activation_is_activating('siteorigin-panels')) { include get_template_directory() . '/extras/panels-lite/inc/widgets.php'; } /** * Add the admin menu entries */ function siteorigin_panels_lite_admin_menu() { add_theme_page(__('Custom Home Page Builder', 'clearly'), __('Home Page', 'clearly'), 'edit_theme_options', 'so_panels_home_page', 'siteorigin_panels_lite_render_admin_home_page'); } add_action('admin_menu', 'siteorigin_panels_lite_admin_menu'); /** * Render the page used to build the custom home page. */ function siteorigin_panels_lite_render_admin_home_page() { add_meta_box('so-panels-panels', __('Page Builder', 'clearly'), 'siteorigin_panels_metabox_render', 'appearance_page_so_panels_home_page', 'advanced', 'high'); if (isset($_GET['_wpnonce']) && isset($_GET['toggle']) && wp_verify_nonce($_GET['_wpnonce'], 'toggle_panels_home')) { // Update home page enabled setting set_theme_mod('siteorigin_panels_home_page_enabled', (bool) $_GET['panels_new']); } get_template_part('extras/panels-lite/tpl/admin', 'home-page'); } /** * Enqueue any required admin scripts. * * @param $prefix */ function siteorigin_panels_lite_enqueue_admin($prefix)
/** * 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. * * @since focus 1.0 */ function focus_setup() { // Use SiteOrigin theme settings siteorigin_settings_init(); /** * 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/extras.php'; /** * Custom Theme Options */ //require( get_template_directory() . '/inc/theme-options/theme-options.php' ); /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on focus, use a find and replace * to change 'focus' to the name of your theme in all the template files */ load_theme_textdomain('focus', 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 */ add_theme_support('post-thumbnails'); add_theme_support('custom-background', array('default-color' => '#F6F4F2')); /** * Support panels */ add_theme_support('siteorigin-panels', array('margin-bottom' => 30, 'responsive' => siteorigin_setting('layout_responsive'))); add_theme_support('siteorigin-premium-teaser', array('post-type' => array('post'))); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus(array('primary' => __('Primary Menu', 'focus'))); /** * Add custom image sizes */ add_image_size('slider', 1280, 768, true); set_post_thumbnail_size(297, 160, true); // Include the lite version of the page builder if (!defined('SITEORIGIN_PANELS_VERSION') && !siteorigin_plugin_activation_is_activating('siteorigin-panels')) { include get_template_directory() . '/extras/panels-lite/panels-lite.php'; } }