I have generated pages using a custom template by creating a php file in my theme directory something like :
<?php * * Template Name: Contact Page */ ?> <html ..... </html>
and then adding a new page on the dashboard selecting this new template
How can i now associate tags and categories to each pages ? Is creating posts instead of pages the only solution?
To add a category, head over Pages » Categories from your WordPress dashboard and then enter a 'Name' and 'Slug' for your category. After that, you can scroll down and select a 'Parent Category' for your category. Once you've entered these details, simply click the 'Add New Category' button.
Even better is to add to functions.php in your theme folder:
function myplugin_settings() { // Add tag metabox to page register_taxonomy_for_object_type('post_tag', 'page'); // Add category metabox to page register_taxonomy_for_object_type('category', 'page'); } // Add to the admin_init hook of your theme functions.php file add_action( 'init', 'myplugin_settings' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With