This file contains 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
//Disable all default block types and allow custom blocks | |
add_filter( 'allowed_block_types', 'show_only_custom_blocks' ); | |
function show_only_custom_blockss( $allowed_blocks ) { | |
return array( | |
'custom-block-category/text', | |
); | |
} |
This file contains 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_action('admin_head', 'admin_css'); | |
function admin_css() { | |
echo '<style> | |
.acf-gallery .acf-gallery-side-data textarea { | |
display: none; | |
} | |
</style>'; | |
} |
This file contains 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
/* Convert hexdec color string to rgb(a) string */ | |
function hex2rgba($color, $opacity = false) { | |
$default = 'rgb(0,0,0)'; | |
//Return default if no color provided | |
if(empty($color)) | |
return $default; | |
//Sanitize $color if "#" is provided |
This file contains 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
// with post object by id | |
$post = get_post(12); // specific post ID | |
$the_content = apply_filters('the_content', $post->post_content); | |
if ( !empty($the_content) ) { | |
echo $the_content; | |
} |
This file contains 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 | |
// Remove Unnecessary Code from wp_head | |
remove_action('wp_head', 'rsd_link'); | |
remove_action('wp_head', 'wlwmanifest_link'); | |
remove_action('wp_head', 'wp_generator'); | |
remove_action( 'wp_head', 'wp_shortlink_wp_head'); | |
remove_action('wp_head', 'start_post_rel_link'); | |
remove_action('wp_head', 'index_rel_link'); | |
remove_action('wp_head', 'adjacent_posts_rel_link'); |
This file contains 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 custom_gutenberg_category( $categories, $post ) { | |
return array_merge( | |
$categories, | |
array( | |
array( | |
'slug' => 'custom', | |
'title' => __( 'Custom', 'custom' ), | |
), | |
) | |
); |
This file contains 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
//Enable Google API key for ACF | |
function my_acf_google_init() { | |
acf_update_setting('google_api_key', 'XXXXXXXXXXXXXXXXXXX'); | |
} | |
add_action('acf/init', 'my_acf_google_init'); |
This file contains 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
@-moz-keyframes bounce { | |
0%, 20%, 50%, 80%, 100% { | |
-moz-transform: translateY(0); | |
transform: translateY(0); | |
} | |
40% { | |
-moz-transform: translateY(-10px); | |
transform: translateY(-10px); | |
} | |
60% { |
This file contains 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 add_file_types_to_uploads($file_types){ | |
$new_filetypes = array(); | |
$new_filetypes['svg'] = 'image/svg+xml'; | |
$file_types = array_merge($file_types, $new_filetypes ); | |
return $file_types; | |
} | |
add_action('upload_mimes', 'add_file_types_to_uploads'); |
OlderNewer