handsomeman
Forum Replies Created
-
No problem! I think Shane had someone else submit a different way to do it also.. but I don’t see it gets much easier than just simply putting exactly what I have above.. the only thing someone might change is the slug if need be to fit there purposes. Please let me know if it works for you after you test it on yours!! I migrated all my data after the update, which was probably a mistake, but after fixing everything I probably won’t be updating anymore haha. Oh well.
Yup. so you will see and use the custom post type categories and the normal ‘post’ type categories on your sidebar. After adding this code my homepage worked correctly like before. It was such a pain to to figure out how to implement my homepage to pull in the new custom post type categories. Here is all the code I have added to my functions.php to get everything working properly with the original categories and also keeping the new ones too from the events plugin.
[Code moderated as per the Forum Rules. Please use the pastebin]
So you can work with both list of categories. The word ‘event’ is used to maintain the domain.com/event because if you don’t have the slug your using… it will revert it to domain.com/tribe_events giving you 404s on all your homepage links or where ever. I just switched out the words demo starting at the word ‘name’ and worked down to ‘not found in trash’ and replaced it with the appropriate “event” or “events” so it made sense in your dashboard menu/sidebar.
I added it directly below the following line, which is first in your functions.php
<?php wp_enqueue_script(‘jquery’);
So essentially you will see original categories and custom post type categories when creating a new event. (this might be restated, sorry ha)
success! Flawless.. just change out the demo and replace event with the slug your using
add_action(‘init’, ‘demo_register_post_type’);
function demo_register_post_type() {
register_post_type(‘tribe_events’, array( ‘rewrite’ => array(‘slug’ => ‘event’, ‘with_front’ => false),
‘labels’ => array(
‘name’ => ‘Demos’,
‘singular_name’ => ‘Demo’,
‘add_new’ => ‘Add new demo’,
‘edit_item’ => ‘Edit demo’,
‘new_item’ => ‘New demo’,
‘view_item’ => ‘View demo’,
‘search_items’ => ‘Search demos’,
‘not_found’ => ‘No demos found’,
‘not_found_in_trash’ => ‘No demos found in Trash’
),
‘public’ => true,
‘supports’ => array(
‘title’,
‘excerpt’
),
‘taxonomies’ => array(‘category’, ‘post_tag’) // this is IMPORTANT
));
}Hey Shane, awesome, that is perfect!! Yea I was thinking you could slide the following in to the above code.
‘rewrite’ => array(‘slug’ => ‘event’, ‘with_front’ => false),
hmm.?! we will see.
Just need to get the permalinks to stay with domain.com/events/ instead of domain.com/tribe-events/ only issue giving all my event links 404s any help would be appreciated
Hey guys, I found a fix for this. Put it in your functions.php to get your old categories to show up and replace demos with with the words events or whatever. I got it from this link https://www.deluxeblogtips.com/2010/07/custom-post-type-with-categories-post.html
Worked great for Me!add_action(‘init’, ‘demo_register_post_type’);
function demo_register_post_type() {
register_post_type(‘tribe_events’, array(
‘labels’ => array(
‘name’ => ‘Demos’,
‘singular_name’ => ‘Demo’,
‘add_new’ => ‘Add new demo’,
‘edit_item’ => ‘Edit demo’,
‘new_item’ => ‘New demo’,
‘view_item’ => ‘View demo’,
‘search_items’ => ‘Search demos’,
‘not_found’ => ‘No demos found’,
‘not_found_in_trash’ => ‘No demos found in Trash’
),
‘public’ => true,
‘supports’ => array(
‘title’,
‘excerpt’
),
‘taxonomies’ => array(‘category’, ‘post_tag’) // this is IMPORTANT
));
}Is there some code where I can get rid of the /event/ on single event posts since the settings doesnt work.
I am interested in getting the all in one seo pack added to the post page below custom fields.. anyone have ideas