Responsive WordPress Theme – Caliber

A theme with simple controls and limitless potential. Work fast and build an amazing website!   Find out more »

UpThemes – Beautiful WordPress Themes

Create a site your church, gallery, newspaper, blog, recipes, band and more!   See the themes »

Need a little help?  Find answers quickly by searching the forum.
Group Admins
  • andy
  • jeffw

Support for: Salutation: WordPress + BuddyPress Theme

Salutation (WordPress)

Public Group  |  active 4 years, 5 months ago ago
Viewing post 1 to 15 (21 total posts)

Adding layout options on lesson/course pages for Sensei plugin

  • wengriffin

    said

    We are using the Sensei plugin with our theme “Salutation” and I have lost the ability to edit the layout for lesson and course pages but this is a very important feature that I require.

    What the lesson creation page looks like: https://openedgepayments.com/marketing/cgc/sensei/images/lesson-screenshot.png

    What a standard post creation page looks like and what I would like to see on the lesson/course creation pages (see layout options enclosed in red circle):
    https://openedgepayments.com/marketing/cgc/sensei/images/post-screenshot.png

    How can I get the layout options in place on course/lesson pages?

  • jeffw

    said

    If the plugin is creating a custom post type for its lesson/course pages then you should see that custom post type added to the Appearance > Layouts settings page, right down the bottom under the “Custom Post Types (auto generated)” heading. This will enable you set a specific layout for that custom post type.

  • wengriffin

    said

    Hi Jeff,

    The plugin isn’t creating a custom post types otherwise your solution you mentioned would work perfectly. Can you recommend another workaround? I definitely don’t want to change the theme (I love Salutation) and I really like this plugin… If I could just get the lesson/course pages to be CPT then I’d be winning! Any help is muchly appreciated!

    Thanks!

  • wengriffin

    said

    I received this message from Woothemes (the author of the Sensei plugin)…

    “Actually, the lessons and courses already are custom post types. Likely the theme function that activates “Layout Options” needs to be modified to accept the Sensei custom post types, but I don’t know how to do this; ask the theme developer for help with this, but feel free to get them to contact me as well.”

    Can you advise on how I can register the Sensei custom post types so that I can assign a layout?

  • jeffw

    said

    There are are instructions for manually registering a template at the foot of the Appearance > Layouts settings page.

    If you search this forum for “register_context” you will find lots more help with this.

  • jeffw

    said

    If you wanted to add our Layout Options metabox to a custom post type’s create/edit admin pages, you’d need to write a function that does that.

    For example…

    function wombatCPT_add_meta_box() {
      add_meta_box(
        'layout-options',
        __( 'Layout Options', THEME_NAME ),
        'mf_ua_callback',
        'wombat',
        'side'
      );
    }
    add_action( 'add_meta_boxes', 'wombatCPT_add_meta_box' );

    The above function adds the Layout Options metabox for a custom post type named ‘wombat’.

    The function can be added to your ‘functions.php‘ file.

    For the function to work you would need to know the name of the custom post type.

    References:
    http://codex.wordpress.org/Function_Reference/add_meta_box

  • wengriffin

    said

    I am trying to follow the instructions for registering the template files and am still really struggling and could use some help beyond searching the forum.

    The support staff at WooThemes provided this URL which lists the titles of the plugin templates:
    https://github.com/Automattic/sensei/tree/master/templates

    Now I have tried to replace the variables in the example provided at the bottom of the layouts page but they aren’t registering.

    Here is the code I’ve used:

    $singlelesson_template = locate_template(‘https://openedgemarket.staging.wpengine.com/wp-content/plugins/woothemes-sensei/templates/single-lesson.php‘);
    register_context( ‘Lesson Category’, ‘category_lessons’, $singlelesson_template);

    I don’t know how to reference the plugin folder without using an absolute URL so any guidance on getting away from using an absolute URL would be great.

    So in light of knowing what the template file names are what am I doing wrong?

  • jeffw

    said

    Firstly, to include code in your posts such as shortcodes, HTML, CSS, JavaScript, PHP → follow the instructions on the forum home page.

    Now then. The locate_template() function returns the full path of a file that is in the theme’s folder. Your template is not in the theme’s folder so that function should not be used. The path to the plugins folder is held in the WP_PLUGIN_DIR constant, so you can use that instead…

    $singlelesson_template = WP_PLUGIN_DIR . '/woothemes-sensei/templates/single-lesson.php';
    register_context( 'Lesson Category', 'category_lessons', $singlelesson_template);

    Without having a copy of the actual plugin I can’t really help much.

  • wengriffin

    said

    Hi Jeff,

    After putting in the code you provided above and switching out the relevant variables I can see templates on the layout page under the appearance menu. I assigned all templates to be full width, however upon testing out a lesson and course the layout is the same default layout, which is the exact issue I’m trying to address.

    Making these plugin template files work with the theme is proving to be over my head but absolutely necessary. Can you please provide some advice on what I should do to get this sorted out? I know I can hire someone on Codeables.io… I’m not sure how to word the request to get this to work.

    Your help is muchly appreciated!

  • jeffw

    said

    Without having a copy of the actual plugin I can’t really help much more.

  • jeffw

    said

    Sure. We’ll take a look when we can. It may simply be the case that this plugin is incompatible with our layout engine. You can email the plugin to support@parallelus.net and please include in the email a link to this topic so that we know what the email is in reference to.

  • wengriffin

    said

    I emailed the plugin. I’m really hoping you or someone on your team can help… As I said before I love the Salutation theme… It’s been working great for our site and company, but now we’d like to use our site to as an onboarding tool. I really like the Sensei plugin because of the Buddypress integration. Only issue is not being able to change the layout for those lesson course CPTs associated with the plugin. Thanks a million times in advance for any help you can provide.

Viewing post 1 to 15 (21 total posts)
Topic tags: sensei plugin layout sidebar