WordPress.org

Support

Support » How-To and Troubleshooting » How to create a category for a page?

How to create a category for a page?

  • Hi. Just wanted to know if there is a way that I can create a category for a page? Are there any plug ins etc that can do this or is there a way that I can edit some code to achieve this.

    Hope someone can help.

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Pages can have children and as far as I know only Posts can have Categories.
    What is the problem that lead to your question?

    Just wanted to see if I could categories pages for SEO reasons. Am using parent / children for pages but wanted now if you can categorise pages

    Could use this plugin to assign categories to pages.

    http://wordpress.org/extend/plugins/page2cat/

    hey moderator,
    so can this plugin do this for me: I want to make 3 catagories: men women and children and every catagorie would have 10 pages so catagorie men would have 10 pages about men related things etc…
    So is that possible with that plugin please?
    best,

    I’d think so.

    In the 3.0 version you could also use Function_Reference/register_taxonomy to make the ‘category’ taxonomy available for Pages.

    woow ok i should say i’m relativly new to this so i read the info in the article but i’m sorry to say that’s chinese to me :). would you care to explain a little bit what exactly it does?
    Thanks in advance and thanks for helping me.

    Or alternatively register a custom post type and register category support.

    See the commented line in the example..

    function register_my_posttype() {
    	register_post_type( 'book', array(
    		'labels' => array(
    			'name' => 'Books',
    			'singular_name' => 'Book',
    			'add_new' => 'Add New',
    			'add_new_item' => 'Add New Book',
    			'edit_item' => 'Edit book',
    			'edit' => 'Edit',
    			'new_item' => 'New Book',
    			'view_item' => 'View Book',
    			'search_items' => 'Search Books',
    			'not_found' => 'No books found',
    			'not_found_in_trash' => 'No books found in Trash',
    			'view' => 'View Book'
    		),
    		'public' => true,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'rewrite' => true,
    		'query_var' => true,
    		'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields', 'comments' )//,
    		//'taxonomies' => array('category','post_tag')
    	) );
    }
    add_action( 'init', 'register_my_posttype', 0 );

    Of course, i’m not suggesting using books, simply given as an example of how to register a custom post type and enable default taxonomies under that post type.

    Oh ok, and where do i put this code please?
    Also may i ask a not related question, every time i edit a page that i have put a picture in the text i put under the picture always returns to next to the picture, what can i do about that, i have put <p><p><p> in the html code but every time i hit publish it deletes this and the text is right back next to the picture instead of under it.
    Please advice?
    Thanks in advance mod,
    Best,

    functions.php of your theme or into a plugin, whichever you prefer..

    If you want to use it as a plugin then add the following above the code and save as a php file (upload/activate, etc..)..

    <?php
    /*
    Plugin Name: SomeName
    */

    Regarding the image problem, is a link to a page with the problem possible?

    ok thanks, and yes there are links to other sites, why? Is that the problem? how can i fix that please?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to create a category for a page?’ is closed to new replies.