function test__wp_render_title_no_theme_support() { $this->go_to('/'); remove_theme_support('title-tag'); $this->expectOutputString(''); _wp_render_title_tag(); }
function shoestrap_hide_navbar() { $navbar = get_theme_mod('shoestrap_navbar_top'); if ($navbar == 0) { remove_theme_support('bootstrap-top-navbar'); } }
function testWPTitle() { //since we're testing with twentyfourteen -- need to remove its filters on wp_title remove_all_filters('wp_title'); remove_theme_support('title-tag'); $this->assertEquals('', TimberHelper::get_wp_title()); }
/** * If mobile site is enable and there is a mobile template, then display mobile layout on mobile */ function calibrefx_init_mobile_site() { global $calibrefx; //Register mobile menu register_nav_menus(array('mobile' => apply_filters('mobile_menu_text', __('Mobile Navigation Menu', 'calibrefx')))); if (is_admin() or !wp_is_mobile()) { return; } remove_theme_support('calibrefx-footer-widgets'); remove_theme_support('calibrefx-header-right-widgets'); //Disable wp admin bar show_admin_bar(false); add_filter('body_class', 'calibrefx_mobile_site_body_class'); add_filter('wrapper_class', 'calibrefx_mobile_wrapper_class'); add_filter('wrapper_attr', 'calibrefx_mobile_wrapper_attr'); remove_action('calibrefx_after_header', 'calibrefx_do_nav'); remove_action('calibrefx_after_header', 'calibrefx_do_subnav', 15); add_action('calibrefx_before_wrapper', 'calibrefx_do_top_mobile_nav'); add_action('calibrefx_after_wrapper', 'calibrefx_do_mobile_footer', 100); add_filter('template_include', 'calibrefx_get_mobile_template'); if (file_exists(CHILD_MOBILE_URI . '/functions.php')) { load_template(CHILD_MOBILE_URI . '/functions.php'); } $calibrefx->hooks->remove('calibrefx_before_loop', 'calibrefx_do_breadcrumbs', 10); $calibrefx->hooks->remove('calibrefx_before_loop', 'calibrefx_do_notification', 20); $calibrefx->hooks->remove('calibrefx_sidebar', 'calibrefx_do_sidebar'); $calibrefx->hooks->remove('calibrefx_sidebar_alt', 'calibrefx_do_sidebar_alt'); $calibrefx->hooks->remove('calibrefx_after_post_content', 'calibrefx_do_author_box_single', 20); $calibrefx->hooks->remove('calibrefx_footer', 'calibrefx_footer_area', 10); //On mobile there is no sidebar add_filter('calibrefx_site_layout', 'calibrefx_layout_full_width'); }
function remove_parent_features() { remove_action('init', 'gdlr_register_portfolio_admin_option'); remove_action('init', 'gdlr_init_page_feature'); //remove theme support for post formats remove_theme_support('post-formats'); }
public function wordpressAction(Request $request) { $this->get('wordpress.loader')->load(); $this->get('wordpress.loader')->loadPostInWordpressFromRequest($request); remove_theme_support('custom-header'); remove_action('wp_head', 'wp_enqueue_scripts', 1); remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); remove_action('wp_head', 'locale_stylesheet'); remove_action('wp_head', 'noindex', 1); remove_action('wp_head', 'wp_print_styles', 8); remove_action('wp_head', 'wp_print_head_scripts', 9); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'rel_canonical'); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); ob_start(); @wp_head(); $head = ob_get_clean(); ob_start(); $content = dynamic_sidebar('sidebar-2'); $side = ob_get_clean(); ob_start(); the_content(); $content = ob_get_clean(); $post = array('content' => $content); return $this->render($this->container->getParameter('wordpress.template'), array('post' => $post)); }
function genesis_seo_compatibility_check() { // Disable all SEO functions if a popular SEO plugin is active if (class_exists('wpSEO') || class_exists('All_in_One_SEO_Pack') || class_exists('HeadSpace_Plugin') || class_exists('Platinum_SEO_Pack') || defined('WPSEO_VERSION')) { remove_filter('wp_title', 'genesis_default_title', 10, 3); remove_action('get_header', 'genesis_doc_head_control'); remove_action('genesis_meta', 'genesis_seo_meta_description'); remove_action('genesis_meta', 'genesis_seo_meta_keywords'); remove_action('genesis_meta', 'genesis_robots_meta'); remove_action('wp_head', 'genesis_canonical'); add_action('wp_head', 'rel_canonical'); remove_action('admin_menu', 'genesis_add_inpost_seo_box'); remove_action('save_post', 'genesis_inpost_seo_save', 1, 2); remove_action('admin_init', 'genesis_add_taxonomy_seo_options'); remove_action('edit_term', 'genesis_term_meta_save', 10, 2); remove_action('show_user_profile', 'genesis_user_seo_fields'); remove_action('edit_user_profile', 'genesis_user_seo_fields'); remove_theme_support('genesis-seo-settings-menu'); add_filter('pre_option_' . GENESIS_SEO_SETTINGS_FIELD, '__return_empty_array'); } // disable Genesis <title> generation if SEO Title Tag is active if (function_exists('seo_title_tag')) { remove_filter('wp_title', 'genesis_default_title', 10, 3); remove_action('genesis_title', 'wp_title'); add_action('genesis_title', 'seo_title_tag'); } }
/** * Remove unneeded Jetpack Logo related functions. * Hook into after_theme_setup with priority of 11 * to override parent theme functions. * * @link https://codex.wordpress.org/Function_Reference/remove_theme_support * */ function adaline_logo_letter_setup() { // This will remove the image size used exclusively with Jetpack Site Logo remove_image_size('adaline-logo'); // This will remove theme support for Jetpack Site Logo remove_theme_support('site-logo'); }
function test_xhtml_markup_specified_by_theme_support() { $this->assertFalse(thematic_is_legacy_xhtml()); add_theme_support('thematic_xhtml'); $this->assertTrue(thematic_is_legacy_xhtml()); remove_theme_support('thematic_xhtml'); $this->assertFalse(thematic_is_legacy_xhtml()); }
function gb3_custom_theme_support() { $bsg_add_theme_support = array('bsg-add-head-markup', 'bsg-bootstrap-markup', 'bsg-bootstrap-walker', 'bsg-comment-form', 'bsg-custom-css-js', 'bsg-customizer', 'bsg-footer-creds', 'bsg-genesis-setup', 'bsg-image-display', 'bsg-load-assets', 'bsg-nav', 'bsg-pagination', 'bsg-post-content-nav', 'bsg-search-form', 'bsg-jumbotron'); foreach ($bsg_add_theme_support as $bsg_support) { add_theme_support($bsg_support); } remove_theme_support('genesis-accessibility'); }
/** * Show all posts on initial page for search results. * Temp solution for ES and IS conflict. */ function smittenkitchen_search_posts_per_page($query) { if (!is_admin() && is_search() && $query->is_main_query()) { remove_theme_support('infinite-scroll'); $query->set('posts_per_page', 999); } return $query; }
function mobile_theme_setup() { /* Load the primary menu. */ remove_action('omega_before_header', 'omega_get_primary_menu'); add_action('omega_header', 'omega_get_primary_menu'); add_filter('omega_site_description', 'mobile_site_description'); remove_theme_support('omega-custom-logo'); remove_action("omega_header", 'omega_branding'); add_action('init', 'mobile_init', 1); }
function tearDown() { global $wpdb, $wp_query, $post; $this->expectedDeprecated(); $wpdb->query( 'ROLLBACK' ); $wp_query = new WP_Query(); $post = null; remove_theme_support( 'html5' ); remove_filter( 'query', array( $this, '_create_temporary_tables' ) ); remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); }
/** * @group bu-navigation-features */ public function test_supports_by_theme_support() { $features = $this->plugin->features(); foreach ($features as $feature => $default) { $this->assertEquals($default, $this->plugin->supports($feature)); add_theme_support('bu-navigation-' . $feature); $this->assertTrue($this->plugin->supports($feature)); remove_theme_support('bu-navigation-' . $feature); $this->assertEquals($default, $this->plugin->supports($feature)); } }
/** * Everything that should be initialized through simple call */ public function initThemeSupport() { # add theme support add_theme_support('post-thumbnails'); remove_theme_support('post-formats'); add_image_size('240x148', 240, 148, TRUE); add_image_size('268x213', 268, 213, TRUE); add_image_size('1020x398', 1020, 398, TRUE); add_image_size('760x468', 760, 468, TRUE); add_image_size('175x175', 175, 175, TRUE); }
function child_theme_setup1() { // Register site styles and scripts add_action('wp_enqueue_scripts', 'child_theme_register_styles'); // Enqueue site styles and scripts add_action('wp_enqueue_scripts', 'child_theme_enqueue_styles'); add_filter('hybopress_hide_page_background', 'child_theme_hide_page_background', 11); remove_theme_support('theme-layouts'); add_theme_support('theme-layouts', array('1c-narrow' => __('1 Column Narrow', 'tidy')), array('default' => '1c-narrow', 'customizer' => true, 'customize' => false)); // Registering required plugin add_filter('hybopress_registered_plugins', 'child_theme_registered_plugins'); }
function tampa_setup() { add_theme_support('pls-js', array('chosen' => array('script' => true, 'style' => true), 'jquery-ui' => array('script' => true, 'style' => true))); add_theme_support('post-thumbnails'); add_theme_support('pls-routing-util-templates'); remove_theme_support('pls-default-css'); remove_theme_support('pls-typography-options'); remove_theme_support('pls-navigation-options'); remove_theme_support('pls-meta-data'); remove_theme_support('pls-meta-tags'); remove_theme_support('pls-micro-data'); }
/** * Adjust the post limit so we can display lots of posts on these pages. * We're also removing Infinite Scroll support for these specific taxonomies, * because IS doesn't handle the adjusted posts_per_page value very well. */ function wanderlist_adjust_postlimit($query) { if (is_admin()) { return; } if (is_tax('wanderlist-trip') || is_tax('wanderlist-country')) { $query->set('posts_per_page', 100); remove_theme_support('infinite-scroll'); // Because otherwise IS just does what it wants. return; } }
function wpr_remove_custom_actions() { remove_action('after_setup_theme', 'pinbin_options_init'); /* remove_action( 'admin_init', 'pinbin_options_setup' ); */ remove_action('admin_menu', 'pinbin_menu_options'); remove_action('admin_print_styles-appearance_page_pinbin-settings', 'pinbin_options_enqueue_scripts'); /* remove_action( 'admin_init', 'pinbin_options_settings_init' ); */ remove_theme_support('custom-background'); if (!is_admin()) { remove_action('wp_enqueue_scripts', 'pinbin_scripts'); } }
function reactor_child_theme_setup() { /* Support for menus */ // remove_theme_support('reactor-menus'); // add_theme_support( // 'reactor-menus', // array('top-bar-l', 'top-bar-r', 'main-menu', 'side-menu', 'footer-links') // ); /* Support for sidebars Note: this doesn't change layout options */ remove_theme_support('reactor-sidebars'); add_theme_support('reactor-sidebars', array('secondary', 'front-primary', 'footer-one', 'footer-two', 'cameras', 'stories')); /* Support for layouts Note: this doesn't remove sidebars */ // remove_theme_support('reactor-layouts'); // add_theme_support( // 'reactor-layouts', // array('1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c') // ); /* Support for custom post types */ // remove_theme_support('reactor-post-types'); // add_theme_support( // 'reactor-post-types', // array('slides', 'portfolio') // ); /* Support for page templates */ // remove_theme_support('reactor-page-templates'); // add_theme_support( // 'reactor-page-templates', // array('front-page', 'news-page', 'portfolio', 'contact') // ); /* Remove support for background options in customizer */ // remove_theme_support('reactor-backgrounds'); /* Remove support for font options in customizer */ // remove_theme_support('reactor-fonts'); /* Remove support for custom login options in customizer */ // remove_theme_support('reactor-custom-login'); /* Remove support for breadcrumbs function */ // remove_theme_support('reactor-breadcrumbs'); /* Remove support for page links function */ // remove_theme_support('reactor-page-links'); /* Remove support for page meta function */ // remove_theme_support('reactor-post-meta'); /* Remove support for taxonomy subnav function */ // remove_theme_support('reactor-taxonomy-subnav'); /* Remove support for shortcodes */ // remove_theme_support('reactor-shortcodes'); /* Remove support for tumblog icons */ // remove_theme_support('reactor-tumblog-icons'); /* Remove support for other langauges */ // remove_theme_support('reactor-translation'); }
public static function wpTearDownAfterClass() { // Restore theme support for formats. if (self::$supported_formats) { add_theme_support('post-formats', self::$supported_formats); } else { remove_theme_support('post-formats'); } wp_delete_post(self::$post_id, true); self::delete_user(self::$editor_id); self::delete_user(self::$author_id); self::delete_user(self::$contributor_id); }
function senpress_setup() { // This theme uses post thumbnails add_theme_support('post-thumbnails'); set_post_thumbnail_size(900, 1288); // Unlimited height, soft crop // Register custom image size for image post formats. add_image_size('sempress-image-post', 900, 1288); // remove some theme supports from SemPress remove_theme_support('custom-background'); remove_theme_support('custom-header'); // remove some unneeded actions remove_action('wp_head', 'sempress_customize_css'); remove_action('customize_register', 'sempress_customize_register'); }
public function get_title() { $separator = $this->title_separator; $use_wp_title = $this->use_wp_title_function; // Disabling 'title-tag' feature. $activate_title_tag_back = false; if ($use_wp_title && get_theme_support('title-tag')) { remove_theme_support('title-tag'); $activate_title_tag_back = true; } $q = $GLOBALS['wp_query']; if ($q->get('wc_query') && function_exists('woocommerce_page_title')) { if ($separator) { $separator = ''; } $title = woocommerce_page_title(false); } else { $is_home = is_home(); $is_front_page = is_front_page(); if ($is_home || $is_front_page) { if ($is_home && $is_front_page) { $title = get_bloginfo('name'); } elseif ($is_home) { $title = get_the_title(get_option('page_for_posts')); } elseif ($is_front_page) { $title = get_the_title(get_option('page_on_front')); } } else { if ($use_wp_title) { $title = wp_title($separator, false); } else { $title = is_singular() ? get_the_title(get_queried_object()) : strip_tags(get_the_archive_title()); } } } // Restoring 'title-tag' feature. if ($activate_title_tag_back) { // add_theme_support( 'title-tag' ); $GLOBALS['_wp_theme_features']['title-tag'] = true; } if ($title) { if ($separator) { $title = substr($title, strlen($separator) + 1); } $title = trim($title); } return $title; }
function manch_setup() { add_theme_support('post-thumbnails'); remove_theme_support('pls-color-options'); remove_theme_support('pls-typography-options'); remove_theme_support('pls-default-css'); remove_theme_support('pls-default-css-header'); remove_theme_support('pls-default-css-nav'); remove_theme_support('pls-default-css-sidebar-widgets'); remove_theme_support('pls-default-css-listings-search'); remove_theme_support('pls-default-css-listings-detail'); add_theme_support('pls-routing-util-templates'); remove_theme_support('pls-meta-data'); remove_theme_support('pls-meta-tags'); remove_theme_support('pls-micro-data'); }
/** * Sets up theme defaults and registers support for various WordPress and BuddyPress 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 1.0 */ function status_setup() { // We're not using BP-Default's primary nav menu, or custom header images. unregister_nav_menu('primary'); remove_theme_support('custom-header'); // Enqueue javascript add_action('wp_enqueue_scripts', 'status_enqueue_scripts'); // Enqueue scripts add_action('wp_enqueue_scripts', 'bp_dtheme_enqueue_styles'); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('admin_bar_nav' => __('Admin Bar Custom Navigation Menu', 'status'))); // Add theme support for post formats add_theme_support('post-formats', array('aside', 'gallery', 'link', 'video', 'image', 'quote', 'status', 'chat')); // This theme comes with all the BuddyPress goodies add_theme_support('buddypress'); }
/** * Disables the Genesis SEO features. * * @since 1.6.0 * * @uses GENESIS_SEO_SETTINGS_FIELD * * @see genesis_default_title() * @see genesis_doc_head_control() * @see genesis_seo_meta_description() * @see genesis_seo_meta_keywords() * @see genesis_robots_meta() * @see genesis_canonical() * @see genesis_add_inpost_seo_box() * @see genesis_add_inpost_seo_save() * @see genesis_add_taxonomy_seo_options() * @see genesis_user_seo_fields() */ function genesis_disable_seo() { remove_filter('wp_title', 'genesis_default_title', 10, 3); remove_action('get_header', 'genesis_doc_head_control'); remove_action('genesis_meta', 'genesis_seo_meta_description'); remove_action('genesis_meta', 'genesis_seo_meta_keywords'); remove_action('genesis_meta', 'genesis_robots_meta'); remove_action('wp_head', 'genesis_canonical', 5); remove_action('admin_menu', 'genesis_add_inpost_seo_box'); remove_action('save_post', 'genesis_inpost_seo_save', 1, 2); remove_action('admin_init', 'genesis_add_taxonomy_seo_options'); remove_action('show_user_profile', 'genesis_user_seo_fields'); remove_action('edit_user_profile', 'genesis_user_seo_fields'); remove_theme_support('genesis-seo-settings-menu'); add_filter('pre_option_' . GENESIS_SEO_SETTINGS_FIELD, '__return_empty_array'); define('GENESIS_SEO_DISABLED', true); }
function tearDown() { global $wpdb, $wp_query, $post; $wpdb->query( 'ROLLBACK' ); if ( is_multisite() ) { while ( ms_is_switched() ) { restore_current_blog(); } } $wp_query = new WP_Query(); $post = null; remove_theme_support( 'html5' ); remove_filter( 'query', array( $this, '_create_temporary_tables' ) ); remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); $this->_restore_hooks(); wp_set_current_user( 0 ); }
/** * Make adjustments to the theme when Jetpack is installed and activated. * * @since 1.0.0 * @return void */ function compass_jetpack_setup() { // Return early if Jetpack isn't activated. if (!class_exists('Jetpack')) { return; } // Add support for Infinite Scroll. add_theme_support('infinite-scroll', array('container' => 'main', 'footer' => 'page')); // Get the active jetpack modules. $modules = get_option('jetpack_active_modules'); // List all modules which conflict with the Cleaner Gallery feature. $conflicts = array('tiled-gallery', 'carousel'); // Remove Cleaner Gallery support if any conflicting modules are active. if (count(array_intersect($conflicts, (array) $modules)) !== 0) { remove_theme_support('cleaner-gallery'); } }
/** * 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 composer_theme_setup() { remove_theme_support('theme-layouts'); /* Load the primary menu. */ remove_action('omega_before_header', 'omega_get_primary_menu'); add_action('omega_header', 'omega_get_primary_menu'); add_filter('omega_site_description', 'composer_site_description'); add_action('omega_after_header', 'composer_banner'); add_theme_support('omega-footer-widgets', 3); remove_action('omega_after_main', 'omega_primary_sidebar'); /* Add support for a custom header image. */ add_theme_support('custom-header', array('header-text' => false, 'flex-width' => true, 'width' => 1024, 'flex-height' => true, 'height' => 600, 'uploads' => true, 'default-image' => get_stylesheet_directory_uri() . '/images/header.jpg')); add_action('wp_enqueue_scripts', 'composer_scripts_styles'); remove_action('omega_before_entry', 'omega_entry_header'); add_action('omega_before_entry', 'composer_entry_header'); remove_action('omega_before_loop', 'omega_archive_title'); load_child_theme_textdomain('composer', get_stylesheet_directory() . '/languages'); }
function reactor_child_theme_setup() { /* Support for menus */ // remove_theme_support('reactor-menus'); add_theme_support('reactor-menus', array('main-menu', 'side-menu')); /* Support for sidebars Note: this doesn't change layout options */ // remove_theme_support('reactor-sidebars'); add_theme_support('reactor-sidebars', array('primary', 'secondary', 'front-primary', 'front-secondary', 'categoria', 'footer')); add_theme_support('reactor-layouts', array('1c', '2c-l')); /* Support for custom post types */ remove_theme_support('reactor-post-types'); /* Support for page templates */ add_theme_support('reactor-page-templates', array('front-page')); /* Remove support for background options in customizer */ remove_theme_support('reactor-backgrounds'); add_theme_support('reactor-tumblog-icons'); }