This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// H1 SUPPORT | |
function hg_check_for_h1_title($title, $id) | |
{ | |
if (in_the_loop() AND $id == get_the_ID()) | |
{ | |
$h1 = get_post_meta($id, 'h1', true); | |
if($h1) return $h1; | |
} | |
return $title; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: YouTube Video Widget | |
* Plugin URI: http://halgatewood.com/ | |
* Description: Awesome YouTube Widget that allows single videos or latest video from channel. Uses transient api to keep it quick. | |
* Author: Hal Gatewood | |
* Author URI: http://halgatewood.com/ | |
* Version: 1.0 | |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// EXPIRATION DATE | |
function my_pmpro_checkout_level($level) | |
{ | |
$expiration_year = date('Y'); | |
$current_month = date('n'); | |
// IF OCT, NOV, DEC, EXPIRE NEXT YEAR | |
if($current_month >= 10) { $expiration_year++; } | |
$expiration_date = $expiration_year . "-12-31"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flexslider_hg_admin_icon() | |
{ | |
echo ' | |
<style> | |
#adminmenu #menu-posts-slides div.wp-menu-image:before { content: "\f181"; } | |
</style> | |
'; | |
} | |
add_action( 'admin_head', 'flexslider_hg_admin_icon' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$video = get_field('youtube_video'); | |
echo "<h1>" . $video->title . "</h1>"; | |
echo "<p>" . $video->desc . "</p>"; | |
echo $video->embed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: HTTPS Page | |
*/ | |
if($_SERVER['HTTPS']!="on") | |
{ | |
wp_redirect( "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); | |
exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hg_change_archive_order( $query ) | |
{ | |
if($query->is_archive AND $query->query['post_type'] == "testimonial") | |
{ | |
$query->set( 'order' , 'asc' ); | |
$query->set( 'orderby' , 'title' ); | |
} | |
} | |
add_filter( 'pre_get_posts' , 'hg_change_archive_order' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testimonial_rotator_change_order( $args ) | |
{ | |
$args['order'] = "DESC"; | |
$args['orderby'] = "date"; | |
return $args; | |
} | |
// USE THIS add_filter FOR THE WIDGET | |
add_filter('testimonial_rotator_widget_testimonial_args', 'testimonial_rotator_change_order'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $_wp_admin_css_colors; | |
$color_scheme = get_user_option( 'admin_color' ); | |
$current_admin_color_theme = $_wp_admin_css_colors[ $color_scheme ]; | |
echo ' | |
<style> | |
img.icon { color: ' . $current_admin_color_theme->colors[2] . '; } | |
img.icon.selected { color: ' . $current_admin_color_theme->colors[3] . '; } | |
</style>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stdClass Object | |
( | |
[name] => Default | |
[url] => https://halgatewood.com/wp-admin/css/colors.min.css | |
[colors] => Array | |
( | |
[0] => #222, [1] => #333, [2] => #0074a2, [3] => #2ea2cc | |
) | |
[icon_colors] => Array | |
( |