Skip to content

Instantly share code, notes, and snippets.

@thekendog
thekendog / gist:28fd8a2be900878eedfe4876bc68cea9
Last active November 15, 2024 14:01
Remove unviewable post types from Blocksy customizer
/**
* Remove unviewable post types from customizer
*/
add_filter(
'blocksy:custom_post_types:supported_list',
function ( $post_types ) {
foreach ( $post_types as $key => $post_type ) {
if ( ! is_post_type_viewable( $post_type ) ) {
unset( $post_types[ $key ] );
}
@thekendog
thekendog / gist:7e6b6d9591e2844437d6b2677db78729
Created September 3, 2024 19:44
Set the default meta description in SEOPress if a post/page is built with Bricks
/*
* Set the default meta description in SEOPress if a post/page is built with Bricks
*/
add_filter('seopress_titles_desc', 'seopress_set_bricks_default_description');
function seopress_set_bricks_default_description($description)
{
if (!empty(trim($description))) {
return $description;
}
@thekendog
thekendog / gist:9086cf4afb22480ce39326186777886e
Last active May 1, 2024 12:46
Use Kadence lightbox for Blocksy post featured image
/**
* Enqueue the Kadence lightbox styles and scripts
*/
add_action('wp_enqueue_scripts', function() {
if ( !is_plugin_active( 'kadence-blocks/kadence-blocks.php' ) ) {
return;
}
if ( is_singular('post') ) {
wp_enqueue_style('kadence-glightbox', KADENCE_BLOCKS_URL . 'includes/assets/css/kb-glightbox.min.css', array(), KADENCE_BLOCKS_VERSION);
@thekendog
thekendog / gist:69b28bd0bda0b949a909602173c2e95a
Last active September 11, 2024 15:40
Set Kadence Blocks colors to those from Blocksy theme.
/**
* Set the colors from Blocksy to match those of Kadence blocks
*/
add_filter('kadence_blocks_pattern_global_colors', function($kadence_colors) {
if ( !function_exists('blocksy_get_theme_mod') ) {
return $kadence_colors;
}
$colorPalette = (array) blocksy_get_theme_mod('colorPalette');