Grow your CSS skills. Land your dream job.

WordPress – Taxonomy -> Ob errors

  • # November 12, 2009 at 7:50 pm

    Hi,

    Im using the code blue revolution theme and tried to add code to my
    functions.php file to create custom taxonomies.

    It is showing the fields on login to admin but after a second
    Im getting a headers already sent error, and it wont pull up the page any more after saving the content. Any suggestions?

    Here is the code:

    <?php

    add_action( ‘init’, ‘create_my_taxonomies’, 0 );

    function create_my_taxonomies() {
    register_taxonomy( ‘Year’, ‘post’, array( ‘hierarchical’ => false, ‘label’ => ‘Year’, ‘query_var’ => true, ‘rewrite’ => true ) );
    register_taxonomy( ‘Make’, ‘post’, array( ‘hierarchical’ => false, ‘label’ => ‘Make’, ‘query_var’ => true, ‘rewrite’ => true ) );
    register_taxonomy( ‘Model’, ‘post’, array( ‘hierarchical’ => false, ‘label’ => ‘Model’, ‘query_var’ => true, ‘rewrite’ => true ) );

    }
    ?>

    Here is the site:
    http://autoexpertscenter.com

    Thanks,

    Paul
    paul@imperativedesign.net

    # November 15, 2009 at 6:50 am

    Your syntax for register taxonomy is wrong. It should be :

    Code:
    register_taxonomy( ‘Year’, ‘page’, array(
    ‘hierarchical’ => false,
    ‘label’ => ‘Year’,
    ‘query_var’ => ‘car-year’,
    ‘rewrite’ => array(‘slug’ => ‘car-year’)
    ));

    I used ‘car-year’ because year might get confused with the post’s publish date year.

    # November 16, 2009 at 11:00 am

    Thanks for the reply!

    This is a little off topic, but do you know what would cause the admin panel and widget area to malfunciton?
    The content is visible but you cant drag and drop anything and if you click on screen options and change them nothing
    happens, none of the options work for customizing the panels (by clicking the drop-down triangles) in the admin area either.

    Any ideas?

    Thanks again!

    Paul

    # November 16, 2009 at 11:04 am

    Sounds like some sort of Javascript problem. Ensure JS is enabled and you have debugging turned off.

    # November 16, 2009 at 11:15 am

    Hey Dave,

    It is. I have everything turned on and no debugging is on.

    Do you think I could dl a fresh copy of WP and just replace my old JS folder with a new one? Or would that screw something up?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".