function iard_portal_check() { // if not portal page /*if(is_page_template('page-templates/tpl-intranet.php') || is_page_template('page-templates/tpl-training.php') || (is_single() && get_post_type() == 'course_unit')) {*/ if (_is_portal_page()) { // if not logged in if (!is_user_logged_in()) { global $post; $url = get_permalink($post->ID); wp_safe_redirect(site_url('/login/?not_logged_in=1&$redirect_to=' . $url), 301); exit; } } }
<?php $portal_id = get_page_by_title('Member Portal'); ?> <section class="intranet-header<?php if (_is_portal_page()) { ?> open<?php } ?> "> <div class="container"> <h2><?php if (!_is_portal_page()) { ?> <a href="javascript:;" class="btn pull-right" data-toggle="open" data-target=".intranet-header"><i class="material-icons">menu</i></a> <?php } ?> Welcome, IARD Member</h2> <?php if (!is_page_template('page-templates/tpl-intranet.php')) { ?> <?php if (have_rows('buttons', $portal_id)) { ?> <div class="hTabs"> <ul class="nav nav-tabs"> <?php while (have_rows('buttons', $portal_id)) { the_row(); ?>