Commit b0c1af85 authored by Dave Lane's avatar Dave Lane
Browse files

making progress, addressing Theme Check's REQUIRED changes

parent 9cbfa267
......@@ -7,13 +7,13 @@ get_header(); ?>
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Sorry, something can\'t be found', 'oeru_theme' ); ?></h1>
<h1 class="page-title"><?php esc_html_e( 'Sorry, something can\'t be found', 'oeru_course' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<p><?php _e( 'It looks like nothing was found at this location.', 'oeru_theme' ); ?></p>
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'oeru_course' ); ?></p>
<?php get_template_part("parts/search-form/standard"); ?>
<?php get_template_part( 'parts/search-form/standard' ); ?>
</div><!-- .page-content -->
</section><!-- .error-404 -->
......
# wordpress-oeru_theme for WordPress
# wordpress-oeru_course for WordPress
The original work embodied here is licensed under
the GNU General Public License v2 or later (GNU GPL v2.0).
the [GNU General Public License v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) or later (GNU GPL v2.0).
Please see the COPYING file for the complete license text.
For convenience, this repository includes a number
......@@ -189,4 +189,3 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
# wordpress-oeru_theme
# wordpress-oeru_course
An OERu theme from the newSplash design to allow deploying
courses in a WordPress instance.
......
......@@ -8,13 +8,13 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentyfourteen' ), single_cat_title( '', false ) ); ?></h1>
<h1 class="archive-title"><?php printf( esc_html__( 'Category Archives: %s', 'oeru_course' ), single_cat_title( '', false ) ); ?></h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
printf( esc_html__('<div class="taxonomy-description">%s</div>', 'oeru_course'), $term_description );
endif;
?>
</header><!-- .archive-header -->
......
......@@ -10,8 +10,13 @@ if ( post_password_required() ) {
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'oeru_theme' ),
number_format_i18n( get_comments_number() ), get_the_title() );
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
printf( _x( 'One thought on &ldquo;%2$s&rdquo;', 'comments title', 'oeru_course' ), get_the_title() );
} else {
printf( esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comments_number, 'comments title', 'oeru_course' ),
number_format_i18n( $comments_number ) ), get_the_title() );
}
?>
</h2>
<ol class="comment-list">
......@@ -29,7 +34,7 @@ if ( post_password_required() ) {
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'oeru_theme' ); ?></p>
<p class="no-comments"><?php _e( 'Comments are closed.', 'oeru_course' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
......
......@@ -10,21 +10,21 @@
</div>
</div>
</header>
<div class="entry-and-comments container">
<div class="entry-and-comments container">
<div class="entry-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfifteen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'oeru_course' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php elseif ( is_search() ) : ?>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'oeru_course' ); ?></p>
<?php get_search_form(); ?>
<?php else : ?>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'oeru_course' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
......
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if(is_page() || is_single()) :
if(get_theme_mod("third_level_menu")!="off"){
oeru_third_level_menu();
}
endif;
?>
<header class="entry-header container">
<div class="row">
......@@ -14,35 +14,46 @@
<div class="panel">
<div class="panel-body">
<?php
if ( is_single() ) :
the_title( '<h1>', '</h1>' );
else :
the_title( '<h1><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
endif;
?>
</div>
</div>
</div>
</div>
</header>
<div class="entry-and-comments container">
<div class="entry-and-comments container">
<div class="entry-content">
<?php
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'oeru_theme' ),
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'oeru_course' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'oeru_theme' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'oeru_course' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) ); ?>
) ); ?>
</div>
<div class="oeru_footer">
/* translators: used between list items, there is a space after the comma. */
$tags_list = get_the_tag_list( '', __( ', ', 'oeru_course' ) );
if ( $tags_list ) {
printf(
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
'<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
twentynineteen_get_icon_svg( 'tag', 16 ),
__( 'Tags:', 'oeru_course' ),
$tags_list
); // WPCS: XSS OK.
}
<?php do_action("oeru_post_footer"); ?>
</div>
<?php
......
.wp-caption {
}
.wp-caption-text {
}
.sticky {
}
.screen-reader-text {
}
.gallery-caption {
}
.bypostauthor {
}
.alignright {
text-align: left;
}
.alignleft {
text-align: left;
}
.aligncenter {
text-align: center;
}
</div><!-- #main -->
<?php if(get_theme_mod("scan_page")=="on" || get_option("oeru_theme_scan_page")=="on"):
<?php if(get_theme_mod("scan_page")=="on" || get_option("oeru_course_scan_page")=="on"):
?><div class="modal fade in" id="siteMapmodal" tabindex="-1" role="dialog" aria-labelledby="siteMapLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
......@@ -12,14 +12,14 @@
if(get_theme_mod("scan_page")=="on"):
$oeru_theme = get_option( 'oeru_theme' );
echo $oeru_theme['scan_page_html'];
$oeru_course = get_option( 'oeru_course' );
echo $oeru_course['scan_page_html'];
else:
if(get_option('oeru_theme_scan_page_html')):
if(get_option('oeru_course_scan_page_html')):
echo get_option( 'oeru_theme_scan_page_html');
echo get_option( 'oeru_course_scan_page_html');
endif;
......
<?php
function oeru_theme_defaults() {
function oeru_course_defaults() {
global $wp_rewrite;
$wp_rewrite->set_permalink_structure( '/%postname%/' );
$wp_rewrite->flush_rules();
}
add_action( 'after_switch_theme', 'oeru_theme_defaults' );
add_action( 'wp_install', 'oeru_theme_defaults' );
add_action( 'after_switch_theme', 'oeru_course_defaults' );
add_action( 'wp_install', 'oeru_course_defaults' );
function oeru_theme_menu_default() {
function oeru_course_menu_default() {
if(!get_option("oeru_theme_menu_create")){
if(!get_option("oeru_course_menu_create")){
require_once("inc/theme_guidance.php");
$menu_id = oeru_theme_create_menu();
$menu_id = oeru_course_create_menu();
if($menu_id == false){
wp_delete_nav_menu("OERu Import Menu");
$menu_id = oeru_theme_create_menu();
$menu_id = oeru_course_create_menu();
}
oeru_theme_menu_hierarchy($menu_id, 0, 0);
oeru_course_menu_hierarchy($menu_id, 0, 0);
$locations = get_theme_mod('nav_menu_locations');
$locations['primary'] = $menu_id;
set_theme_mod('nav_menu_locations', $locations);
add_option("oeru_theme_menu_create", "true");
add_option("oeru_course_menu_create", "true");
}
}
add_action( 'admin_head', 'oeru_theme_menu_default' );
add_action( 'admin_head', 'oeru_course_menu_default' );
function oeru_theme_widgets_init() {
function oeru_course_widgets_init() {
register_sidebar( array(
'name' => __( 'Widget Area', 'oeru_theme' ),
'name' => __( 'Widget Area', 'oeru_course' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar.', 'oeru_theme' ),
'description' => __( 'Add widgets here to appear in your sidebar.', 'oeru_course' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
......@@ -42,9 +42,9 @@ function oeru_theme_widgets_init() {
) );
unregister_sidebar( 'sidebar-1' );
}
add_action( 'widgets_init', 'oeru_theme_widgets_init' );
add_action( 'widgets_init', 'oeru_course_widgets_init' );
function oeru_theme_setup() {
function oeru_course_setup() {
if(!get_option("oeru_course_colour_profile_setup")){
......@@ -53,7 +53,7 @@ function oeru_theme_setup() {
}
load_theme_textdomain( 'oeru_theme', get_template_directory() . '/languages' );
load_theme_textdomain( 'oeru_course', get_template_directory() . '/languages' );
add_theme_support( 'post-thumbnails' );
......@@ -68,7 +68,7 @@ function oeru_theme_setup() {
set_post_thumbnail_size( 672, 372, true );
register_nav_menus( array(
'primary' => __( 'Top primary menu', 'oeru_theme' ),
'primary' => __( 'Top primary menu', 'oeru_course' ),
) );
add_theme_support( 'html5', array(
......@@ -76,9 +76,9 @@ function oeru_theme_setup() {
) );
}
add_action( 'after_setup_theme', 'oeru_theme_setup' );
add_action( 'after_setup_theme', 'oeru_course_setup' );
function oeru_theme_add_category(){
function oeru_course_add_category(){
$catarr = array(
'cat_name' => "Front Page Featured",
'category_description' => "Items to feature on the front page",
......@@ -87,35 +87,35 @@ function oeru_theme_add_category(){
);
wp_insert_term("Front Page", "category", $catarr);
}
add_action( 'after_setup_theme', 'oeru_theme_add_category' );
add_action( 'after_setup_theme', 'oeru_course_add_category' );
function oeru_theme_scripts_and_styles() {
function oeru_course_scripts_and_styles() {
wp_enqueue_style( 'wordpress-oeru-theme-bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-layout', get_template_directory_uri() . '/css/layout.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-typography', get_template_directory_uri() . '/css/typography.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-colours', get_template_directory_uri() . '/css/colours.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-core-alter', get_template_directory_uri() . '/css/oeru_theme_core_alter.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-jquery-ui', get_template_directory_uri() . '/css/jquery-ui.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-open-sans-font', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,800,700,600&subset=latin,greek-ext,greek,cyrillic,latin-ext,vietnamese,cyrillic-ext', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-layout', get_template_directory_uri() . '/css/layout.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-typography', get_template_directory_uri() . '/css/typography.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-colours', get_template_directory_uri() . '/css/colours.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-core-alter', get_template_directory_uri() . '/css/oeru_course_core_alter.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-jquery-ui', get_template_directory_uri() . '/css/jquery-ui.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-open-sans-font', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,800,700,600&subset=latin,greek-ext,greek,cyrillic,latin-ext,vietnamese,cyrillic-ext', array(), '1' );
wp_enqueue_script( 'wordpress-oeru_theme-bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20131205', true );
if ( get_theme_mod( 'swipe' ) === 'on' ) {
wp_enqueue_script( 'wordpress-oeru_theme-swipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-swipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array('jquery'), '20131205', true );
}
wp_enqueue_script( 'wordpress-oeru_theme-scroll', get_template_directory_uri() . '/js/wikieducatorjs/scroll.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-scroll', get_template_directory_uri() . '/js/wikieducatorjs/scroll.js', array('jquery'), '20131205', true );
if(get_theme_mod("menu_depth")!="two"){
wp_enqueue_script( 'wordpress-oeru_theme-menu-fix', get_template_directory_uri() . '/js/wikieducatorjs/menu-fix.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-menu-fix', get_template_directory_uri() . '/js/wikieducatorjs/menu-fix.js', array('jquery'), '20131205', true );
}
wp_enqueue_script( 'wordpress-oeru_theme-feedback', get_template_directory_uri() . '/js/wikieducatorjs/oeru_feedback.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-details-fix', get_template_directory_uri() . '/js/wikieducatorjs/oeru_details_fix.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-feedback', get_template_directory_uri() . '/js/wikieducatorjs/oeru_feedback.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-details-fix', get_template_directory_uri() . '/js/wikieducatorjs/oeru_details_fix.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'jquery-ui-accordion');
wp_enqueue_script( 'wordpress-oeru_theme-accordion', get_template_directory_uri() . '/js/wikieducatorjs/oeru_accordion.js', array('jquery-ui-accordion'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-mcq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mcq.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-mtq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mtq.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-fitb_shortcode', get_template_directory_uri() . '/js/wikieducatorjs/oeru_fitb.js', array('jquery'), '20131205', true );
wp_localize_script( 'wordpress-oeru_theme-fitb_shortcode', 'wordpress_oeru_theme_fitb_shortcode', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'answerNonce' => wp_create_nonce( 'oeru_fitb_check' ) ) );
wp_enqueue_script( 'wordpress-oeru_course-accordion', get_template_directory_uri() . '/js/wikieducatorjs/oeru_accordion.js', array('jquery-ui-accordion'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-mcq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mcq.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-mtq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mtq.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-fitb_shortcode', get_template_directory_uri() . '/js/wikieducatorjs/oeru_fitb.js', array('jquery'), '20131205', true );
wp_localize_script( 'wordpress-oeru_course-fitb_shortcode', 'wordpress_oeru_course_fitb_shortcode', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'answerNonce' => wp_create_nonce( 'oeru_fitb_check' ) ) );
if (get_theme_mod('log_on_page') == 'on') {
wp_enqueue_script( 'wordpress-oeru_user', get_template_directory_uri() . '/js/wikieducatorjs/oeru_user.js', array('jquery'), '20160305', true );
......@@ -124,10 +124,10 @@ function oeru_theme_scripts_and_styles() {
));
}
}
add_action( 'wp_enqueue_scripts', 'oeru_theme_scripts_and_styles' );
add_action( 'wp_enqueue_scripts', 'oeru_course_scripts_and_styles' );
function oeru_admin_theme_scripts_and_styles() {
wp_enqueue_style( 'wordpress-oeru-theme-admin', get_template_directory_uri() . '/css/oeru_theme_admin.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-admin', get_template_directory_uri() . '/css/oeru_course_admin.css', array(), '1' );
}
add_action( 'admin_enqueue_scripts', 'oeru_admin_theme_scripts_and_styles' );
......@@ -136,34 +136,34 @@ add_action( 'admin_enqueue_scripts', 'oeru_admin_theme_scripts_and_styles' );
add_filter( 'xmlrpc_blog_options', function( $xmlrpc_options ) {
if (is_array($xmlrpc_options)) {
$xmlrpc_options['show_on_front'] = array(
'desc' => __( 'Show on front' ),
'desc' => __( 'Show on front', 'oeru_course' ),
'readonly' => false,
'option' => 'show_on_front'
);
$xmlrpc_options['page_on_front'] = array(
'desc' => __( 'Page to show on front page' ),
'desc' => __( 'Page to show on front page', 'oeru_course' ),
'readonly' => false,
'option' => 'page_on_front'
);
$xmlrpc_options['oeru_theme_menu_create'] = array(
'desc' => __( 'Create the OERu top menu' ),
$xmlrpc_options['oeru_course_menu_create'] = array(
'desc' => __( 'Create the OERu top menu', 'oeru_course' ),
'readonly' => false,
'option' => 'oeru_theme_menu_create'
'option' => 'oeru_course_menu_create'
);
$xmlrpc_options['oeru_theme_scan_page_html'] = array(
'desc' => __( 'HTML for the scan page' ),
$xmlrpc_options['oeru_course_scan_page_html'] = array(
'desc' => __( 'HTML for the scan page', 'oeru_course' ),
'readonly' => false,
'option' => 'oeru_theme_scan_page_html'
'option' => 'oeru_course_scan_page_html'
);
$xmlrpc_options['oeru_theme_scan_page'] = array(
'desc' => __( 'Turn the Scan Page on' ),
$xmlrpc_options['oeru_course_scan_page'] = array(
'desc' => __( 'Turn the Scan Page on', 'oeru_course' ),
'readonly' => false,
'option' => 'oeru_theme_scan_page'
'option' => 'oeru_course_scan_page'
);
$xmlrpc_options['oeru_theme_footer'] = array(
'desc' => __( 'Footer content' ),
$xmlrpc_options['oeru_course_footer'] = array(
'desc' => __( 'Footer content', 'oeru_course' ),
'readonly' => false,
'option' => 'oeru_theme_footer'
'option' => 'oeru_course_footer'
);
}
return $xmlrpc_options;
......@@ -172,7 +172,7 @@ add_filter( 'xmlrpc_blog_options', function( $xmlrpc_options ) {
// allow IFRAME in network WordPress
// FIXME this really isn't a theme-specific issue,
// this should probably be a separate plugin for any network install
function oeru_theme_allow_iframe( $allowedposttags ) {
function oeru_course_allow_iframe( $allowedposttags ) {
if ( !current_user_can( 'publish_posts' ) ) {
return $allowedposttags;
}
......@@ -194,7 +194,7 @@ function oeru_theme_allow_iframe( $allowedposttags ) {
);
return $allowedposttags;
}
add_filter( 'wp_kses_allowed_html', 'oeru_theme_allow_iframe' );
add_filter( 'wp_kses_allowed_html', 'oeru_course_allow_iframe' );
/* AJAX login/update API
* called with 'bdo' set to 'login', 'register', or 'update'
......
......@@ -249,37 +249,37 @@ $country_picker = array(
'ZW' => 'Zimbabwe',
);
function oeru_theme_defaults() {
function oeru_course_defaults() {
global $wp_rewrite;
$wp_rewrite->set_permalink_structure( '/%postname%/' );
$wp_rewrite->flush_rules();
}
add_action( 'after_switch_theme', 'oeru_theme_defaults' );
add_action( 'wp_install', 'oeru_theme_defaults' );
add_action( 'after_switch_theme', 'oeru_course_defaults' );
add_action( 'wp_install', 'oeru_course_defaults' );
function oeru_theme_menu_default() {
if(!get_option("oeru_theme_menu_create")){
function oeru_course_menu_default() {
if(!get_option("oeru_course_menu_create")){
require_once("inc/theme_guidance.php");
$menu_id = oeru_theme_create_menu();
$menu_id = oeru_course_create_menu();
if($menu_id == false){
wp_delete_nav_menu("OERu Import Menu");
$menu_id = oeru_theme_create_menu();
$menu_id = oeru_course_create_menu();
}
oeru_theme_menu_hierarchy($menu_id, 0, 0);
oeru_course_menu_hierarchy($menu_id, 0, 0);
$locations = get_theme_mod('nav_menu_locations');
$locations['primary'] = $menu_id;
set_theme_mod('nav_menu_locations', $locations);
add_option("oeru_theme_menu_create", "true");
add_option("oeru_course_menu_create", "true");
}
}
add_action( 'admin_head', 'oeru_theme_menu_default' );
add_action( 'admin_head', 'oeru_course_menu_default' );
function oeru_theme_widgets_init() {
function oeru_course_widgets_init() {
register_sidebar( array(
'name' => __( 'Widget Area', 'oeru_theme' ),
'name' => __( 'Widget Area', 'oeru_course' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar.', 'oeru_theme' ),
'description' => __( 'Add widgets here to appear in your sidebar.', 'oeru_course' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
......@@ -287,14 +287,14 @@ function oeru_theme_widgets_init() {
) );
unregister_sidebar( 'sidebar-1' );
}
add_action( 'widgets_init', 'oeru_theme_widgets_init' );
add_action( 'widgets_init', 'oeru_course_widgets_init' );
function oeru_theme_setup() {
function oeru_course_setup() {
if(!get_option("oeru_course_colour_profile_setup")){
require_once("inc/install_profile.php");
add_option("oeru_course_colour_profile_setup", "true");
}
load_theme_textdomain( 'oeru_theme', get_template_directory() . '/languages' );
load_theme_textdomain( 'oeru_course', get_template_directory() . '/languages' );
add_theme_support( 'post-thumbnails' );
$chargs = array(
'width' => 980,
......@@ -304,15 +304,15 @@ function oeru_theme_setup() {
add_theme_support( 'custom-header', $chargs );
set_post_thumbnail_size( 672, 372, true );
register_nav_menus( array(
'primary' => __( 'Top primary menu', 'oeru_theme' ),
'primary' => __( 'Top primary menu', 'oeru_course' ),
) );
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
) );
}
add_action( 'after_setup_theme', 'oeru_theme_setup' );
add_action( 'after_setup_theme', 'oeru_course_setup' );
function oeru_theme_add_category() {
function oeru_course_add_category() {
$catarr = array(
'cat_name' => "Front Page Featured",
'category_description' => "Items to feature on the front page",
......@@ -322,34 +322,34 @@ function oeru_theme_add_category() {
wp_insert_term("Front Page", "category", $catarr);
}
add_action( 'after_setup_theme', 'oeru_theme_add_category' );
add_action( 'after_setup_theme', 'oeru_course_add_category' );
function oeru_theme_scripts_and_styles() {
wp_enqueue_style( 'wordpress-oeru-theme-bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-layout', get_template_directory_uri() . '/css/layout.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-typography', get_template_directory_uri() . '/css/typography.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-colours', get_template_directory_uri() . '/css/colours.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-core-alter', get_template_directory_uri() . '/css/oeru_theme_core_alter.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-jquery-ui', get_template_directory_uri() . '/css/jquery-ui.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-theme-open-sans-font', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,800,700,600&subset=latin,greek-ext,greek,cyrillic,latin-ext,vietnamese,cyrillic-ext', array(), '1' );
function oeru_course_scripts_and_styles() {
wp_enqueue_style( 'wordpress-oeru-course-bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-layout', get_template_directory_uri() . '/css/layout.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-typography', get_template_directory_uri() . '/css/typography.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-colours', get_template_directory_uri() . '/css/colours.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-core-alter', get_template_directory_uri() . '/css/oeru_course_core_alter.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-jquery-ui', get_template_directory_uri() . '/css/jquery-ui.min.css', array(), '1' );
wp_enqueue_style( 'wordpress-oeru-course-open-sans-font', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,800,700,600&subset=latin,greek-ext,greek,cyrillic,latin-ext,vietnamese,cyrillic-ext', array(), '1' );
wp_enqueue_script( 'wordpress-oeru_theme-bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20131205', true );
if ( get_theme_mod( 'swipe' ) === 'on' ) {
wp_enqueue_script( 'wordpress-oeru_theme-swipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-swipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array('jquery'), '20131205', true );
}
wp_enqueue_script( 'wordpress-oeru_theme-scroll', get_template_directory_uri() . '/js/wikieducatorjs/scroll.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-scroll', get_template_directory_uri() . '/js/wikieducatorjs/scroll.js', array('jquery'), '20131205', true );
if(get_theme_mod("menu_depth")!="two"){
wp_enqueue_script( 'wordpress-oeru_theme-menu-fix', get_template_directory_uri() . '/js/wikieducatorjs/menu-fix.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-menu-fix', get_template_directory_uri() . '/js/wikieducatorjs/menu-fix.js', array('jquery'), '20131205', true );
}
wp_enqueue_script( 'wordpress-oeru_theme-feedback', get_template_directory_uri() . '/js/wikieducatorjs/oeru_feedback.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-details-fix', get_template_directory_uri() . '/js/wikieducatorjs/oeru_details_fix.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-feedback', get_template_directory_uri() . '/js/wikieducatorjs/oeru_feedback.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-details-fix', get_template_directory_uri() . '/js/wikieducatorjs/oeru_details_fix.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'jquery-ui-accordion');
wp_enqueue_script( 'wordpress-oeru_theme-accordion', get_template_directory_uri() . '/js/wikieducatorjs/oeru_accordion.js', array('jquery-ui-accordion'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-mcq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mcq.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-mtq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mtq.js', array('jquery'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_theme-fitb_shortcode', get_template_directory_uri() . '/js/wikieducatorjs/oeru_fitb.js', array('jquery'), '20131205', true );
wp_localize_script( 'wordpress-oeru_theme-fitb_shortcode', 'wordpress_oeru_theme_fitb_shortcode', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'answerNonce' => wp_create_nonce( 'oeru_fitb_check' ) ) );
wp_enqueue_script( 'wordpress-oeru_course-accordion', get_template_directory_uri() . '/js/wikieducatorjs/oeru_accordion.js', array('jquery-ui-accordion'), '20131205', true );
wp_enqueue_script( 'wordpress-oeru_course-mcq', get_template_directory_uri() . '/js/wikieducatorjs/oeru_mcq.js', array('jquery'), '20131205', true );