Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 9.27 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Full-width Resume Page
  4. * Description: A full-width template with resume and no sidebar
  5. *
  6. * @package WordPress
  7. * @subpackage Portfolio Press
  8. */
  9. ?>
  10.  
  11. <script type="text/javascript">
  12. //CONFIGURATION
  13. collapsedImage='<?php echo get_template_directory_uri(); ?>/images/plusbox.png';    //image to show when lists are collapsed
  14. expandedImage='<?php echo get_template_directory_uri(); ?>/images/minusbox.png';    //image to show when lists are expanded
  15. defaultState=0; //1 = show, 0 = hide
  16. /* makeCollapsible - makes a list have collapsible sublists
  17.  *
  18.  * listElement - the element representing the list to make collapsible
  19.  */
  20. function makeCollapsible(listElement,listState){
  21.   if(listState!=null) defaultState=listState;
  22.  
  23.   // removed list item bullets and the sapce they occupy
  24.   listElement.style.listStyle='none';
  25.   listElement.style.marginLeft='0';
  26.   listElement.style.paddingLeft='0';
  27.  
  28.   // loop over all child elements of the list
  29.   var child=listElement.firstChild;
  30.   while (child!=null){
  31.  
  32.     // only process li elements (and not text elements)
  33.     if (child.nodeType==1){
  34.  
  35.       // build a list of child ol and ul elements and show/hide them
  36.       var list=new Array();
  37.       var grandchild=child.firstChild;
  38.       while (grandchild!=null){
  39.         if (grandchild.tagName=='OL' || grandchild.tagName=='UL'){
  40.           if(defaultState==0) grandchild.style.display='block';
  41.           else grandchild.style.display='none';
  42.           list.push(grandchild);
  43.         }
  44.         grandchild=grandchild.nextSibling;
  45.       }
  46.  
  47.       // add toggle buttons
  48.       if(defaultState==0) {
  49.           var node=document.createElement('img');
  50.           node.setAttribute('src',expandedImage);
  51.           node.setAttribute('class','collapsibleOpen');
  52.           node.onclick=createToggleFunction(node,list);
  53.           child.insertBefore(node,child.firstChild);
  54.       } else {
  55.           var node=document.createElement('img');
  56.           node.setAttribute('src',collapsedImage);
  57.           node.setAttribute('class','collapsibleClosed');
  58.           node.onclick=createToggleFunction(node,list);
  59.           child.insertBefore(node,child.firstChild);
  60.       }
  61.     }
  62.  
  63.     child=child.nextSibling;
  64.   }
  65.  
  66. }
  67.  
  68. /* createToggleFunction - returns a function that toggles the sublist display
  69.  *
  70.  * toggleElement  - the element representing the toggle gadget
  71.  * sublistElement - an array of elements representing the sublists that should
  72.  *                  be opened or closed when the toggle gadget is clicked
  73.  */
  74. function createToggleFunction(toggleElement,sublistElements){
  75.  
  76.   return function(){
  77.  
  78.     // toggle status of toggle gadget
  79.     if (toggleElement.getAttribute('class')=='collapsibleClosed'){
  80.       toggleElement.setAttribute('class','collapsibleOpen');
  81.       toggleElement.setAttribute('src',expandedImage);
  82.     }else{
  83.       toggleElement.setAttribute('class','collapsibleClosed');
  84.       toggleElement.setAttribute('src',collapsedImage);
  85.     }
  86.  
  87.     // toggle display of sublists
  88.     for (var i=0;i<sublistElements.length;i++){
  89.      sublistElements[i].style.display=
  90.          (sublistElements[i].style.display=='block')?'none':'block';
  91.    }
  92.  
  93.  }
  94.  
  95. }
  96. </script>
  97. <script type="text/javascript"><!--
  98. if (window.addEventListener) {
  99. window.addEventListener("load", function(){makeCollapsible(document.getElementById('listCategories'), 1);}, false);
  100. } else if (window.attachEvent) {
  101. window.attachEvent("onload", function(){makeCollapsible(document.getElementById('listCategories'), 1);});
  102. } else {
  103. window.onload = function(){makeCollapsible(document.getElementById('listCategories'), 1);};
  104. }
  105. -->
  106. </script>
  107.  
  108. <?php get_header(); ?>
  109.  
  110.         <div id="primary" class="full-width">
  111.             <div id="content">
  112.  
  113.                 <?php the_post(); ?>
  114.  
  115. <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/resume.css" media="all" />
  116.  
  117. <?php
  118. $name = get_post_meta($post->ID, 'name', true);
  119. $name_title = get_post_meta($post->ID, 'name_title', true);
  120. $e_mail = get_post_meta($post->ID, 'e-mail', true);
  121. $phone = get_post_meta($post->ID, 'phone', true);
  122. $profile_title = get_post_meta($post->ID, 'profile_title', true);
  123. $profile = get_post_meta($post->ID, 'profile', true);
  124. $skills_title = get_post_meta($post->ID, 'skills_title', true);
  125. $technical_title = get_post_meta($post->ID, 'technical_title', true);
  126. $technical_skills2 = get_post_meta($post->ID, 'technical_skills2', true);
  127. $experience_title = get_post_meta($post->ID, 'experience_title', true);
  128. $education_title = get_post_meta($post->ID, 'education_title', true);
  129. $education= get_post_meta($post->ID, 'education', true);
  130. ?>
  131.  
  132. <div id="doc2" class="yui-t7">
  133.     <div id="inner">
  134.    
  135.         <div id="hd">      
  136.             <div class="yui-gc">
  137.                 <div class="yui-u first">
  138.                     <h1><?php echo $name; ?></h1>
  139.                     <h2><?php echo $name_title; ?></h2>
  140.                 </div>
  141.  
  142.                 <div class="yui-u">
  143.                     <div class="contact-info">
  144.                         <h3><a href="mailto:<?php echo $e_mail; ?>"><?php echo $e_mail; ?></a></h3>
  145.                         <h3><?php echo $phone; ?></h3>
  146.                     </div><!--// .contact-info -->
  147.                 </div>
  148.             </div><!--// .yui-gc -->
  149.         </div><!--// hd -->
  150.  
  151.         <div id="bd">
  152.             <div id="yui-main">
  153.                 <div class="yui-b">
  154.  
  155.                     <div class="yui-gf">
  156.                         <div class="yui-u first">
  157.                             <h2><?php echo $profile_title; ?></h2>
  158.                         </div>
  159.                         <div class="yui-u">
  160.                             <p class="enlarge">
  161.                                 <?php echo $profile; ?>
  162.                             </p>
  163.                         </div>
  164.                     </div><!--// .yui-gf -->
  165.                    
  166. <?php
  167. $args_skills = array( 'post_type' => 'resume', 'department' => 'skills' );
  168. $loop_skills = new WP_Query( $args_skills );
  169. ?>
  170.  
  171.                     <div class="yui-gf">
  172.                         <div class="yui-u first">
  173.                             <h2><?php echo $skills_title; ?></h2>
  174.                         </div>
  175.                         <div class="yui-u">
  176.                             <?php while ( $loop_skills->have_posts() ) : $loop_skills->the_post(); ?>
  177.                                 <div class="talent">
  178.                                     <h2><?php the_title(); ?></h2>
  179.                                     <p><?php the_content(); ?></p>
  180.                                     </div>
  181.                             <?php endwhile; ?>
  182.                         </div>
  183.                     </div><!--// .yui-gf -->
  184.  
  185.                     <div class="yui-gf">
  186.                         <div class="yui-u first">
  187.                             <h2><?php echo $technical_title; ?></h2>
  188.                         </div>
  189.                         <div class="yui-u">
  190.                             <ul class="technical">
  191.                                 <h4>Software: </h4>
  192.                                 <ul id="listCategories">
  193.                                 <?php
  194.                                 //list terms in a given taxonomy using wp_list_categories  
  195.                                 $argssoftware = array(
  196.                                     'taxonomy'     => 'applications',
  197.                                     'orderby'      => 'name',
  198.                                     'hide_empty'   => 0,
  199.                                     'show_count'   => 1,
  200.                                     'pad_counts'   => 1,
  201.                                     'hierarchical' => 1,
  202.                                     'title_li'     => ''
  203.                                 );
  204.                                 ?>
  205.                                 <?php wp_list_categories( $argssoftware ); ?>
  206.                             </ul>
  207.                             </ul>
  208.  
  209.                             <ul class="technical">
  210.                                 <h4>Code: </h4>
  211.                                 <ul id="listCategories">
  212.                                 <?php
  213.                                 //list terms in a given taxonomy using wp_list_categories  
  214.                                 $argscode = array(
  215.                                     'taxonomy'     => 'code',
  216.                                     'orderby'      => 'name',
  217.                                     'hide_empty'   => 0,
  218.                                     'show_count'   => 1,
  219.                                     'pad_counts'   => 1,
  220.                                     'hierarchical' => 1,
  221.                                     'title_li'     => ''
  222.                                 );
  223.                                 ?>
  224.                                 <?php wp_list_categories( $argscode ); ?>
  225.                             </ul>
  226.                             </ul>
  227.                         </div>
  228.                     </div><!--// .yui-gf-->
  229.  
  230. <?php
  231. $args_experience = array( 'post_type' => 'resume', 'department' => 'experience' );
  232. $loop_experience = new WP_Query( $args_experience );
  233. $args_education = array( 'post_type' => 'resume', 'department' => 'education' );
  234. $loop_education = new WP_Query( $args_education );
  235. ?>
  236.  
  237. <?php $prod_cats = get_terms('department');
  238.   foreach ($prod_cats as $prod_cat) {
  239.      $cat_name = $prod_cat->name; ?>
  240.  
  241.                     <?php $loop = new WP_Query( array( 'post_type' => 'resume', 'department' => $cat_name ) ); ?>
  242.                     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  243.                     <div class="yui-gf">
  244.                         <div class="yui-u first">
  245.                             <h2><?php echo get_the_term_list( $post->ID, 'department', '', ' ', '' ); ?></h2>
  246.                         </div><!--// .yui-u -->
  247.                         <div class="yui-u" >
  248.                                 <div class="job">
  249.                                     <h2><?php echo get_the_term_list( $post->ID, 'organization', '', ' ', '' ); ?></h2>
  250.                                     <h3><?php the_title(); ?></h3>
  251.                                     <h4><?php echo get_the_term_list( $post->ID, 'timeperiod', '', ' ', '' ); ?></h4>  
  252.                                     <p><?php the_content(); ?></p>
  253.                                 </div>
  254.                         </div><!--// .yui-u -->
  255.                     </div><!--// .yui-gf -->
  256.                     <?php endwhile; ?>
  257.                     <br clear="all" />
  258.                     <br clear="all" />
  259.                     <?php wp_reset_query(); ?>
  260.                     <?php rewind_posts(); ?>
  261.                     <?php } ?>
  262.                
  263.                     <div class="yui-gf">
  264.                         <div class="yui-u first">
  265.                             <h2>Education</h2>
  266.                         </div>
  267.                         <div class="yui-u">
  268.                             <?php while ( $loop_education->have_posts() ) : $loop_education->the_post(); ?>
  269.                                 <div class="job">
  270.                                     <h2><?php echo get_the_term_list( $post->ID, 'organization', '', ' ', '' ); ?></h2>
  271.                                     <h3><?php the_title(); ?></h3>
  272.                                     <h4><?php echo get_the_term_list( $post->ID, 'timeperiod', '', ' ', '' ); ?></h4>  
  273.                                     <p><?php the_content(); ?></p>
  274.                                 </div>
  275.                             <?php endwhile; ?>
  276.                         </div><!--// .yui-u -->
  277.                     </div><!--// .yui-gf -->
  278.  
  279.                 </div><!--// .yui-b -->
  280.             </div><!--// yui-main -->
  281.         </div><!--// bd -->
  282.     </div><!-- // inner -->
  283. </div><!--// doc -->
  284.  
  285.             </div><!-- #content -->
  286.         </div><!-- #primary -->
  287.        
  288. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement