Gutenberg – Remove add block button

You can register a template for your CPT and lock that template so users cannot add, move, or delete blocks. There are several ways to set up the template, but since your CPT is already registered, the easiest might be: <?php add_action( ‘init’, ‘wpse_360075_register_block_template’ ); function wpse_360075_register_block_template() { // Make sure to change “yourcptslug” to … Read more

Prevent redirect to wp-login.php

I guess you don’t have code on your new login form that supports ?action=lostpassword ? Your choices are either copy the relevant code from wp-login.php to your new form; you want the retrieve_password() function. Then you can post back to /login?action=lostpassword. use your own ‘lost password’ form, but post to /wp-login.php?action=lostpassword hook the lostpassword_redirect filter … Read more

Font Awesome Icons only squares

In typography, a square appears when you ask for a character that is not included in the font. By adding the property !important to font-family:, your naviagator is obliged to use Font Awesome. Look carefully at your two screenshots. Neither of the icons is identical. Some solutions: Modify your css .fa{ font-family: ‘font-awesome’; font: normal … Read more

How to display a table below each product in product list/loop

The shop archive or in general any product-loop that passes through: woocommerce/templates/archive-product.php …or utilizes similar logic found in that template, by calling: wc_get_template_part( ‘content’, ‘product’ ); which retrieves the following template: woocommerce/templates/content-product.php …will then make available the following actions: Excerpt from: woocommerce/templates/content-product.php (version 3.6.0 at the time of this answer) /** * Hook: woocommerce_before_shop_loop_item. * … Read more

Why still output /wp-content/themes/twentynineteen?

You need to deactivate and reactivate your theme. When a theme is activated the template and stylesheet values are set in the database. If you remove Template: from the child theme’s stylesheet, the template is still set to twentynineteen in the database, so get_template_directory_uri() will return its URL. Re-activating the theme will ensure that this … Read more

Remove WP Admin Menu Items by User Role

function shapeSpace_remove_toolbar_menu() { global $wp_admin_bar; // remove menu for editor and author if( current_user_can( ‘editor’ ) || current_user_can( ‘author’ ) ){ $wp_admin_bar->remove_menu(‘site-name’); } } add_action(‘wp_before_admin_bar_render’, ‘shapeSpace_remove_toolbar_menu’, 999); All Roles: current_user_can( ‘administrator’ ) current_user_can( ‘editor’ ) current_user_can( ‘author’ ) current_user_can( ‘contributor’ ) current_user_can( ‘subscriber’ )