Skip to content

Commit

Permalink
Revise how stylesheets are loaded and add underlines to entry content…
Browse files Browse the repository at this point in the history
… hyperlinks
  • Loading branch information
ZachWatkins committed Oct 23, 2017
1 parent a5858af commit 3413e46
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ css/src/lib/colors-ext.css
css/src/partials/header-ext.css

# Ignore release file
AgriFlex3.zip
agrilife-genesis.zip
75 changes: 34 additions & 41 deletions agrilife-genesis.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,8 @@ function agp_insert_header_image( $title, $inside, $wrap ){
}

// Load CSS when a header image is used
add_action( 'get_header', 'agp_check_styles' );
function agp_check_styles(){

$theme = wp_get_theme();

if(strpos(wp_get_theme(), 'Outreach Pro') !== false){
add_action( 'wp_enqueue_scripts', 'agp_register_op_styles' );
add_action( 'wp_enqueue_scripts', 'agp_enqueue_op_styles' );
} else if(strpos(wp_get_theme(), 'Executive Pro') !== false){
add_action( 'wp_enqueue_scripts', 'agp_register_ep_styles' );
add_action( 'wp_enqueue_scripts', 'agp_enqueue_ep_styles' );
}
add_action( 'get_header', 'agp_check_header_styles' );
function agp_check_header_styles(){

if( !empty( get_header_image() ) ){
add_action( 'wp_enqueue_scripts', 'agp_register_header_styles' );
Expand All @@ -121,8 +111,8 @@ function agp_check_styles(){
function agp_register_header_styles() {

wp_register_style(
'agp-styles',
AGP_DIR_URL . '/css/styles.css',
'agp-header-styles',
AGP_DIR_URL . '/css/styles_headerimage.css',
array(),
'',
'screen'
Expand All @@ -132,43 +122,46 @@ function agp_register_header_styles() {

function agp_enqueue_header_styles() {

wp_enqueue_style( 'agp-styles' );
wp_enqueue_style( 'agp-header-styles' );

}

function agp_register_ep_styles() {
// Add styles dependent on Genesis theme
add_action( 'wp_enqueue_scripts', 'agp_register_theme_styles' );
function agp_register_theme_styles(){

wp_register_style(
'agp-ep-styles',
AGP_DIR_URL . '/css/styles_executive-pro.css',
array(),
'',
'screen'
);

}

function agp_enqueue_ep_styles() {
$theme = wp_get_theme();

wp_enqueue_style( 'agp-ep-styles' );
if(strpos(wp_get_theme(), 'Outreach Pro') !== false){
wp_register_style(
'agp-op-styles',
AGP_DIR_URL . 'css/styles_outreach-pro.css',
array(),
'',
'screen'
);
} else if(strpos(wp_get_theme(), 'Executive Pro') !== false){
wp_register_style(
'agp-ep-styles',
AGP_DIR_URL . 'css/styles_executive-pro.css',
array(),
'',
'screen'
);
}

}

function agp_register_op_styles() {
add_action( 'wp_enqueue_scripts', 'agp_enqueue_theme_styles' );
function agp_enqueue_theme_styles(){

wp_register_style(
'agp-op-styles',
AGP_DIR_URL . '/css/styles_outreach-pro.css',
array(),
'',
'screen'
);

}

function agp_enqueue_op_styles() {
$theme = wp_get_theme();

wp_enqueue_style( 'agp-op-styles' );
if(strpos(wp_get_theme(), 'Outreach Pro') !== false){
wp_enqueue_style( 'agp-op-styles' );
} else if(strpos(wp_get_theme(), 'Executive Pro') !== false){
wp_enqueue_style( 'agp-ep-styles' );
}

}

Expand Down
3 changes: 3 additions & 0 deletions css/src/partials/_shared.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.site-inner a {
text-decoration: underline;
}
4 changes: 0 additions & 4 deletions css/src/styles.scss

This file was deleted.

1 change: 1 addition & 0 deletions css/src/styles_executive-pro.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import "partials/executive-pro-maroon";
@import "partials/shared";
File renamed without changes.
1 change: 1 addition & 0 deletions css/src/styles_outreach-pro.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import "partials/outreach-pro-maroon";
@import "partials/outreach-pro-extension-unit";
@import "partials/shared";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agrilife-genesis",
"version": "1.0.0",
"version": "1.0.1",
"description": "Extended functionality for Genesis child themes provided by AgriLife Communications",
"main": "agrilife-genesis.php",
"repository": "https://github.com/agrilife/agrilife-genesis",
Expand Down

0 comments on commit 3413e46

Please sign in to comment.