0

I'd like users to be able to assign a category to a page by selecting from the page dashboard. So when they create a new page they can select the post category they want to be linked and display on that page.

Is this possible?

0

add this code into functions.php and a taxonomy box will be created for page from where user can make categories for page.

<?php
add_action( 'init', 'create_book_tax' );

function create_book_tax() {
    register_taxonomy(
        'genre',
        'page',
        array(
            'label' => __( 'Genre' ),
            'rewrite' => array( 'slug' => 'genre' ),
            'hierarchical' => true,
        )
    );
}
?>
  • What I meant was to choose an existing category from the posts section on the page that you want to assign the posts category too. – user3507500 Feb 21 '18 at 17:21
  • for that you just has to change genre term with category. and that's it. – Zaheer Abbas Feb 22 '18 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.