Skip to content

Instantly share code, notes, and snippets.

@jackfearing
jackfearing / ACF Pro - Basic Custom Field
Last active February 20, 2020 00:50
ACF Pro - Basic Custom Field
<?php if(get_field('new_acf_text_area')){
echo '<div>'. get_field('new_acf_text_area') .'</div>';
}
?>
@jackfearing
jackfearing / htaccess (WordPress)
Last active January 12, 2018 01:42
htaccess (WordPress) #Apache
# 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>
//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');
# 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>
// 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
.arrow-up {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid black;
}
.arrow-down {
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'Your-Custom-Field', true);
wp_reset_query();
//********************************************************************************
// Change text size of Gutenberg editor
// https://studiopress.blog/block-font-sizes/
//********************************************************************************
// Adds support for editor font sizes.
// Do NOT include the opening php tag.
add_theme_support( 'editor-font-sizes', array(
array(
<?php
/**
* Block template file: template-parts/blocks/sidebar/sidebar-headline.php
*
* Sidebar Headline Block Template.
*
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.