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
function b16_maybe_hide_title($post) { | |
$hidetitle = get_post_meta( $post->ID, 'disable-title', true ); | |
$hide = ( !empty($hidetitle) ) ? $hide = 'style="display:none;visibility:hidden" aria-hidden="true"' : ''; | |
return $hide; | |
} |
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 | |
// Place in functions.php of Twenty Sixteen to see editor background take on color of customizer background. | |
/** | |
* Build editor stylesheet from customizer settings upon customizer save. | |
*/ | |
function kwh_build_stylesheet() { | |
$upload_dir = wp_upload_dir(); | |
$stylesheet = $upload_dir['basedir'] . '/kwh-editor-style.css'; | |
$styles = ''; |
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 | |
/* | |
* Dynamic Editor Styles | |
* | |
* Add this file to your theme with the add_editor_style() function | |
* The header and Path information will force the file to be treated like a CSS stylesheet | |
* More info on this here: https://css-tricks.com/css-variables-with-php/ | |
*/ | |
header("Content-type: text/css; charset: UTF-8"); | |
header('Cache-control: must-revalidate'); |
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( 'caldera_forms_autopopulate_options_post_value_field', 'givewp_customer_addon_purchases', 24, 2 ); | |
function givewp_customer_addon_purchases() | |
{ | |
$current_user = wp_get_current_user(); | |
$purchases = edd_get_users_purchases($current_user->user_email, 100, false, 'any'); | |
if ( $purchases ) { | |
foreach ($purchases as $purchase) { | |
$licenses = edd_software_licensing()->get_licenses_of_purchase( $purchase->ID ); |
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 | |
add_action( 'wp_enqueue_scripts', 'debug_theme_enqueue_styles' ); | |
function debug_theme_enqueue_styles() { | |
if (WP_DEBUG == true) : | |
$random = mt_rand(); | |
wp_enqueue_style( 'main-css-unminified', get_template_directory_uri() . '/assets/styles/build/main.css', '', $random ); | |
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
/* | |
* debouncedresize: special jQuery event that happens once after a window resize | |
* | |
* latest version and complete README available on Github: | |
* https://github.com/louisremi/jquery-smartresize | |
* | |
* Copyright 2012 @louis_remi | |
* Licensed under the MIT license. | |
* | |
* This saved you an hour of work? |
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 | |
/* | |
* Dependent Plugin Activation/Deactivation | |
* | |
* Sources: | |
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/ | |
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/ | |
* | |
*/ | |
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
div[class*="give-form-wrap"] { | |
text-align: center; | |
} | |
.give-total-wrap, | |
#give-final-total-wrap { | |
display: inline-block; | |
margin: 0 auto; | |
} |
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 | |
/* | |
* Add "Formats" dropdown to TinyMCE Editor | |
*/ | |
function matt2015_mce_formats($buttons) { | |
array_unshift($buttons, 'styleselect'); | |
return $buttons; | |
} | |
add_filter('mce_buttons_2', 'matt2015_mce_formats'); |
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 | |
/* | |
* This asks first for a Yoast SEO meta description, | |
* If that's not present, then it asks for the excerpt of the post, | |
* If that's not present, then it strips the content | |
* In this case, I have an excerpt length setting in the Customizer | |
* Both the excerpt and content stripping, also strip shortcodes | |
* @author Matt Cromwell <[email protected]> | |
* @copyright Copyright (c) 2014, Matt Cromwell | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |