custom user role wordpress – grant guest access to edit.php without insert/update/delete

After you’ve created the new role, you need to add the capability to it using add_cap. Check here for more info: https://codex.wordpress.org/Function_Reference/add_cap I think that for your particular case, you could replicate an Author but then remove certain capabilities using remove_cap https://codex.wordpress.org/Function_Reference/remove_cap

How to add a do_action on refreshing of WP customizer?

Got the solution: Create a PHP file “purge-bb-cache.php” Create a JS script like below in functions.php purge-bb-cache.php <?php FLBuilderModel::delete_asset_cache_for_all_posts(); ?> JS script: // Add JS to customizer function print_customizer_js() { ?> <script> // Purge BB Cache On Save Customizer jQuery(document).ready(function(){ jQuery(“input#save”).click(function(){ //var ajaxurl = “<?php echo ( get_stylesheet_directory() . ‘/wp-content/themes/bb-theme-child/script.php’ ); ?>”; jQuery.ajax({ type: ‘POST’, … Read more

get_template_part based upon post’s category

It looks like the single quotes are giving you problems. Replace: get_template_part( ‘templates’, ‘$childcat->slug’ ); with: get_template_part( ‘templates’, $childcat->slug ); Note that double quoted strings in PHP can parse variables, not single quotes. Also check out the curly syntax in the PHP docs in the variable parsing section.