Hi Christoph,
Thanks for your swift reply and looking into you question I found that my answer still wasn’t complete enough. It fixes the messages archive, but not the pages of each individual message.
Adding layout to the archive doesn’t seem to work, since it isn’t offered as a page that I can edit using the wp-editor, but it can be added to each individual message. However it is something like a comment and normal comentors will probabky not be able or might wanto change the layout on a message by message basis, so in the end I wouldn’t offer that functionality.
The complete list of post_types that are registered by Sensei contains:
- course
- lesson
- quiz
- question
- multiple_question
- sensei_message
- certificate
I wasn’t able to fiqure out what the multiple_question CPT contains or what it’s used for, and certificates are only presented as a template in the editor and as a generated pdf with the date of the students in it. So for certificate doing something doesn’t seem to change anything either way, but I probably would add all cpt’s to the list to be sure. Adding layout_support doesn’t seem to hurt in any case (at least when i tried, nothing seem to break), so adding it to all also secures that it isn’t omitted anywhere, but for certificate and sensei_message it seems to make the least sense.
The taxonomy added by sensei contains:
- module
- course-category
- quiz-type
- question-type
- question-category
- lesson-tag
I don’t know what needs to change for them, but at least the course-category archive also pushes the sidebar below the content, so probably the taxonomy pages should also be forced to display content-sidebar (although module, quiz-type, question-type and guestion-category are probably not presented as a user-accessable archive on the frontend, making course-category and lesson-tag probably the only relevant ones.
So in the end, I just changed the previous function to:
function gcfws_force_content_sidebar_layout_on_cpt_posts() {
if ( ! is_singular( array( 'course', 'lesson', 'question', 'quiz', 'sensei_message', 'certificate', 'multiple_question' ) )
&& ! is_post_type_archive('sensei_message') ) {
return;
}
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
}
and it wouldn’t hurt to expand the next function too:
function gcfws_add_genesis_layout_to_sensei_cpts() {
add_post_type_support( 'course', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
add_post_type_support( 'lesson', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
add_post_type_support( 'question', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
add_post_type_support( 'quiz', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
// probably never used
add_post_type_support( 'sensei_message', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
// probably not needed:
add_post_type_support( 'certificate', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
add_post_type_support( 'multiple_question', array( 'genesis-layouts', 'genesis-cpt-archives-settings' ) );
}
and after that I hope you know how to set the display for the taxonomy pages.
Hope this helps…
Thanks,
Hans