Hot answers tagged

3

wp_head is an essential part of the theme, and there is too many things that might fall apart if it is not there. Hunting and fixing them one by one might be time consuming and the worthiness of the all operation questionable. In you snippet for example you want to remove things that make no sense to remove specifically only for one CPT, and if you have ...


2

Since plugins hook directly into wp_head nothing will happen if it's not there unless you change the plugin code. So, you'd have to create your own hook in the theme, then scan the Yoast files for any calls to wp_head and change them. Not recommended, though. A better course of action would be to generate these metatags yourself. They're pretty ...


1

I suggest post status transitions that runs only when your set conditions are met. Example: add_action( 'transition_post_status', 'add_awesome_terms', 10, 3 ); function add_awesome_terms( $new_status, $old_status, $post ) { // only run when it's a page, new status is publish and old status isn't publish if ( $post->post_type == 'page' ...


1

A var_dump() in save_post action doesn't display any information on the screen. Well, it does only when you are on "Add new" screen. This is due the different sequence of actions that follow when creating a new post or when editing it. When you click on "publish" or "update" button, there is a request, the post is saved, save_post action is triggered and ...



Only top voted, non community-wiki answers of a minimum length are eligible