WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] associate page with category (4 posts)

  1. Alvaro
    Member
    Posted 3 years ago #

    hello
    i need to associate pages with category the way post are associated with category so that i can show pages in a prop down menu when someone hover over the category name.

    thanks in advance

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    You can enable categories for pages using..

    add_action( 'init', 'enable_category_taxonomy_for_pages', 500 );
    
    function enable_category_taxonomy_for_pages() {
        register_taxonomy_for_object_type('category','page');
    }

    Code can be placed in the theme's functions.php file.

  3. Alvaro
    Member
    Posted 3 years ago #

    thanks mark
    thats works like a charm

  4. fredoberg
    Member
    Posted 2 years ago #

    Great tip! This should be on by default

Topic Closed

This topic has been closed to new replies.

About this Topic