Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've just installed Forca Theme on my fresh WP installation.

They add a few custom taxonomies like:

1 Events Categories - Just categories for Events

2 Events - Same as regular Post, with custom behaviour and template, have assigned Events Categories to it

3 Events Page - Lists ALL Events, no possibility to display from particular Events Category because the Event Page is not associated with ANY Category, it's the Events (Items) themselves that are assigned to categories.

So what I want to do is to add the same Category assignment box from Events to Events Page screen which looks like this:

enter image description here

And is assigned like this:

register_taxonomy("events-cat", 
                        array("Events Categories"), 
                        array(  "hierarchical" => true, 
                                "label" => "Events Categories", 
                                "singular_label" => "Events Categories", 
                                "rewrite" => true,
                                "query_var" => true
                            ));

register_post_type( 'events-item',
    array( 'labels' => $labels,
         'public' => true,  
         'show_ui' => true,  
         'capability_type' => 'post',  
         'hierarchical' => false,  
         'taxonomies' => array('events-cat'),
         'supports' => array('title', 'editor', 'thumbnail', 'comments', 'custom-fields', 'page-attributes') ) );

In /includes/register.php so I tried to add a new taxonomy registration to POST screen according to documentation I've found:

register_taxonomy("post-events-cat",
    array('post'),
    array(  "hierarchical" => true,
        "label" => "Post Events Categories",
        "singular_label" => "Post Events Categories",
        "rewrite" => true,
        "query_var" => true
));

But well, it didn't work.

So I wonder how I can tweak particular screen in Wordpress? Not even really related to the Theme itself.

Thanks

share|improve this question
    
Even if you get that box added, how do you expect it to work? It is doubtful that the page templates will adjust to the change automatically. –  s_ha_dum Jan 14 at 14:39
    
That would be a good start for me. –  Fratyr Jan 14 at 14:42

1 Answer 1

up vote 1 down vote accepted

It sounds like you want register_taxonomy_for_object_type to add the taxonomy to the "Page" post type.

register_taxonomy_for_object_type('events-cat','page');

As noted, I don't know how you expect this to work. You are going to have to alter the page templates.

I would also suggest that you look into the Template Hierarchy, in particular the part about custom taxonomies. It sounds like you may be reinventing Core functionality.

share|improve this answer
    
Of course I will tweak page templates and hook into some of the parts of my interest, my only bottleneck was adding new UI/taxonomy? to existing default Page/Post screens. –  Fratyr Jan 14 at 14:53
    
@Fratyr : I told you how to do that in the first sentence. –  s_ha_dum Jan 14 at 15:05
    
It worked. All is good now ;) –  Fratyr Jan 14 at 16:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.