-
Notifications
You must be signed in to change notification settings - Fork 0
/
genesis-fix-for-nyu.php
110 lines (98 loc) · 3.49 KB
/
genesis-fix-for-nyu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Plugin Name: Accessibility fix for Genesis (NYU Specific)
* Plugin URI: https://github.com/KonainM/genesis-fix-for-nyu.git
* Description: The plugin fixes accessibility issues with Genesis Framework and some of its child themes
* Version: 2.0
* Author: Konain Mukadam
* Author URI: https://github.com/KonainM/
*/
/* Code Block for Accessible Menus*/
add_action( 'genesis_setup', 'wpacc_genesis_dropdown_scripts', 15 );
function wpacc_genesis_dropdown_scripts()
{
wp_enqueue_script( 'wpacc-genesis-dropdown', plugins_url( '/JS/wpacc-genesis-dropdown.js' , __FILE__ ), array( 'jquery' ), false, true );
wp_register_style( 'wpacc-genesis-dropdown-css', plugins_url( '/CSS/wpacc-genesis-dropdown.css' , __FILE__ ) );
wp_enqueue_style('wpacc-genesis-dropdown-css');
}
/*Code Block for color contrast fixes*/
add_action( 'genesis_before_header', 'agency_pro_css_fix');
function agency_pro_css_fix()
{
$theme_name = wp_get_theme();
if ($theme_name->get( 'TextDomain' ) === "agency-pro")
{
wp_register_style( 'agency-pro-fix', plugins_url( '/CSS/agency-pro-km.css' , __FILE__ ) );
wp_enqueue_style( 'agency-pro-fix' );
}
}
add_action( 'genesis_before_header', 'eleven40_pro_fix');
function eleven40_pro_fix()
{
$theme_name = wp_get_theme();
if ($theme_name->get( 'ThemeURI' ) === "http://my.studiopress.com/themes/eleven40/")
{
wp_register_style( 'eleven40-pro-fix', plugins_url( '/CSS/eleven40pro-km.css' , __FILE__ ) );
wp_enqueue_style( 'eleven40-pro-fix' );
}
}
add_action( 'genesis_before_header', 'executive_pro_fix');
function executive_pro_fix()
{
$theme_name = wp_get_theme();
if ($theme_name->get( 'TextDomain' ) === "executive-pro")
{
wp_register_style( 'executive-pro-fix', plugins_url( '/CSS/executive-pro-km.css' , __FILE__ ) );
wp_enqueue_style( 'executive-pro-fix' );
}
}
add_action( 'genesis_before_header', 'news_pro_fix');
function news_pro_fix()
{
$theme_name = wp_get_theme();
if ($theme_name->get( 'TextDomain' ) === "news-pro")
{
wp_register_style( 'news-pro-fix', plugins_url( '/CSS/news-pro-km.css' , __FILE__ ) );
wp_enqueue_style( 'news-pro-fix' );
}
}
add_action( 'brunch_pro_inline_styles', 'brunch_pro_css_fix');
function brunch_pro_css_fix()
{
wp_register_style( 'brunch-pro-fix', plugins_url( '/CSS/brunch-pro-km.css' , __FILE__ ) );
wp_enqueue_style( 'brunch-pro-fix' );
}
add_action( 'genesis_site_title', 'modern_portfolio_fix');
function modern_portfolio_fix()
{
$theme_name = wp_get_theme();
if ($theme_name->get( 'TextDomain' ) === "modern-portfolio-pro")
{
wp_register_style( 'modern_portfolio_fix-pro-fix', plugins_url( '/CSS/modern-portfolio-pro-km.css' , __FILE__ ) );
wp_enqueue_style( 'modern_portfolio_fix-pro-fix' );
}
}
/*Code Block for Studio Press Accessibility Fixes*/
add_theme_support( 'genesis-accessibility', array(
'404-page',
'headings',
'rems',
'search-form',
'skip-links',
) );
//* Remove Skip Links from a template
remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 );
//* Dequeue Skip Links Script
add_action( 'wp_enqueue_scripts','child_dequeue_skip_links' );
function child_dequeue_skip_links() {
wp_dequeue_script( 'skip-links' );
}
add_action('genesis_setup', 'register_and_enqueue_css_fixes');
function register_and_enqueue_css_fixes()
{
wp_register_style( 'screen-reader-text', plugins_url( '/CSS/screen-reader-text.css' , __FILE__ ) );
wp_register_style( 'skip-links', plugins_url( '/CSS/skip-links.css' , __FILE__ ) );
wp_enqueue_style( 'screen-reader-text' );
wp_enqueue_style( 'skip-links' );
}
?>