SKT-Magazine Pro – Keywords/Tags on Pages

Home Forums All Other Themes SKT-Magazine Pro – Keywords/Tags on Pages

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #81557
    Sascha HettelSascha Hettel
    Member
    • Topics: 2
    • Replies: 0
    • Total: 2
    Member since: June 8, 2017

    Hello, i have buy the SKT-Magazine Pro and one Question. How i can use Keywords/Tags on a static Page? With a Plugin or with a code in functions.php?

    I have found this Code in an other Forum. Can i use this Code in function.php?

    
    // 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');
    
    #81577
    Sonnal S SinhaSonnal S Sinha
    Moderator
    • Topics: 0
    • Replies: 30649
    • Total: 30649
    Member since: August 16, 2013

    Hi,

    Yes, you can use it in functions.php file.

    Regards,
    Brad

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.