How to make Edwiser Bridge Compatible with Your Theme

How to make Edwiser Bridge Compatible with Your Theme
August 14, 2015 Admin
In Tips & Tricks

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();

 

RemUI

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!

 

 

Join Us on Facebook

Check out our group on Facebook, ‘Moodle Tips & Tricks’ – the name says it all. We’d love it if you impart some of your Moodle wisdom and contribute to the treasure trove of tips and tricks!

Comments (15)

  1. George Dababneh 3 years ago

    Hello,
    i hope all is well.
    I need help please.
    I followed your instruction for the best of my abilities to make Edwiser Bridge Compatible with my theme (Highend by by HB-Themes) without an success.

    I wished I could upload the files i edited to give you the chance to take a look.
    I could not tell that to leave in part of the theme code and what to replace exactly. I did not know what you meant by [CONTENT].
    So i include the original theme file codes below to see if you can help me with the code changes.
    Thank you for the help.
    George
    [email protected]

    archive.php code —————————————————————————————

    <div class="row main-row”>

    1){
    $search_counter = ($paged-1) * get_option(‘posts_per_page’);
    } else {
    $search_counter = 0;
    }
    } elseif ( get_query_var(‘page’) ) {
    $paged = get_query_var(‘page’);
    if ($paged > 1){
    $search_counter = ($paged-1) * get_option(‘posts_per_page’);
    } else {
    $search_counter = 0;
    }
    } else {
    $paged = 1;
    $search_counter = 0;
    }

    while (have_posts()) : the_post();
    $search_counter++;

    $format = get_post_format( get_the_ID() );
    $icon_to_use = ‘hb-moon-file-3’;

    if ($format == ‘video’){
    $icon_to_use = ‘hb-moon-play-2’;
    } else if ($format == ‘status’ || $format == ‘standard’){
    $icon_to_use = ‘hb-moon-pencil’;
    } else if ($format == ‘gallery’ || $format == ‘image’){
    $icon_to_use = ‘hb-moon-image-3’;
    } else if ($format == ‘audio’){
    $icon_to_use = ‘hb-moon-music-2’;
    } else if ($format == ‘quote’){
    $icon_to_use = ‘hb-moon-quotes-right’;
    } else if ($format == ‘link’){
    $icon_to_use = ‘hb-moon-link-5’;
    }

    $thumb = get_post_thumbnail_id();
    $full_thumb = wp_get_attachment_image_src( get_post_thumbnail_id ( get_the_ID() ), ‘original’) ;

    echo ”;
    echo ”. $search_counter .”;

    if ( $thumb ) {
    $image = hb_resize( $thumb, ”, 80, 80, true );
    echo ‘‘;
    } else {
    echo ‘‘;
    }

    $echo_title = get_the_title();
    if ( $echo_title == “” ) $echo_title = __(‘No Title’ , ‘hbthemes’ );
    echo ‘‘.$echo_title.’‘;
    echo ”. get_the_time(‘M j, Y’) .”;

    echo ”;
    the_excerpt();
    echo ”;

    echo ”;

    endwhile;

    hb_pagination_standard();

    else : ?>

    single.php file code ————————————————————————————————————-

    <div class="row main-row”>


    <article id="post-” itemscope itemType=”http://schema.org/BlogPosting”>

    <time datetime="” itemprop=”datePublished”>

    |

    <a href="” title=”” rel=”author”>

    |

    <a href="term_id ); ?>” title=”name ) ); ?>”>cat_name; ?> 0 ) echo ‘, ‘; ?>

    |

    <a href="#comments” class=”comments-link scroll-to-comments” title=””>

    |

    ‘next’, ‘previouspagelink’ => ‘ ‘, ‘nextpagelink’=>’ ‘)); ?>

    <?php
    if ( hb_options('hb_blog_enable_tags' ) )
    the_tags('Tags: ‘,”,”);
    ?>

    <a href="#comments” class=”comments-link scroll-to-comments” title=””>

    get_plugin_name(), EB()->get_version() );
    $plugin_template_loader->wp_get_template_part( ‘content-single’, get_post_type() );

    comments_template();

    endwhile; ?>


    end ————————————————————————————–

    Thanks again…

    • Rajiv 3 years ago

      Hey George,

      I’ll follow-up with you regarding this via email.

    • Guzmán 2 years ago

      Step 3: ‘wp-content/themes/{themename}/edwiserbridge/templates’ open the ‘archive-eb_course.php’ file present in this folder.
      open archive.php in my template
      which is exactly what needs to be replaced? The content?

      Step 4: ‘wp-content/themes/{themename}/edwiserbridge/templates/’ and open the ‘single-eb_course.php’
      I have not folder template only edwiserbridge in step 1

      Thanks

  2. Rasel 3 years ago

    Step 3:

    Navigate to ‘wp-content/themes/{themename}/edwiserbridge/templates’ and open the ‘archive-eb_course.php’ file present in this folder. Here you will find the below structure.

    Should be

    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.

    Please fix. Thanks.

    • Rajiv 3 years ago

      Thanks Rasel. We’ve updated the article 🙂

  3. Aureliano Sánchez Palacios 3 years ago

    Hello
    I do not know which is the CONTENT part . It is a little confused, sorry.
    This is my template archive:

    <?php
    if(is_category()) :
    single_cat_title();

    elseif(is_tag()) :
    single_tag_title();

    elseif(is_author()) :
    printf( __('Author: %s', 'wp-profile' ), '’ . get_the_author() . ”);

    elseif(is_day()) :
    printf( __( ‘Day: %s’, ‘wp-profile’ ), ” . get_the_date() . ” );

    elseif(is_month()) :
    printf( __(‘Month: %s’, ‘wp-profile’ ), ” . get_the_date( _x( ‘F Y’, ‘monthly archives date format’, ‘wp-profile’ ) ) . ” );

    elseif ( is_year() ) :
    printf( __(‘Year: %s’, ‘wp-profile’ ), ” . get_the_date( _x( ‘Y’, ‘yearly archives date format’, ‘wp-profile’ ) ) . ”);

    elseif ( is_tax(‘post_format’, ‘post-format-aside’)) :
    _e( ‘Asides’, ‘wp-profile’ );

    elseif (is_tax(‘post_format’, ‘post-format-gallery’)) :
    _e( ‘Galleries’, ‘wp-profile’ );

    elseif (is_tax(‘post_format’, ‘post-format-image’)) :
    _e( ‘Images’, ‘wp-profile’ );

    elseif (is_tax(‘post_format’, ‘post-format-video’)) :
    _e( ‘Videos’, ‘wp-profile’ );

    elseif ( is_tax(‘post_format’, ‘post-format-quote’)) :
    _e(‘Quotes’, ‘wp-profile’);

    elseif (is_tax(‘post_format’, ‘post-format-link’ )) :
    _e( ‘Links’, ‘wp-profile’ );

    elseif(is_tax(‘post_format’, ‘post-format-status’)) :
    _e( ‘Statuses’, ‘wp-profile’);

    elseif(is_tax( ‘post_format’, ‘post-format-audio’ )) :
    _e( ‘Audios’, ‘wp-profile’ );

    elseif(is_tax( ‘post_format’, ‘post-format-chat’ )) :
    _e( ‘Chats’, ‘wp-profile’ );

    else :
    _e( ‘Archives’, ‘wp-profile’ );

    endif;

    ?>

    <?php
    // Show an optional term description.
    $term_description = term_description();
    if(!empty( $term_description )) :
    printf('%s’, $term_description);
    endif;
    ?>

    Aureliano

  4. This was a bit more difficult with the Karma Theme but I have managed to get it to work. Thank you for the tutorial, it really helped

  5. Cameron Bunch 10 months ago

    It looks like this article is out of date. In the file archive-eb_course.php, for example, I do not find anything like the structure indicated above. The same is true of single-eb_course.php. That being the case there would be no way to follow these instructions. I suppose that the structure of the code has changed enough that this article would need to be updated.

    Could you provide some guidance regarding this? The plugin appears to be working great except that I need to be able to have better control over the formating of the pages it displays.

    Thanks,
    Cameron Bunch

  6. Cameron Bunch 10 months ago

    I have just noticed something related to this issue. It looks like the wrapper-start.php and wrapper-end.php files are doing something like this with a case statement driven by the identities of the common standard themes. Wouold these files play into the solution?

    Regards,
    Cameron Bunch

  7. Alexandra Smaranda 7 months ago

    Good morning, I hope you are well.
    Could you please explain the following sentence by using an example or saying the same thing using other words, because I don’t understand it:

    “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}”.

    Thank you very much
    Alexandra Smaranda

  8. Cuong 6 months ago

    I’m integrating Moodle into WordPress. Thank you for these instructions.

    • Rucha Gotarkar 5 months ago

      Glad to be of help, Cuong.

  9. Steve 4 months ago

    Ok, I’m lost as to what this instruction means: “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}. ”

    Can you please help me understand this better? Thanks.

  10. Afzal Multani 4 months ago

    I’m integrating Moodle into WordPress. How can I access and display Moodle courses on my website, Instead of Moodle site?

    • Rucha Gotarkar 2 months ago

      Hi Afzal,
      Your course content will not be imported into the WordPress site. However, you can enroll yourself in the Moodle course from the WordPress site.

Leave a reply

Your email address will not be published. Required fields are marked *

*