Thank you but that did not work if you take a look at the site http://networkingeventstraining.com/networkingevents there is a coding at the top of the pages now.
I took off the added coding from the above url because it was showing in the header and I didn’t want my clients site to be hacked but this is what was in the top of the header, and whenever you go to click on the events it made other coding appear:
function my_em_posttype_fix(){ register_taxonomy_for_object_type(‘category’,EM_POST_TYPE_EVENT); register_taxonomy_for_object_type(‘category’,EM_POST_TYPE_LOCATION); } add_action(‘init’,’my_em_posttype_fix’,100); function my_em_posttype_cat_default($EM_Object){ global $post; if( $post->post_type == EM_POST_TYPE_EVENT || $post->post_type == EM_POST_TYPE_LOCATION ){ $categories = get_the_category(); if( count($categories) == 0 ){ //assign a category to this wp_set_object_terms($post->ID, ‘general’,’category’); } } } add_action(‘template_redirect’,’my_em_posttype_cat_default’, 1,1);
did you paste the code snippet in your theme functions.php?
yes I did 🙂 I am using the Panda Theme Portofolio I don’t know if that theme it will not work?
make sure it’s within the
<?php
….
?>
tags
DURR thanks Marcus that worked! Yesterday I guess I didn’t have my thinking cap on….I had put it after the ?> yesterday, today I did it before that section and it worked!
Ok I did the above and it was working now when you go to click on an event in the calendar you get this: (with the new ones just added) Catchable fatal error: Object of class WP_Error could not be converted to string in /home/mishelle/public_html/networkingeventstraining.com/networkingevents/wp-content/themes/polafolio/admin/includes/breadcrumbs.php on line 206
Yet in the calendar when you click on the testing ones and one I created it works and takes you to the event pages. The above also happens when you click on the events category with the actual links to the new pages that were set up using the main form on the site (http://networkingeventstraining.com/networkingevents/events/categories/general/)
What am I doing wrong that this is not working?
Thanks.
still the same issue above, chances are it’s to do with the fact that those other events don’t have any categories