This file contains hidden or 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 | |
/* | |
WordPress Template Hierarchy (as of WordPress 4.9) | |
is_404() -------------------------------------------------------------------------------------------------> 404.php | |
is_search() ----------------------------------------------------------------------------------------------> search.php | |
is_front_page() ------------------------------------------------------------------------------------------> front-page.php | |
is_home() ------------------------------------------------------------------------------------------------> home.php |
This file contains hidden or 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 | |
/* Pull apart OEmbed video link to get thumbnails out*/ | |
function get_video_thumbnail_uri( $video_uri ) { | |
$thumbnail_uri = ''; | |
// determine the type of video and the video id | |
$video = parse_video_uri( $video_uri ); | |
// get youtube thumbnail |
This file contains hidden or 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: Create Post | |
* | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/front-end-posting-with-acf-pro/ | |
* @uses Advanced Custom Fields Pro | |
*/ | |
/** |
This file contains hidden or 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
// ACF field added to body class | |
// Adapted from http://krogsgard.com/2012/wordpress-body-class-post-meta/ | |
add_filter('body_class','tend_custom_field_body_class'); | |
function tend_custom_field_body_class( $classes ) { | |
global $wp_query; | |
$postid = $wp_query->post->ID; | |
if ( is_page_template('template-service-index.php') ) { |
This file contains hidden or 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
/********************************** | |
* | |
* Move WooCommerce Price on Single Product Page | |
* | |
* @author AlphaBlossom / Tony Eppright | |
* @link http://www.alphablossom.com | |
* | |
* Reference hook locations using woocommerce_single_product_summary hook | |
* | |
* @hooked woocommerce_template_single_title – 5 |
This file contains hidden or 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
// populate acf field (sample_field) with post types (sample_post_type) | |
function acf_load_sample_field( $field ) { | |
$field['choices'] = get_post_type_values( 'sample_post_type' ); | |
return $field; | |
} | |
add_filter( 'acf/load_field/name=sample_field', 'acf_load_sample_field' ); | |
function get_post_type_values( $post_type ) { | |
$values = array(); |
This file contains hidden or 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
add_filter('wp_mail_from', 'kmow_mail_from_address'); | |
function kmow_mail_from_address($email){ | |
return '[email protected]'; | |
} | |
add_filter('wp_mail_from_name', 'kmow_mail_from_name'); | |
function kmow_mail_from_name($from_name){ | |
return "KMOW Web Site"; | |
} |
This file contains hidden or 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 | |
/******************************************************************************************** | |
Example for customizing the WordPress login screen using your theme's functions.php file. | |
For @halo-diehard on wordpress.org forum: | |
https://wordpress.org/support/topic/codex-unclear-regarding-custom-login-page/ | |
Relevant CODEX doc: | |
https://codex.wordpress.org/Customizing_the_Login_Form | |
*******************************************************************************************/ |
This file contains hidden or 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 | |
// ACF upload prefilter | |
function gist_acf_upload_dir_prefilter($errors, $file, $field) { | |
// Only allow editors and admins, change capability as you see fit | |
if( !current_user_can('edit_pages') ) { | |
$errors[] = 'Only Editors and Administrators may upload attachments'; | |
} | |
// This filter changes directory just for item being uploaded |