Home › Forums › Chit Chat › WPLMS customizations › Course type taxonomy
- This topic has 19 replies, 6 voices, and was last updated 6 years, 8 months ago by Tejas.
-
AuthorPosts
-
February 13, 2016 at 10:51 pm #28392ulysseswSpectatorHi, I would like to know what is the Taxonomy Slug and Taxonomy Term Name, that i can enter into the post grid settings. I want to show a block of online courses, and also a separate block of offline courses. I tried the following but it didn't work. Taxonomy Slug: course-type Taxonomy Term Name: online-course-type Regards.February 15, 2016 at 2:17 pm #28764Anshuman SahuKeymasterWell you can create a category for this . You can add teh offline courses to offline category and online to online category . Then you have to put :
Taxonomy Slug: course-cat
Taxonomy Term Name: offline Fo offline courses and same for teh online except the Taxonomy Term Name: online
February 15, 2016 at 3:08 pm #28793ulysseswSpectatorHi Alex, This is technically possible, but not feasible as a solution. This is because for most of us, the Course Categories are used for topics, such as Business, Finance, Engineering etc. If we are to add in Online and Offline as course categories, it will confuse our instructors. They will need to select online/offline in course category, and select online/offline again in course type. Am i correct in the above? Regards.February 16, 2016 at 10:19 am #29016Anshuman SahuKeymasterWell you can also create a new taxonomy course type if you do not want to use the category for online and offline courses . Then use the related taxonomy slug and term in the post grid settings .February 16, 2016 at 10:49 am #29034Anshuman SahuKeymasterPlease use this code to add a custom taxonomy in courses : add_action( 'admin_menu', 'course_type_tax' ); function course_type_tax(){ register_taxonomy( 'course-type', array( 'course'), array( 'labels' => array( 'name' => __('Course Type','vibe-customtypes'), 'menu_name' => __('Type','vibe-customtypes'), 'singular_name' => __('Type','vibe-customtypes'), 'add_new_item' => __('Add New Course Type','vibe-customtypes'), 'all_items' => __('All course Types','vibe-customtypes') ), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => 'lms', 'show_admin_column' => true, 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'query_var' => 'course-type', 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'course-type' , 'hierarchical' => true, 'with_front' => false ) ) ); } Then use the taxonomy slug : course-type Term : offline/onlineFebruary 16, 2016 at 11:45 am #29053ulysseswSpectatorHi Alex, I added the code in wplms customizer. I entered the taxonomy slug as course-type. And term as offline, or online. But it doesn't show up. Its a error. Please see attached. Regards.February 16, 2016 at 11:46 am #29057ulysseswSpectatorsite: wedemic.com login: wedemicc password: tampines123???February 17, 2016 at 1:55 pm #29493Anshuman SahuKeymasterI have made a mistake in above code . Please remove the previous one and add this in place of it :add_action( 'init', 'course_type_tax' );
function course_type_tax(){
register_taxonomy( 'course-type', array( 'course'),
array(
'labels' => array(
'name' => __('Course Type','vibe-customtypes'),
'menu_name' => __('Type','vibe-customtypes'),
'singular_name' => __('Type','vibe-customtypes'),
'add_new_item' => __('Add New Course Type','vibe-customtypes'),
'all_items' => __('All course Types','vibe-customtypes')
),
'public' => true,
'hierarchical' => true,
'show_ui' => true,
'show_in_menu' => 'lms',
'show_admin_column' => true,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'query_var' => 'course-type',
'show_in_nav_menus' => true,
'rewrite' => array( 'slug' => 'course-type' ,
'hierarchical' => true,
'with_front' => false )
)
);
}
February 17, 2016 at 1:57 pm #29499Anshuman SahuKeymasterI changed the code in your site ,please check and confirm . Please do not forget to update the course after adding the course type taxonomy .February 18, 2016 at 12:27 pm #29911ulysseswSpectatorHi Alex, I saw the code you input in the wplms customiser, thanks. Its still showing an error. Please see attached. I used taxonomy slug as course-type, and online or offline for the term. Regards.February 19, 2016 at 2:50 pm #30315H.K. LatiyanParticipantPlease check the error message. It says the Term in the taxonomy does not exist. Which means if you've created a taxonomy course-type and a term "Type1", however the settings are "type2" and "course-type" and the error message says, your taxonomy - term combination should be "Type1" - "course-type". Hope this explains. p.s : You can try this plugin for easy creation of custom taxonomies : https://wordpress.org/plugins/mb-custom-taxonomy/ p.s : It would be great if you can hire freelancer for customisations, because customisations are not a part of theme support and slow down the support process.February 19, 2016 at 3:22 pm #30337ulysseswSpectatorHi Latiyan, Thanks for the feedback. I will consider to use a freelancer for such customisations. As for this issue, Alex provided a code, and said the taxonomy slug is course-type, and the term is offline or online. So the code is added to wplms customiser, and the taxonomy slug and term is also entered into the grid settings, please see attached screenshot. Im not sure which is the part that i did not follow correctly. Regards.February 22, 2016 at 9:57 am #30898ulysseswSpectatorHi, Any updates on this? Regards.February 23, 2016 at 8:52 pm #31427[email protected]SpectatorI had the same problem a while back while working on a client's site, I feel like it should be easier than creting a new taxonomy but since I didn't get any replies from Vibe Team, I decided to go with a custom taxonomy. Just scroll down the page to see a working version, for free courses (gratuitos) and recommended (recomendados): http://beta.kursaronline.com.br/ And also the archive: http://beta.kursaronline.com.br/cursos/gratuitos/ I haven't tested Alex' code, but it's a fairly basic implementation and it should work. 1 - Make sure your text editor is not messing up the code (special attention to single quotes). 2 - Make sure you have,in fact, created the custom taxonomy. Also the wordpress codex is a great resource to get started: https://codex.wordpress.org/Function_Reference/register_taxonomy I hope it helps youFebruary 24, 2016 at 2:31 am #31459ulysseswSpectatorHi urdek, Thanks for the message and info. Im not sure what is the issue im facing, im following exactly what admin has provided. First, i input the code into wplms customiser. The code is 'copied and paste' from what Alex given here. Please see below. And in the post grid settings, i chose courses for the custom post type, and use course-type as the taxonomy slug, and online for the taxonomy term. Please see screen shot 1. These are followed exactly how Alex described. And the result i got, is a Taxonomy mismatch. Screenshot 2. Latiyan said the term i have created, and entered, are different, thus the error. But where is the error? add_action( 'init', 'course_type_tax' ); function course_type_tax(){ register_taxonomy( 'course-type', array( 'course'), array( 'labels' => array( 'name' => __('Course Type','vibe-customtypes'), 'menu_name' => __('Type','vibe-customtypes'), 'singular_name' => __('Type','vibe-customtypes'), 'add_new_item' => __('Add New Course Type','vibe-customtypes'), 'all_items' => __('All course Types','vibe-customtypes') ), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => 'lms', 'show_admin_column' => true, 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'query_var' => 'course-type', 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'course-type' , 'hierarchical' => true, 'with_front' => false ) ) ); } -
AuthorPosts
- The topic ‘Course type taxonomy’ is closed to new replies.