• Hello,

    I use following code to add tag on page (child function.php). It shows in admin setting, but doesn’t shows on page. Can someone correct me?

    // add tag support to pages
    function tags_support_all() {
    register_taxonomy_for_object_type(‘post_tag’, ‘page’);
    }

    // ensure all tags are included in queries
    function tags_support_query($wp_query) {
    if ($wp_query->get(‘tag’)) $wp_query->set(‘post_type’, ‘any’);
    }

    // tag hooks
    add_action(‘init’, ‘tags_support_all’);
    add_action(‘pre_get_posts’, ‘tags_support_query’);

    Please help. Thanks in advance!

  • The topic ‘Add tag on page coding’ is closed to new replies.