{ // Switch between posts and courses on the author archives page. add_rewrite_endpoint('view', EP_AUTHORS); // Exchange messages between pages. add_rewrite_endpoint('action', EP_PAGES); // Add rewrite rule for pagination on the author archives page. add_rewrite_rule('author/([^/]+)/view/([^/]+)/page/([0-9]+)/?', 'index.php?author_name=$matches[1]&view=$matches[2]&paged=$matches[3]', 'top'); } add_action('init', 'edutheme_endpoints'); if (is_admin()) { /** * Set the width of the rich text editor. * * @param array $params * @return array */ function educator_admin_editor_width($params) { $params['width'] = '620px'; return $params; } add_filter('tiny_mce_before_init', 'educator_admin_editor_width'); if (current_user_can('install_plugins')) { // Recommend plugins. require get_template_directory() . '/include/recommend-plugins.php'; } } // Include WooCommerce support. if (educator_wc_active()) { require 'include/woocommerce.php'; }
<?php /* Template Name: User page */ get_header(); $current_page = get_the_ID(); $account_page = educator_wc_active() ? wc_get_page_id('myaccount') : null; ?> <?php if (!is_user_logged_in()) { ?> <section class="section-content"> <div class="container clearfix"> <div class="short-fw-container"> <?php if ($current_page == $account_page) { ?> <?php while (have_posts()) { the_post(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php