Custom post type name and assigning custom taxonomy

I’ve checked another option and asigned my custom taxonomy to custom post type using its name but without capitals and space. ‘postname’ works with original ‘Post Name’ So for custom post type register_post_type( ‘Post Name’, $args ); I can use register_taxonomy( ‘custom taxonomy’, array( ‘postname’ ), $args ); And it works.

Dynamic redirect

Already solved using this code inside functions.php: add_action(‘template_redirect’, function() { if (is_single() && get_post_type(get_queried_object_id()) == ‘sorteio’) wp_redirect(‘edicao/?id=’ . get_queried_object_id()); });

How to add a second content section when using certain page template

You could add a metabox for your second content section, then hide it with a bit of javascript if the current template isn’t a specific template: current_template = jQuery(‘#page_template’).val(); if( current_template != ‘my-special-template.php’ ){ jQuery(‘#_your_meta_box_id’).hide(); } then bind a function to the change event of the template dropdown and show it when a specific template … Read more