1 Configure Your Moodle Website

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

1 Configure your Moodle Website

Once you have installed and activated the Edwiser Bridge plugin on your website the next step would be to
configure the Moodle website and generate an ‘Access Token‘ which will be used on the WordPress website.
The following steps will have to be taken through to complete the Moodle site settings.

Create an External Service on Moodle

 Login to your Moodle site and go to Site Administration -> Plugins -> Web Services -> External
Services.
 Click on the ‘Add‘ button on the external services page.

 Enter a name for the External Service, check the ‘Enabled‘ field, check the ‘Authorised Users Only‘
field.
 Now click on the ‘Add Service’ and follow it up with clicking the ‘Add functions‘ link.

 Select the following functions and save the changes made.


o core_user_create_users: Create users.
o core_user_get_users_by_field: Retrieve users information for a specified unique field.
o core_user_update_users: Update users.
o core_course_get_courses: Return course details
o core_course_get_categories: Return category details
o enrol_manual_enrol_users: Manual enrol users
o enrol_manual_unenrol_users: Manual unenrol users
o core_enrol_get_users_courses: Get the list of courses a user is enrolled in

 The next step would be to add users to  the list of authorized users for the external service that you
created. To do this you will have to go to Site Administration -> Plugins -> Web Services ->
External Services and click on the ‘Authorised users‘ link against the external service you created.
 Once there you will be able to add users to the list of authorised users. Conversely, you can also
remove users from the same setting at a later point of time if required.

Enable the REST Protocol

1. Go to Site Administration –> Plugins –> Web Services –> Manage Protocols.
2. Click on the grey icon in the REST protocol row to enable the REST protocol and save the changes
made.

Generate a Moodle Web Service Token

1. Go to Site Administration –> Plugins –> Web Services –> Manage Tokens
2. Click on the ‘Add‘ link and select the admin user under the ‘User‘ list.
3. Now select the external service that you created earlier in the ‘Service‘ drop down list.
4. Click on the ‘Save Changes’ button. The token generated will be used in the Edwiser Bridge settings
page on your WordPress website.

Enable Web Services

Go to Site Administration –> Advance features, check the ‘Enable Web Services’ field and click ‘Save
Changes‘ to save the changes you have made.

Disable Password Policy


1. Users will register to courses from the WordPress website. Their password for the Moodle website
will also be created on WordPress. Therefore, we will have to change the Moodle website’s
password policy, or else a user’s Moodle account will not be created after course registration.
2. To disable the password policy go to Home -> Site Administration -> Security -> Site Policies and
disable the Password policy by unchecking the check-box.

With that last bit on disabling the password policy, we have completed the Moodle end configurations for
the WordPress – Moodle integration to work seamlessly.

2 Set Up Edwiser Bridge: The WordPress Moodle Integration


Plugin
Configure The General Settings
1. Now that we have installed Edwiser Bridge and configured the Moodle website go to Edwiser Bridge
–> Settings –> General tab in the WordPress website back end.
2. Once here carry make the following three settings based on your requirement.
o Check the ‘Enable Registration‘ field if you want the students to be able to register to the
courses from the front end.
o Select the page you want to display as ‘User Account Page‘ when a registered user signs-in to
the WordPress website.
o Enter the language code in ‘Moodle Language Code‘ and make sure that the language code in
your Moodle and WordPress site is the same.

Add the Moodle Access Token


1. The next step would be to add the ‘Access Token‘ to the settings field provided by Edwiser Bridge.
Essentially, it is this token that connects the two systems together.
2. To add the ‘Access Token’ go to Edwiser Bridge –>  Settings –> Configurations. Now enter the
Moodle website URL  to the ‘Moodle URL‘ field and token to the ‘Moodle Access Token‘ field and
save the changes made.
3. The format in which the Moodle site URL has to be added in the custom box is as follows
https://yourURL.com or https://yourURL.com/moodle etc (Make sure that the Moodle site URL is as
mentioned above in order to avoid cURL error).
4. You can also test the connection before saving the changes right in the settings option. On testing the
connection, an appropriate message will be displayed to the user based on the connection status.

Configure PayPal Settings

To start selling the courses from WordPress, you will also have to configure a Payment Gateway. In this
case, it is PayPal. Let’s go through the process of setting up PayPal on your WordPress website.

1. Enter the email id which will be used to accept payments in the ‘PayPal Email‘ field.
2. Next choose your chosen currency of transaction from the ‘PayPal Currency‘ drop down box.
3. Enter the country from which you will be operating the transaction in the ‘PayPal Country‘ field.
4. In the ‘PayPal Cancel URL‘ field, you will enter the link of the page to which the buyer should be
redirected should a payment not go through.
5. In the ‘PayPal Return URL‘ field, you will enter the link of the page to which the buyer should be
redirected after the payment of a purchase has been completed.
6. The ‘Use PayPal Sandbox‘ field should only be checked at the time of making test transactions.
Uncheck the field once the website is made live.
 To give refunds to your students you have to add these details in Edwiser Bridge settings,

These settings are optional in nature but if you are planning to set them up then following the steps given
below,

 Go to Edwiser Bridge > Settings tab > PayPal Settings tab > Scroll down to PayPal API Credentials
 You will find three fields API Username, API Password & API Signature, all fields are mandatory,
 You will get these details by following these steps,
1. Log in to your PayPal Business account.
2. Click the My Account tab.
3. Click the Profile tab. If you haven’t already done so, you need to verify your account before
requesting API credentials.
4. Click Request API credentials under Account information.
5. Click Set up PayPal API credentials and permissions under Option 1.
6. Click Request API Credentials.
7. Click Request API signature.
8. Click Agree and Submit.
9. Copy and paste the API username, password, and signature into Edwiser’s settings (one
mentioned above)
 Here is a link for detailed explaination and better understanding.

3 Editing the Emails sent from the Edwiser Bridge plugin:


The emails sent from the Edwiser Bridge plugin can be customized to suit your needs.

1. To edit email templates, browse ‘Edwiser Bridge’ → ‘Manage Email Templates’ in your WordPress
backend.
2. Select an email template you wish to edit in the list of Email Templates.
3. After making the changes, click on ‘Save Changes’ button to save the changes.

Customizable Fields in the Email Template:


You can customize the following fields in the email template,

From Name: (Here you could add the title of your choice to the selected email template),

Subject: (Here you could add a custom subject line for the selected email template)

General Constants in Email Templates:


The ‘General constants’ are special values which can be used in all the email templates. These General
Constants are:

{USER_NAME} – Use this constant if you want to send users their username to access your site.

{FIRST_NAME} – Use this constant to display the first name of the user in emails.

{LAST_NAME} – Use this constant to display the last name of the user in emails.

{SITE_NAME} – Use this constant to display your site name on emails.

{COURSES_PAGE_LINK} – Use this constant to add a link of the course which the user has purchased.

{USER_ACCOUNT_PAGE_LINK} – Use this constant to add a link of the user-account page on email.
{WP_LOGIN_PAGE_LINK} – Use this constant to add a link of the WordPress login page.

{MOODLE_URL} – Use this constant to add a link of your Moodle site in the emails.

Email Templates specific Constants:


1. In the ” Create new Moodle Account ” email template,

{USER_PASSWORD} – This constant displays the user’s password on your site to whom the email is being
sent to.

2. In the ” Order Completion ” email template,

{COURSE_NAME} – This constant displays the title of the course in emails.

{ORDER_ID} – This constant displays the order id of the course purchased.

3. In the ” Course Excess Expired ” email template,

{WP_COURSE_PAGE_LINK} – This constant displays a link to the user’s expired course.

4. In the ” Order Refund ” email template,

{ORDER_ID} – This constant displays refund order ID in the email.

{CUSTOMER_DETAILS} – This constant displays customers details in the email.

{ORDER_ITEM} – This constant displays item associated with order ID.

{TOTAL_AMOUNT_PAID} – This constant displays amount paid at the time when the order was placed.

{CURRENT_REFUNDED_AMOUNT} – This constant displays the amount that has been refunded to the
course buyer.

{TOTAL_REFUNDED_AMOUNT} – This constant displays the total amount that has been refunded to the
course buyer.

Testing Email Templates:


Once you have edited the email templates, you can test send these emails by adding your email address in
the ‘Send a test email of the selected template’ field and clicking ‘Send Test’.

 Refund Notification Settings


 By default, the Site Admin will receive notification related to refunds whenever a student is given a refund.

As admins, you could also make sure that few important email ID’s are notified whenever a refund is given
out for that simply add those email address here and Save them.

4 Synchronize WordPress with Moodle


With the completion of the configuration process for Moodle and WordPress, the Edwiser Bridge plugin set
up has been completed. Let’s take a look now at the various options available to synchronize WordPress
with Moodle.

Synchronize Courses

1. To synchronize Moodle courses with WordPress go to Edwiser Bridge –> Settings –>
Synchronization Tab.
2. To synchronize only the course categories from Moodle to WordPress check the ‘Synchronize
Course Categories‘ field and click save. Leave the remaining check boxes unchecked.
3. To update courses that have been synchronized previously check the ‘ Update Courses Synchronized
Previously‘ field and click save. Leave the remaining check boxes unchecked.
4. To import only Moodle courses to WordPress as drafts check the ‘Synchronize Courses as Drafts‘
field and click save. Leave the remaining check boxes unchecked. The courses that have been
synchronized will be saved in as a custom post type and can be accessed by going to Edwiser Bridge
–> Courses from the admin menu.
5. If all the checkboxes are checked then all values will get synchronized with WordPress and
appropriate messages will be displayed once the process has been completed.
6. If no checkbox is selected and the ‘Synchronize‘ button is clicked then the Moodle courses will get
synchronized with WordPress and will be published on the website.

Synchronize Users

1. To synchronize enrolled user data between the two systems go to Edwiser Bridge –> Settings –>
Synchronization and click on the ‘Users‘ link provided at the top left.
2. Once here you can synchronize user data for enrolled courses by checking the ‘Update user’s course
enrollment status’ field provided. This field would be particularly useful to synchronize data for
users who have been enrolled to some courses from the Moodle website.

Link and Unlink Users From WordPress

1. In the case that there is a situation in which a user’s Moodle account is not linked with his
WordPress account then you can do so from the ‘Users’ page at the backend of the WordPress
website.
2. To link or unlink a Moodle account with a WordPress account go to ‘Users‘ in the admin menu and
select the WordPress user accounts you want to link or unlink with Moodle.
3. Now select the required menu from the ‘Bulk Actions‘ drop down list and click apply.
4. It is important to note that if you link a WordPress account with a Moodle account the password will
not get synced and will be the same as it was while creation of the respective accounts.
5. If you have users who are already registered in Moodle and want to create their WordPress user
accounts then you could do that by manually creating WordPress user accounts in WordPress and
then following the step 2 & 3 as mentioned in this documentation.

Enroll and Unenroll Users to Courses from WordPress

1. To enroll or un-enroll users from the WordPress website go to the ‘Users‘ tab in the admin menu and
select the user you want to enroll or un-enroll to or from a course.
2. On the users profile page at the back end, a setting will be provided to select a course from a drop-
down box and enroll the user to that course.
3. Similarly, a drop down box will be provided to select a course from the drop-down box and un-enroll
the user from that course.
4. For both fields, on selecting the required course and saving the details, the enrollment information is
updated in both WordPress as well as Moodle.
5 Create Categories in WordPress
Courses imported from Moodle can be assigned various categories. The categories can either be imported
from Moodle by using the ‘Synchronize Course Categories‘ Option in the ‘Synchronization’ tabs on the
settings page.

Alternatively, new courses can be created and can be assigned to courses imported from Moodle.

1. To create a category go to Edwiser Bridge –> Course Categories.


2. Here enter a name for the category, a URL friendly slug for the category, assign a parent category if
applicable and description of the category.
3. After making all the necessary changes and click the ‘Add New Course Category’ button. Once you
have made the changes the category just created will be displayed in the table alongside.
4. The category will also be available in the category widget on a single course page.

6 Sell Moodle Courses from WordPress


Now, coming to the most important functionality of the system, that of selling Moodle courses from
WordPress. Now that all the configuration and setup has been completed the only step left on your end
would be to set up the courses that have been imported from Moodle to WordPress for sale.

Assign a Price to Courses

 Go to the Edwiser Bridge –> Courses and open a course page of your choice.
 Lower on the course page there is a ‘Course Options‘ widget. Here you can set the various
parameters to start selling the course.
 You can select if you want to make a course paid or not from the ‘Course Price Type‘ drop down
box. In this field, there are three options that can be selected.
o The ‘Free‘ option is for free courses which will be available for all registered users.
o The ‘Paid‘ option is for courses which will have to be purchased by users.
o The ‘Closed‘ option is if the course is not available to be taken however you still want to
display it on the website.
 If  you have selected ‘Free‘ in the previous field all users will be able to take the course from the
Moodle website.

 If you select the ‘Paid‘ option the ‘Course Price‘ field will now be displayed. You will have to enter
the price at which you want to sell the course here.

 On selecting the ‘Closed’ option, an additional field labelled ‘Optional URL‘ will be displayed. Here
you will have to enter the URL of a page to which you want the end user to be redirected to on
clicking the ‘Take Course‘ button.

 e sure to save any changed that you make to the course page by clicking on ‘Publish‘ or ‘Update‘
whichever is applicable.

User Interaction with Your WordPress Website

 Below is a screen shot of the course page when a new user lands on it.

 On clicking the ‘Take Course‘ button, the user will be redirected to the login page as he is not logged
in.

 Since the user is new, he will have to click on the ‘Don’t have an Account?‘ following which the
user will be redirected to the registration page.
 Once a user has successfully registered on the WordPress website an account for that user is also
created on the Moodle website with the same username and password.
 The user will now be redirected to the course page from which the user will be able to purchase the
course by clicking the ‘Take Course‘ button on the course page.
 On successful payment for the course, the ‘Take Course‘ button on the course page will now be
replaced by the ‘Access Course‘ button. On clicking this button, the user will now be redirected to
the Moodle website where he can take the course by signing in to the system.

View Purchase Orders

To view the compilation of all the courses that have been purchased from your course you will have to go to
Edwiser Bridge –> Orders where you will be able to see a full purchase history of all courses.

Refunds Orders

Now give refunds to your students by following these steps,

 Go to Edwiser Bridge > Orders > Edit Order > Scroll to Refund Order section,
 You can give a partial refund to your client by entering the amount to be refunded in the “Refund
Amount” field > Later Hit the ” Refund $ ” button given below this will initiate the refund,
 Once done you could update the Order by clicking on the “Update” button,

If you wish to give your students full refunds?

Simply enter the price at the which the buyer purchased the course and grant refund.

If you wish to bar the user from accessing the course after refund?

Check the “Suspend Course Enrollment” checkbox and then provide the refund this would unenroll the
student from the course.

 Order Status History

As an admin, you also get to see the history of the transaction.

7 Setting an Expiry date for course on WordPress


You can automatically unenroll a user from a course by setting the course expiry date. To set the expiry date
for a course:

Set Expiry date

 Go to Edwiser Bridge → Courses.


 Select a course and set the course expiry date by ticking the ‘Expire Course Access’ option and
adding the number of days in the ‘Expire Access After’ field inside the course meta box.
 Once done, save the changes.

8 User Profile Page


We have improved our existing user account page and added the following tabs ” Dashboard, Account
Details, Orders & My Courses ”
 Account Details – Under this tab, your buyers will see their account details and related details. They
could update these details here and it is updated on WordPress as well as Moodle end at once.
 Orders – Under this tab, your buyers will see a list of all purchases they did on your site.
 My Courses – Under this tab, your buyer will see all the courses that they purchased and also access
them whenever they need.

9 Edwiser Bridge Shortcodes:


Shortcode [eb_courses]:

This shortcode is used to display the courses on a page. The parameter which can be used with this
shortcode is as follows:

[eb_courses order=”ASC|DESC”] – Displays the courses in Ascending/Descending order.

[eb_courses per_page=”Number”] – Enables pagination and limits the number of courses displayed on a
page. For instance, [eb_courses per_page=”12″] will display only 12 courses on page one and the next
courses on page 2 and so on.

[eb_course categories=”Category_Slug(s)”]– Displays courses from a specific category/categories. For


instance, [eb_course categories=”Science”] will display only the courses from Science category

[eb_courses cat_per_page=”Number”] – Shows only those courses from the set number of categories.

[eb_courses group_by_cat=”yes”] – Groups and displays the courses as per categories on the page.

[eb_courses horizontally_scroll=”yes”] – Displays all the courses inside an horizontal scrollbar.

Shortcode [eb_my_courses]:

This shortcode is used to display the ‘my courses’ on a page. The parameter which can be used with this
shortcode is as follows:

[eb_my_courses my_courses_wrapper_title=”My Courses”] – Sets a custom title to your my courses


page.

[eb_my_courses recommended_courses_wrapper_title=”Recommended courses”] – Sets a custom title


to the recommended courses section on the my courses page.

[eb_my_courses number_of_recommended_courses=”4″] – Sets the number of courses to be displayed


on the recommended courses section on my courses page.

Shortcode [eb_user_account]:

Displays the user account on a page.

10 Edwiser Bridge Action Hooks


Action Hooks Description Parameter
Use this action hook to save
$field: Value of field which you want to
eb_update_option settings manually on the
handle or save at a custom location.
settings page.
eb_course_synchronization_complete Use this action hook to $courses_created: Id of newly created
execute a custom action after courses on WordPress.
the completion of course $courses_updated: Id of previously
synchronization. updated courses on WordPress.
$wp_course_id: Id of course created on
Use this action hook to
WordPress.
execute custom code after
eb_course_created_wp $sync_options: Synchronization option
course creation on
selected by website admin.
WordPress.
$course_data
$existing_wp_course_id: Id of course
Use this hook to execute updated on WordPress.
eb_course_updated_wp custom code after updating $sync_options: Synchronization option
courses on WordPress. selected by website admin.
$course_data  
Use this hook to execute a $user_id: User Id for whom
custom action after each synchronization has been completed.
eb_user_synchronization_complete_single
user’s synchronization $sync_options: Synchronization option
completion. selected by website admin.
Use this hook to execute $all_users: Array of users for whom
custom code after user data synchronization has been performed.
eb_user_synchronization_complete
synchronization has been $sync_options: Synchronization option
completed. selected by website admin.
Use this to execute custom
$user_args: Details entered by user
code after registering a
eb_created_user while registration. ( Includes the random
WordPress account & linking it
password generated for the user)
with the Moodle account.
Use this hook to execute
custom code after an existing $user_args: User details used to create
eb_linked_to_existing_wordpress_user
WordPress account is linked an account on moodle.
with a Moodle account.
$user_id: Id of user who has been
enrolled to a course.
Use this hook to execute
$success: Check if enrollment was
eb_user_courses_updated custom code after a user
successfully completed.
enrolls to a course.
$courses:Courses to which a user has
been enrolled.
Use this hook to execute
custom code after a new order
eb_order_created $order_id
has been created to save
custom data in order meta.
Use this dynamic hook to
eb_order_status_(completed/pending/failed) execute custom code based $order_id
on order status.
Use this hook to execute a
custom function before
eb_register_taxonomy –
registration of the plugin’s
default taxonomy.
Use this hook to execute a
custom function after
eb_after_register_taxonomy –
registration of the plugin’s
default taxonomy.
Use this hook to execute a
custom function before
eb_register_post_type –
registration of the plugin’s
default post types.
Use this hook to execute a
custom function after
eb_after_register_post_type –
registration of the plugin’s
default post types.
Use this hook to add content
eb_before_course_archive before the course grid on –
course archive page.
Use this hook to add content
eb_after_course_archive after the course grid on course –
archive page.
Use this hook to add content
eb_before_single_course before course data on a single –
course page.
Use this hook to add content
eb_after_single_course after course data on a single –
course page.
Use this hook to add custom
eb_email_header header to emails being sent $header
by the plugin.
Use this hook to add custom
eb_email_footer footer to emails being sent by –
the plugin.

11 Edwiser Bridge Filter Hooks


Filter Hooks Description Parameters
Use this hook to create pages on plugin
eb_create_default_pages –
activation.
Use this hook to add custom data to a
eb_new_user_data user’s profile when an account is created on $userdata
WordPress.
Use this hook to filter the username used
$username: Username already
eb_unique_moodle_username when a new  account is created for a user
generated by the system for a user.
on Moodle.
Password is randomly generated if a user
with an existing WordPress account is
eb_filter_moodle_password $random_password
linked to Moodle. Using this filter a custom
password can be set for user accounts.
$userdetails: Profile details to be
passed to Moodle for a user.
$update: To know if an existing
Use this filter to transfer additional profile user’s profile is being updated or a
eb_moodle_user_profile_details
field data from WordPress to Moodle. new account is created on Moodle.
$userdetails: In case of profile
being updated array should contain
the moodle user id of a user.
Use this filter to modify arguments passed
eb_taxonomy_args_eb_course_cat –
when creating course category taxonomy.
Use this filter to modify arguments passed
eb_register_post_type_courses –
when creating a Moodle course post type
Use this filter to modify arguments passed
eb_register_post_type_order –
when creating course order post type.
This hook can be used to modify existing
eb_post_options custom options added to post types or to –
add new fields.
Use this filter hook to modify the ‘Take this
$login_button
eb_course_login_button Course’ button displayed to non logged in
$login_url
users.
Use this filter hook to modify the ‘Access $access_button
eb_course_access_button Course’ button displayed on a single course $access_params: Parameters that
page. can be used to modify the button.
Use this filter hook to modify the ‘Take this $closed_button
eb_course_closed_button Course’ button displayed for courses where $closed_params: Parameters that
course price type is closed. can be used to modify the button.
Use this filter hook to modify the ‘Take this
$free_button
eb_course_free_button Course’ button displayed for courses where
$course id
course price type is free.
Use this filter hook to modify the ‘Take this $paypal_button
eb_course_payment_button Course’ button displayed for courses where $payment_params: The parameters
price is defined. passed are course id and price.
Use this filter to display custom notice for
courses that cannot be purchased. (This
eb_course_not_purchasable_notice can happen if PayPal details are not –
entered in plugin settings or if course price
type is not set.)
Use this hook to allow external plugins to
eb_get_template filter plugin template files from their own –
plugin.
Use this filter to redirect user to custom $redirect: Default redirection URL
eb_login_redirect
location after login. $user: Current Logged in User.
Use this filter to redirect user to custom $redirect: Default redirection URL
eb_registration_redirect
location after registration. $user: Current Logged in User.
Use this filter to include the custom settings
$settings: Array of registered
eb_get_settings_pages page class to define custom plugin settings
settings classes.
page.
$args: Existing parameters.
Use this filter to add custom parameters to $tempalte_name: Name of email
ed_filter_email_parameters
emails being sent. template to identify which email is
being sent.
Use this filter to add custom email headers
eb_email_headers –
for all emails being sent.
Use this filter to modify email subject for
eb_new_user_email_subject –
email sent on user registration.
Use this filter to modify email subject for
eb_existing_wp_user_email_subject email sent on linking an existing WordPress –
account with a new moodle user account.
Use this filter to modify email subject for
eb_order_completion_email_subject –
email sent on order completion.

12 How to make Edwiser Bridge Compatible with Your Theme


On installing Edwiser Bridge plugin, you may find that the alignment and display of the ‘course archive’
page and the ‘single course page’ is not the way you would like it to be. This happens because the HTML
structure that is being used in Edwiser Bridge might be different from that being used in your theme.
The following steps can be followed to make Edwiser Bridge compatible with your theme:

Step 1:

Create a folder named ‘edwiserBridge’ in your theme folder (preferably inside the child theme). The path of
the created folder will be ‘wp-content/themes/{themename}/child-theme/edwiserBridge’

Step 2:

Now go to ‘wp-content/plugins/edwiser-bridge/public/templates’, copy the following files and paste them in


‘wp-content/themes/{themename}/child-theme/edwiserBridge’ folder.

 archive-eb_course.php

 content-eb_course.php

 content-single-eb_course.php

 single-eb_course.php

Step 3:

Navigate to ‘wp-content/themes/{themename}/edwiserBridge/’ and open the ‘archive-eb_course.php’ file


present in this folder. Here you will find the below structure.

<?php

[INITIALISATIONS]

<?php get_header(); ?>


<div class="eb-archive-container">
<?php $template_loader->wpGetTemplate('global/wrapper-start.php', $wrapper_args); ?>

[CONTENT]

<?php
$template_loader->wpGetTemplate('global/wrapper-end.php', $wrapper_args);
?>
<?php
/**
* Load Sidebar content.
*/
if (file_exists(get_template_directory_uri().'/sidebar.php')) {
get_sidebar();
}
?>
</div>
<?php
get_footer();

 For the template content start

Remove the line (this line loads the default template wrapper elements).

$template_loader->wpGetTemplate('global/wrapper-start.php', $wrapper_args);

And add the page content wrapper element here.


<section id="primary" class="content-area" style="overflow:auto; padding:15px;">
<main id="main" class="site-main" role="main">

For the template content end

Remove the line (this line loads the default template wrapper elements).

$template_loader->wpGetTemplate('global/wrapper-end.php', $wrapper_args);

And add the page content closing wrapper element here.

</main>
</section>

Replace the above structure, except the [INITIALISATIONS] and [CONTENT] part with the structure in
your theme’s archive.php file. The archive.php file can be found on the following path.
wp-content/themes/{themename}.

Step 4:

Navigate to ‘wp-content/themes/{themename}/edwiserBridge/templates/’ and open the ‘single-


eb_course.php’ file present in this folder. Here you will find the below structure.

<?php

/**
* The template for displaying all single moodle courses.
*/
namespace app\wisdmlabs\edwiserBridge;

[INITIALISATIONS]

<?php get_header(); ?>

<?php $template_loader->wpGetTemplate('global/wrapper-start.php', $wrapper_args); ?>


[CONTENT]
<?php $template_loader->wpGetTemplate('global/wrapper-end.php', $wrapper_args); ?>
<?php

if (file_exists(get_template_directory_uri().'/sidebar.php')) {
get_sidebar();
}
?>
<?php

get_footer();

 For the template content start

Remove the line (this line loads the default template wrapper elements).

$template_loader->wpGetTemplate('global/wrapper-start.php', $wrapper_args);

And add the page content wrapper element here.

<section id="primary" class="content-area" style="overflow:auto; padding:15px;">


<main id="main" class="site-main" role="main">

For the template content end


Remove the line (this line loads the default template wrapper elements).

$template_loader->wpGetTemplate('global/wrapper-end.php', $wrapper_args);

And add the page content closing wrapper element here.

</main>
</section>

Replace the above structure, except the [INITIALISATIONS] and [CONTENT] part with the structure in
your theme’s single.php file. The single.php file can be found on the following path
‘wp-content/themes/{themename}’.

Once you have executed the above steps the display of the ‘course archive page’ and ‘single course page’
should blend with the look of your theme.

So that’s about the steps you have to follow to make Edwiser Bridge Compatible with your theme.

Feel free to use the comments section for any queries you might have!

You might also like