Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The template for displaying Archive pages.
- *
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
- *
- * @package GeneratePress
- */
- get_header(); ?>
- <?php if( !is_user_logged_in()) { ?>
- <?php wp_redirect( 'http://sandgroper.net/' ); exit; ?>
- <?php } else { ?>
- <!-- redirect school/teacher if no profile -->
- <?php if ( 0 == count_user_posts( get_current_user_id(), "school_profile" ) && is_user_logged_in() && current_user_can('school-cap') && !current_user_can('admin-cap')) { ?>
- <?php wp_redirect( 'http://sandgroper.net/?page_id=242' ); exit; ?>
- <?php } elseif ( 1 == count_user_posts( get_current_user_id(), "school_profile" ) && is_user_logged_in() && current_user_can('school-cap') ){ ?>
- <?php } ?>
- <!-- redirect teacher if no profile -->
- <?php if ( 0 == count_user_posts( get_current_user_id(), "teacher-profile" ) && is_user_logged_in() && current_user_can('teacher-cap') && !current_user_can('admin-cap')) { ?>
- <?php wp_redirect( 'http://sandgroper.net/?page_id=498' ); exit; ?>
- <?php } elseif ( 1 == count_user_posts( get_current_user_id(), "teacher-profile" ) && is_user_logged_in() && current_user_can('teacher-cap') ) { ?>
- <?php } ?>
- <section id="primary" <?php generate_content_class(); ?>>
- <main id="main" <?php generate_main_class(); ?>>
- <!-- *************************************************************************************** -->
- <!-- ************************** TEACHER PROFILE cpt-teacher-profile ************************ -->
- <!-- *************************************************************************************** -->
- <?php $user_role = get_queried_object()->roles; ?>
- <?php if( in_array( strtolower('Teacher'), $user_role ) ) { ?>
- <?php /* Display all the author's posts from the custom post type (teacher-profile) */ ?>
- <?php
- $authorid = get_the_author_meta( ID, $userID );
- $args=array('author' => $authorid,'post_type' => 'teacher-profile', 'numberposts' => 1);
- $cquery=new WP_Query($args);
- if($cquery->have_posts()):
- while($cquery->have_posts()):
- $cquery->the_post();
- ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'BlogPosting' ); ?>>
- <div class="inside-article homeheader">
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
- <!-- sandgroper -->
- <ins class="adsbygoogle"
- style="display:block"
- data-ad-client="ca-pub-3761760999645154"
- data-ad-slot="4393725687"
- data-ad-format="auto"></ins>
- <script>
- (adsbygoogle = window.adsbygoogle || []).push({});
- </script><br />
- </div>
- </article>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="inside-article">
- <h1 class="page-title"><?php echo get_the_author(); ?></h1>
- <ul>
- <li><strong>Gender:</strong> <?php if(has_term('', 'teacher-gender')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-gender', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>Date of Birth:</strong> <?php if( get_post_meta($post->ID, "teacher-dob", true) ): ?><?php echo get_post_meta($post->ID, "teacher-dob", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>Phone:</strong> <?php if( get_post_meta($post->ID, "teacher-phone", true) ): ?><?php echo get_post_meta($post->ID, "teacher-phone", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>Email:</strong> <?php if( get_post_meta($post->ID, "teacher-email", true) ): ?><?php echo get_post_meta($post->ID, "teacher-email", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>Address:</strong> <?php if( get_post_meta($post->ID, "teacher-address", true) ): ?><?php echo get_post_meta($post->ID, "teacher-address", true); ?><?php else: ?><?php endif; ?> <?php if(has_term('', 'teacher-suburb')) {?><?php echo strip_tags(get_the_term_list( $post->ID, 'teacher-suburb', ' ',', ')); ?><?php } else { ?><?php }?> <?php if(has_term('', 'teacher-other-suburb')) {?><?php echo get_the_term_list( $post->ID, 'teacher-other-suburb', ' ',', '); ?><?php } else { ?><?php }?> <?php if(has_term('', 'teacher-state')) {?><?php echo strip_tags(get_the_term_list( $post->ID, 'teacher-state', ' ',', ')); ?><?php } else { ?><?php }?> <?php if( get_post_meta($post->ID, "teacher-postcode", true) ): ?><?php echo get_post_meta($post->ID, "teacher-postcode", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>Grades/Years:</strong> <?php if(has_term('', 'teacher-year-level')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-year-level', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>Learning Areas:</strong> <?php if(has_term('', 'teacher-learning-area')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-learning-area', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>Qualifications:</strong> <?php if(has_term('', 'teacher-qualifications')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-qualifications', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <?php $value = get_post_meta($post->ID, 'teacher-qualifications', true); ?>
- <?php if($value == 'other') { ?>
- <li><strong>Other Qualifications:</strong> <?php if( get_post_meta($post->ID, "teacher-other-qualification", true) ): ?><?php echo get_post_meta($post->ID, "teacher-other-qualification", true); ?><?php else: ?><?php endif; ?></li>
- <?php } elseif($value == 'XXXXX') { ?>
- XXXXX
- <?php } else { ?>
- <?php } ?>
- <li><strong>Employment History:</strong> <?php the_content(); ?></li>
- <li><strong>Skills:</strong> <?php if( get_post_meta($post->ID, "teacher-skills", true) ): ?><?php echo get_post_meta($post->ID, "teacher-skills", true); ?><?php else: ?><?php endif; ?></li>
- </ul>
- <h2>Teacher Registration</h2>
- <ul>
- <li><strong>TRBWA ID:</strong> <?php if( get_post_meta($post->ID, "teacher-trbwa", true) ): ?><?php echo get_post_meta($post->ID, "teacher-trbwa", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>WWCC ID:</strong> <?php if( get_post_meta($post->ID, "teacher-wwcc", true) ): ?><?php echo get_post_meta($post->ID, "teacher-wwcc", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>WWCC expiry date:</strong> <?php if( get_post_meta($post->ID, "teacher-wwcc-date", true) ): ?><?php echo get_post_meta($post->ID, "teacher-wwcc-date", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>E Number:</strong> <?php if( get_post_meta($post->ID, "teacher-enumber", true) ): ?><?php echo get_post_meta($post->ID, "teacher-enumber", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>NPHC:</strong> <?php if(has_term('', 'teacher-nphc')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-nphc', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>SCN:</strong> <?php if( get_post_meta($post->ID, "teacher-scn", true) ): ?><?php echo get_post_meta($post->ID, "teacher-scn", true); ?><?php else: ?><?php endif; ?></li>
- </ul>
- <h2>Seeking</h2>
- <ul>
- <li><strong>Employment Status:</strong> <?php if(has_term('', 'teacher-job-status')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-job-status', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>School Type:</strong> <?php if(has_term('', 'teacher-school-type')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-school-type', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>Availability:</strong> <?php if(has_term('', 'teacher-availability')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-availability', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <?php /***
- <li>First day: <?php the_date('l jS F Y'); ?></li>
- <li>Last Day: <?php $date = get_post_meta($post->ID, 'date-time-last', true); if($date != ''){echo date("l jS F Y", strtotime($date));} ?></li>
- ***/ ?>
- </ul>
- </div>
- </article><!-- #post-## -->
- <?
- endwhile;
- wp_reset_postdata();
- endif;
- ?>
- <?php } elseif( in_array( strtolower('School'), $user_role ) ) { ?>
- <!-- school -->
- <?php } ?>
- <!-- *************************************************************************************** -->
- <!-- ************************** SCHOOL NAME ************************** -->
- <!-- *************************************************************************************** -->
- <?php $user_role = get_queried_object()->roles; ?>
- <?php if( in_array( strtolower('Teacher'), $user_role ) ) { ?>
- <!-- teacher -->
- <?php } elseif( in_array( strtolower('School'), $user_role ) ) { ?>
- <?php /* Display all the author's posts from the custom post type (school profile) */ ?>
- <?php
- $authorid = get_the_author_meta( ID, $userID );
- $args4=array('author'=>$authorid,'post_type'=>'school_profile', 'numberposts'=> 1);
- $cquery4=new WP_Query($args4);
- if($cquery4->have_posts()):
- while($cquery4->have_posts()):
- $cquery4->the_post();
- ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="inside-article">
- <h1 class="page-title"><?php the_title(); ?></h1>
- </div>
- </article><!-- #post-## -->
- <?
- endwhile;
- wp_reset_postdata();
- endif;
- ?>
- <?php } ?>
- <!-- *************************************************************************************** -->
- <!-- ************************** AUTHOR META ************************************************ -->
- <!-- *************************************************************************************** -->
- <?php $user_role = get_queried_object()->roles; ?>
- <?php if( in_array( strtolower('Teacher'), $user_role ) ) { ?>
- <!-- teacher -->
- <?php } elseif( in_array( strtolower('School'), $user_role ) ) { ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="inside-article">
- <div class="author-description">
- <?php /** <h1 class="page-title"> echo get_the_author(); </h1> **/ ?>
- <p class="author-bio" style="overflow:hidden">
- <span style="float:left;padding:0px 10px 5px 0px;"><?php echo get_avatar( get_the_author_meta( 'ID' ), 75 ); ?></span>
- <?php the_author_meta( 'description' ); ?>
- </p>
- <p style="text-align:center;"><?php the_author(); ?> has posted <?php the_author_posts(); ?> jobs</p>
- </div>
- <p style="float:right;"><?php fav_authors_link(); ?></p>
- <?php /**
- <p><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author">Subscribe to Jobs</a></p>
- **/ ?>
- <p style="float:left;"><?php echo do_shortcode('[subscribe-author-button]'); ?></p>
- </div>
- </article>
- <?php } ?>
- <!-- *************************************************************************************** -->
- <!-- ************************** SCHOOL PROFILE cpt-school_profile ************************** -->
- <!-- *************************************************************************************** -->
- <?php $user_role = get_queried_object()->roles; ?>
- <?php if( in_array( strtolower('Teacher'), $user_role ) ) { ?>
- <!-- teacher -->
- <?php } elseif( in_array( strtolower('School'), $user_role ) ) { ?>
- <?php /* Display all the author's posts from the custom post type (school profile) */ ?>
- <?php
- $authorid = get_the_author_meta( ID, $userID );
- $args4=array('author'=>$authorid,'post_type'=>'school_profile', 'numberposts'=> 1);
- $cquery4=new WP_Query($args4);
- if($cquery4->have_posts()):
- while($cquery4->have_posts()):
- $cquery4->the_post();
- ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="inside-article">
- <h1 class="page-title"><?php the_title(); ?></h1>
- <ul>
- <br />
- <li><strong>Address:</strong> <?php if( get_post_meta($post->ID, "school-street", true) ): ?><?php echo get_post_meta($post->ID, "school-street", true); ?><?php else: ?><?php endif; ?> <?php if(has_term('', 'school-suburb')) {?><?php echo strip_tags(get_the_term_list( $post->ID, 'school-suburb', ' ',', ')); ?><?php } else { ?><?php }?> <?php if(has_term('', 'school-other-suburb')) {?><?php echo get_the_term_list( $post->ID, 'school-other-suburb', ' ',', '); ?><?php } else { ?><?php }?> <?php if(has_term('', 'school-state')) {?><?php echo strip_tags(get_the_term_list( $post->ID, 'school-state', ' ',', ')); ?><?php } else { ?><?php }?> <?php if( get_post_meta($post->ID, "school-postcode", true) ): ?><?php echo get_post_meta($post->ID, "school-postcode", true); ?><?php else: ?><?php endif; ?><br /><br /></li>
- <li><strong>Phone:</strong> <?php if( get_post_meta($post->ID, "school-phone", true) ): ?><a href="tel:<?php echo get_post_meta($post->ID, "school-phone", true); ?>"><?php echo get_post_meta($post->ID, "school-phone", true); ?></a><?php else: ?><?php endif; ?></li>
- <li><strong>Mobile:</strong> <?php if( get_post_meta($post->ID, "school-mobile", true) ): ?><a href="tel:<?php echo get_post_meta($post->ID, "school-mobile", true); ?>"><?php echo get_post_meta($post->ID, "school-mobile", true); ?></a><?php else: ?><?php endif; ?></li>
- <li><strong>School contact:</strong> <?php if( get_post_meta($post->ID, "school-contact", true) ): ?><?php echo get_post_meta($post->ID, "school-contact", true); ?><?php else: ?><?php endif; ?><br /><br /></li>
- <li><strong>Email:</strong> <?php if( get_post_meta($post->ID, "school-email", true) ): ?><?php echo get_post_meta($post->ID, "school-email", true); ?><?php else: ?><?php endif; ?></li>
- <li><strong>Website:</strong> <?php if( get_post_meta($post->ID, "school-website", true) ): ?><a href="http://<?php echo get_post_meta($post->ID, "school-website", true); ?>"><?php echo get_post_meta($post->ID, "school-website", true); ?></a><?php else: ?><?php endif; ?><br /><br /></li>
- <li><strong>Grades/Years:</strong> <?php if(has_term('', 'school-year-level')) {?>
- <?php
- $taxonomy = 'school-year-level';
- $args = array('orderby' => 'slug', 'order' => 'ASC', 'fields' => 'all');
- $product_terms = wp_get_object_terms( $post->ID, $taxonomy, $args );
- if ( ! empty( $product_terms ) && ! is_wp_error( $product_terms ) ) {
- $terms = array();
- foreach( $product_terms as $term ) {
- $terms[] = esc_html( $term->name );
- }
- echo join( ', ', $terms );
- }
- ?>
- <?php } else { ?><?php }?>
- </li>
- <li><strong>Learning Areas:</strong> <?php if(has_term('', 'school-learning-areas')) {?><?php echo strip_tags (get_the_term_list( $post->ID, 'school-learning-areas', ' ',', ')); ?><?php } else { ?><?php }?></li>
- <li><strong>Information:</strong> <?php the_content(); ?></li>
- </ul>
- <small style="color:#555;">Sandgroper ID: #<?php the_author_meta('ID'); ?></small>
- </div>
- </article><!-- #post-## -->
- <?
- endwhile;
- wp_reset_postdata();
- endif;
- ?>
- <?php } ?>
- <!-- *************************************************************************************** -->
- <!-- ************************** SCHOOL JOBS cpt-post *************************************** -->
- <!-- *************************************************************************************** -->
- <?php $user_role = get_queried_object()->roles; ?>
- <?php if( in_array( strtolower('Teacher'), $user_role ) ) { ?>
- <!-- teacher -->
- <?php } elseif( in_array( strtolower('School'), $user_role ) ) { ?>
- <?php
- $authorid = get_the_author_meta( ID, $userID );
- $args3=array('author'=>$authorid,'post_type'=>'post', 'numberposts'=> -1, 'order' => 'ASC');
- $cquery3=new WP_Query($args3);
- if($cquery3->have_posts()):
- while($cquery3->have_posts()):
- $cquery3->the_post();
- ?>
- <?php $value = get_post_meta($post->ID, 'comment_status', true); ?>
- <?php if($value == 'Open') { ?>
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'BlogPosting' ); ?>>
- <div class="inside-article">
- <?php do_action( 'generate_before_content'); ?>
- <header class="entry-header">
- <?php $value = get_post_meta($post->ID, 'school-job-status', true); ?>
- <?php if($value == 'Open') { ?>
- <p><?php the_title(); ?></p>
- <small style="color:#333;"><?php if(has_term('', 'school-job-duration')) {?><?php echo strip_tags( get_the_term_list( $post->ID, 'school-job-duration', ' ',', ')); ?><?php } else { ?><?php }?><?php if(has_term('', 'school-job-year-level')) {?> · year <?php echo strip_tags( get_the_term_list( $post->ID, 'school-job-year-level', ' ',', ')); ?><?php } else { ?><?php }?><?php if(has_term('', 'school-job-learning-area')) {?> · <?php echo strip_tags(get_the_term_list( $post->ID, 'school-job-learning-area', ' ',', ')); ?><?php } else { ?><?php }?></small>
- <?php } elseif($value == 'Close') { ?>
- <p style="text-decoration:line-through;"><?php the_title(); ?><br />
- <small style="color:#333;"><?php if(has_term('', 'school-job-duration')) {?><?php echo strip_tags( get_the_term_list( $post->ID, 'school-job-duration', ' ',', ')); ?><?php } else { ?> 1 day<?php }?><?php if(has_term('', 'school-job-year-level')) {?> · year <?php echo strip_tags( get_the_term_list( $post->ID, 'school-job-year-level', ' ',', ')); ?><?php } else { ?><?php }?><?php if(has_term('', 'school-job-learning-area')) {?> · <?php echo strip_tags(get_the_term_list( $post->ID, 'school-job-learning-area', ' ',', ')); ?><?php } else { ?><?php }?></small></p>
- <?php /*** if ( 'post' == get_post_type() ) : ?>
- <p>by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></p>
- <?php endif; ****/ ?>
- <p style="font-weight:700;color:red;">This job is closed and no longer available</p>
- <?php } else { ?><?php } ?>
- <?php /*** if ( 'post' == get_post_type() ) : ?>
- <p>by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></p>
- <?php endif; ****/ ?>
- </header><!-- .entry-header -->
- <?php do_action( 'generate_after_entry_header'); ?>
- <?php do_action( 'generate_after_entry_content'); ?>
- <!-- <footer class="entry-meta">
- <?php /**** generate_entry_meta(); ****/ ?>
- </footer>.entry-meta -->
- <?php do_action( 'generate_after_content'); ?>
- </div><!-- .inside-article -->
- </article><!-- #post-## -->
- </a>
- <?php } elseif($value == 'Close') { ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'BlogPosting' ); ?>>
- <div class="inside-article">
- <?php do_action( 'generate_before_content'); ?>
- <header class="entry-header">
- <p style="text-decoration:line-through;"><?php the_title(); ?></p>
- <?php /*** if ( 'post' == get_post_type() ) : ?>
- <p>by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></p>
- <?php endif; ****/ ?>
- <p style="font-weight:700;color:red;">This job is closed and no longer available</p>
- </header><!-- .entry-header -->
- <?php do_action( 'generate_after_entry_header'); ?>
- <?php do_action( 'generate_after_entry_content'); ?>
- <!-- <footer class="entry-meta">
- <?php /**** generate_entry_meta(); ****/ ?>
- </footer>.entry-meta -->
- <?php do_action( 'generate_after_content'); ?>
- </div><!-- .inside-article -->
- </article><!-- #post-## -->
- <?php } else { ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'BlogPosting' ); ?>>
- <div class="inside-article">
- <?php do_action( 'generate_before_content'); ?>
- <header class="entry-header">
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><p><?php the_title(); ?></p></a>
- <?php /*** if ( 'post' == get_post_type() ) : ?>
- <p>by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></p>
- <?php endif; ****/ ?>
- <p style="font-weight:700;color:red;">We are unsure of the status of this job, please contact <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a> for more information</p>
- </header><!-- .entry-header -->
- <?php do_action( 'generate_after_entry_header'); ?>
- <?php do_action( 'generate_after_entry_content'); ?>
- <!-- <footer class="entry-meta">
- <?php /**** generate_entry_meta(); ****/ ?>
- </footer>.entry-meta -->
- <?php do_action( 'generate_after_content'); ?>
- </div><!-- .inside-article -->
- </article><!-- #post-## -->
- <?php } ?>
- <?
- endwhile;
- wp_reset_postdata();
- endif;
- ?>
- <?php } ?>
- <!-- *************************************************************************************** -->
- <!-- ************************** TEACHER availability *************************************** -->
- <!-- *************************************************************************************** -->
- <?php
- $authorid = get_the_author_meta( ID, $userID );
- $args2=array('author'=>$authorid,'post_type'=>'teacher-profile', 'numberposts'=>1);
- $cquery2=new WP_Query($args2);
- if($cquery2->have_posts()):
- while($cquery2->have_posts()):
- $cquery2->the_post();
- ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="inside-article">
- <h2>Availability</h2>
- <?php if(has_term('', 'teacher-availability')) {?>
- <p><?php echo strip_tags (get_the_term_list( $post->ID, 'teacher-availability', ' ',', ')); ?></p>
- <?php } else { ?>
- <?php }?>
- </div>
- </article><!-- #post-## -->
- <?
- endwhile;
- wp_reset_postdata();
- endif;
- ?>
- </main><!-- #main -->
- </section><!-- #primary -->
- <?php } ?>
- <?php
- do_action('generate_sidebars');
- get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement