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
// ******************************* | |
// Future-Proof content by saving ACF content to post_content | |
// ------------------------------- | |
function save_acf_rich_text_to_post_content( $post_id ) { | |
if ( get_post_type( $post_id ) == ( 'post' || 'page' ) ) { | |
// Get ACF flex content | |
if( have_rows('content_blocks') ) { | |
$post_content = ''; |
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
// Min / Max http://www.sassmeister.com/gist/7f22e44ace49b5124eec | |
@mixin minmax( | |
$size-min, | |
$size-max, | |
$properties: font-size, | |
$vw-min: 320px, | |
$vw-max: 1280px | |
) { | |
@if( | |
unitless($size-min) or |
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
// ******************************* | |
// Blocks Availability | |
// ------------------------------- | |
add_filter( 'allowed_block_types', 'uwd_allowed_block_types', 10, 2 ); | |
function uwd_allowed_block_types( $allowed_blocks, $post ) { | |
$allowed_blocks = array( | |
// ACF Blocks | |
'acf/accordion', | |
'acf/archive-cards', |
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
// ******************************* | |
// Rename "Posts" to "News" | |
function change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'News'; | |
$submenu['edit.php'][5][0] = 'All Articles'; | |
echo ''; | |
} | |
function change_post_object_label() { |
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
/* Override Gutenbergs asymeteical column margins with the negative margin trick */ | |
.wp-block-columns { | |
margin: 0 -20px; | |
} | |
.wp-block-columns .wp-block-column { | |
margin: 0 0 20px 0; | |
padding: 0 20px; | |
} |
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 | |
// ******************************* | |
// Get ACF block fields outside block templates | |
// ------------------------------- | |
function get_block_field( $field_id, $post_id = '' ) { | |
// Get current post ID if post_id arg isn't passed | |
$post_id = $post_id ? $post_id : get_the_ID(); |
NewerOlder