Adding tags to pages in WordPress used to be a simple copy and paste job.
Update : This newer solution also prints your page tags on single pages and adds the single pages to your tag archives.
All you needed to do was paste this code in your child themes functions file.
However, the code only adds the input meta box for post tags and does not display the tag links on single pages or add single pages to tag archive pages.
The code will display a meta box for tags on all Edit Page screens.
The code uses the register_taxonomy_for_object_type function.
Here’s the official description from the WordPress Codex:
This function adds an already registered Taxonomies to an already registered Post Types. It takes in a name, an object name that it affects. It returns true on success.
In this case the taxonomy already registered is post_tag
The Post Type already registered is page
Why Add Tags To Pages
The reason i wrote this post is because someone wanted to display the featured images & links to specific pages in a slider which uses tags to determine the content which is pulled into the slider.
Once post tags are added to pages, you can then group together the pages and posts you want displayed in your slider.
Leave a Reply
You must be logged in to post a comment.