Skip to content

Instantly share code, notes, and snippets.

Jack Fearing jackfearing

Block or report user

Report or block jackfearing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Global query for custom fields
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'Your-Custom-Field', true);
wp_reset_query();
View CSS
.arrow-up {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid black;
}
.arrow-down {
View IE10-11 Flex + min-height fix.js
// https://gist.github.com/jpdery/40ae985c43b2168b7869f70ca0e5aab3
// IE 11 Min Height Flex Fix
if (window.navigator.userAgent.indexOf('Trident/7.0') > 0 ||
window.navigator.userAgent.indexOf('Trident/6.0') > 0) (function($) {
$('*:not(.no-ie-flex-fix').each(function(i, element) {
element = $(element)
var timeout = null
View htaccess (WordPress).txt
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
View ACF (Email Address Encoder - Plugin ).php
//Add to functions.php
//https://wordpress.org/plugins/email-address-encoder/
//*****************************************************************************
// Email Address Encoder - ACF fields
//*****************************************************************************
//You cannot use Firebug, Web Inspector or Dragonfly, because they decode decimal/hexadecimal entities into plain text. To make sure email addresses are encoded, right-/secondary-click the page, click “View Source”, “View Page Source” or “Source” and search for any plain text email addresses. In Firefox, be sure to test with “View Source” not “View Selection Source”.
add_filter('acf/load_value', 'eae_encode_emails');
@jackfearing
jackfearing / htaccess (WordPress)
Last active Jan 12, 2018
htaccess (WordPress) #Apache
View htaccess (WordPress)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@jackfearing
jackfearing / ACF Pro - Basic Custom Field
Last active Jan 14, 2018
ACF Pro - Basic Custom Field
View ACF Pro - Basic Custom Field
<?php if(get_field('new_acf_text_area')){
echo '<div>'. get_field('new_acf_text_area') .'</div>';
}
?>
You can’t perform that action at this time.