WordPress.org

Ready to get started?Download WordPress

Forums

How to create a category for a page? (11 posts)

  1. guruJosh
    Member
    Posted 4 years ago #

    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

  2. henkholland
    Member
    Posted 4 years ago #

    Pages can have children and as far as I know only Posts can have Categories.
    What is the problem that lead to your question?

  3. guruJosh
    Member
    Posted 4 years ago #

    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

  4. MichaelH
    Member
    Posted 4 years ago #

    Could use this plugin to assign categories to pages.

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

  5. don vitori
    Member
    Posted 3 years ago #

    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,

  6. MichaelH
    Member
    Posted 3 years ago #

    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.

  7. don vitori
    Member
    Posted 3 years ago #

    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.

  8. Mark / t31os
    Moderator
    Posted 3 years ago #

    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.

  9. don vitori
    Member
    Posted 3 years ago #

    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,

  10. Mark / t31os
    Moderator
    Posted 3 years ago #

    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?

  11. don vitori
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic