Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Full-width Resume Page
- * Description: A full-width template with resume and no sidebar
- *
- * @package WordPress
- * @subpackage Portfolio Press
- */
- ?>
- <script type="text/javascript">
- //CONFIGURATION
- collapsedImage='<?php echo get_template_directory_uri(); ?>/images/plusbox.png'; //image to show when lists are collapsed
- expandedImage='<?php echo get_template_directory_uri(); ?>/images/minusbox.png'; //image to show when lists are expanded
- defaultState=0; //1 = show, 0 = hide
- /* makeCollapsible - makes a list have collapsible sublists
- *
- * listElement - the element representing the list to make collapsible
- */
- function makeCollapsible(listElement,listState){
- if(listState!=null) defaultState=listState;
- // removed list item bullets and the sapce they occupy
- listElement.style.listStyle='none';
- listElement.style.marginLeft='0';
- listElement.style.paddingLeft='0';
- // loop over all child elements of the list
- var child=listElement.firstChild;
- while (child!=null){
- // only process li elements (and not text elements)
- if (child.nodeType==1){
- // build a list of child ol and ul elements and show/hide them
- var list=new Array();
- var grandchild=child.firstChild;
- while (grandchild!=null){
- if (grandchild.tagName=='OL' || grandchild.tagName=='UL'){
- if(defaultState==0) grandchild.style.display='block';
- else grandchild.style.display='none';
- list.push(grandchild);
- }
- grandchild=grandchild.nextSibling;
- }
- // add toggle buttons
- if(defaultState==0) {
- var node=document.createElement('img');
- node.setAttribute('src',expandedImage);
- node.setAttribute('class','collapsibleOpen');
- node.onclick=createToggleFunction(node,list);
- child.insertBefore(node,child.firstChild);
- } else {
- var node=document.createElement('img');
- node.setAttribute('src',collapsedImage);
- node.setAttribute('class','collapsibleClosed');
- node.onclick=createToggleFunction(node,list);
- child.insertBefore(node,child.firstChild);
- }
- }
- child=child.nextSibling;
- }
- }
- /* createToggleFunction - returns a function that toggles the sublist display
- *
- * toggleElement - the element representing the toggle gadget
- * sublistElement - an array of elements representing the sublists that should
- * be opened or closed when the toggle gadget is clicked
- */
- function createToggleFunction(toggleElement,sublistElements){
- return function(){
- // toggle status of toggle gadget
- if (toggleElement.getAttribute('class')=='collapsibleClosed'){
- toggleElement.setAttribute('class','collapsibleOpen');
- toggleElement.setAttribute('src',expandedImage);
- }else{
- toggleElement.setAttribute('class','collapsibleClosed');
- toggleElement.setAttribute('src',collapsedImage);
- }
- // toggle display of sublists
- for (var i=0;i<sublistElements.length;i++){
- sublistElements[i].style.display=
- (sublistElements[i].style.display=='block')?'none':'block';
- }
- }
- }
- </script>
- <script type="text/javascript"><!--
- if (window.addEventListener) {
- window.addEventListener("load", function(){makeCollapsible(document.getElementById('listCategories'), 1);}, false);
- } else if (window.attachEvent) {
- window.attachEvent("onload", function(){makeCollapsible(document.getElementById('listCategories'), 1);});
- } else {
- window.onload = function(){makeCollapsible(document.getElementById('listCategories'), 1);};
- }
- -->
- </script>
- <?php get_header(); ?>
- <div id="primary" class="full-width">
- <div id="content">
- <?php the_post(); ?>
- <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/resume.css" media="all" />
- <?php
- $name = get_post_meta($post->ID, 'name', true);
- $name_title = get_post_meta($post->ID, 'name_title', true);
- $e_mail = get_post_meta($post->ID, 'e-mail', true);
- $phone = get_post_meta($post->ID, 'phone', true);
- $profile_title = get_post_meta($post->ID, 'profile_title', true);
- $profile = get_post_meta($post->ID, 'profile', true);
- $skills_title = get_post_meta($post->ID, 'skills_title', true);
- $technical_title = get_post_meta($post->ID, 'technical_title', true);
- $technical_skills2 = get_post_meta($post->ID, 'technical_skills2', true);
- $experience_title = get_post_meta($post->ID, 'experience_title', true);
- $education_title = get_post_meta($post->ID, 'education_title', true);
- $education= get_post_meta($post->ID, 'education', true);
- ?>
- <div id="doc2" class="yui-t7">
- <div id="inner">
- <div id="hd">
- <div class="yui-gc">
- <div class="yui-u first">
- <h1><?php echo $name; ?></h1>
- <h2><?php echo $name_title; ?></h2>
- </div>
- <div class="yui-u">
- <div class="contact-info">
- <h3><a href="mailto:<?php echo $e_mail; ?>"><?php echo $e_mail; ?></a></h3>
- <h3><?php echo $phone; ?></h3>
- </div><!--// .contact-info -->
- </div>
- </div><!--// .yui-gc -->
- </div><!--// hd -->
- <div id="bd">
- <div id="yui-main">
- <div class="yui-b">
- <div class="yui-gf">
- <div class="yui-u first">
- <h2><?php echo $profile_title; ?></h2>
- </div>
- <div class="yui-u">
- <p class="enlarge">
- <?php echo $profile; ?>
- </p>
- </div>
- </div><!--// .yui-gf -->
- <?php
- $args_skills = array( 'post_type' => 'resume', 'department' => 'skills' );
- $loop_skills = new WP_Query( $args_skills );
- ?>
- <div class="yui-gf">
- <div class="yui-u first">
- <h2><?php echo $skills_title; ?></h2>
- </div>
- <div class="yui-u">
- <?php while ( $loop_skills->have_posts() ) : $loop_skills->the_post(); ?>
- <div class="talent">
- <h2><?php the_title(); ?></h2>
- <p><?php the_content(); ?></p>
- </div>
- <?php endwhile; ?>
- </div>
- </div><!--// .yui-gf -->
- <div class="yui-gf">
- <div class="yui-u first">
- <h2><?php echo $technical_title; ?></h2>
- </div>
- <div class="yui-u">
- <ul class="technical">
- <h4>Software: </h4>
- <ul id="listCategories">
- <?php
- //list terms in a given taxonomy using wp_list_categories
- $argssoftware = array(
- 'taxonomy' => 'applications',
- 'orderby' => 'name',
- 'hide_empty' => 0,
- 'show_count' => 1,
- 'pad_counts' => 1,
- 'hierarchical' => 1,
- 'title_li' => ''
- );
- ?>
- <?php wp_list_categories( $argssoftware ); ?>
- </ul>
- </ul>
- <ul class="technical">
- <h4>Code: </h4>
- <ul id="listCategories">
- <?php
- //list terms in a given taxonomy using wp_list_categories
- $argscode = array(
- 'taxonomy' => 'code',
- 'orderby' => 'name',
- 'hide_empty' => 0,
- 'show_count' => 1,
- 'pad_counts' => 1,
- 'hierarchical' => 1,
- 'title_li' => ''
- );
- ?>
- <?php wp_list_categories( $argscode ); ?>
- </ul>
- </ul>
- </div>
- </div><!--// .yui-gf-->
- <?php
- $args_experience = array( 'post_type' => 'resume', 'department' => 'experience' );
- $loop_experience = new WP_Query( $args_experience );
- $args_education = array( 'post_type' => 'resume', 'department' => 'education' );
- $loop_education = new WP_Query( $args_education );
- ?>
- <?php $prod_cats = get_terms('department');
- foreach ($prod_cats as $prod_cat) {
- $cat_name = $prod_cat->name; ?>
- <?php $loop = new WP_Query( array( 'post_type' => 'resume', 'department' => $cat_name ) ); ?>
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <div class="yui-gf">
- <div class="yui-u first">
- <h2><?php echo get_the_term_list( $post->ID, 'department', '', ' ', '' ); ?></h2>
- </div><!--// .yui-u -->
- <div class="yui-u" >
- <div class="job">
- <h2><?php echo get_the_term_list( $post->ID, 'organization', '', ' ', '' ); ?></h2>
- <h3><?php the_title(); ?></h3>
- <h4><?php echo get_the_term_list( $post->ID, 'timeperiod', '', ' ', '' ); ?></h4>
- <p><?php the_content(); ?></p>
- </div>
- </div><!--// .yui-u -->
- </div><!--// .yui-gf -->
- <?php endwhile; ?>
- <br clear="all" />
- <br clear="all" />
- <?php wp_reset_query(); ?>
- <?php rewind_posts(); ?>
- <?php } ?>
- <div class="yui-gf">
- <div class="yui-u first">
- <h2>Education</h2>
- </div>
- <div class="yui-u">
- <?php while ( $loop_education->have_posts() ) : $loop_education->the_post(); ?>
- <div class="job">
- <h2><?php echo get_the_term_list( $post->ID, 'organization', '', ' ', '' ); ?></h2>
- <h3><?php the_title(); ?></h3>
- <h4><?php echo get_the_term_list( $post->ID, 'timeperiod', '', ' ', '' ); ?></h4>
- <p><?php the_content(); ?></p>
- </div>
- <?php endwhile; ?>
- </div><!--// .yui-u -->
- </div><!--// .yui-gf -->
- </div><!--// .yui-b -->
- </div><!--// yui-main -->
- </div><!--// bd -->
- </div><!-- // inner -->
- </div><!--// doc -->
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement