PageRenderTime 42ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/nonus/templates/content-single-portfolio.php

https://github.com/alniko009/magic
PHP | 95 lines | 88 code | 7 blank | 0 comment | 32 complexity | 24f6bf5c1c70a9368da9c67d44488b00 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php while (have_posts()) : the_post(); ?>
  2. <?php $custom = get_post_custom(get_the_ID()); ?>
  3. <div class="row-fluid">
  4. <?php if (ct_get_option("portfolio_single_show_image", 1)): ?>
  5. <div class="span9">
  6. <?php get_template_part('templates/portfolio/content-single-portfolio', ctPortfolioType::getMethodFromMeta($custom)); ?>
  7. </div>
  8. <?php endif;?>
  9. <div class="span3">
  10. <?php $prev = get_next_post();?>
  11. <?php $next = get_previous_post();?>
  12. <nav class="work-nav">
  13. <?php if($prev):?>
  14. <a href="<?php echo get_permalink($prev->ID);?>" class="prev"><?php _e('Previous', 'ct_theme'); ?></a>
  15. <?php endif;?>
  16. <?php if($worksPage = ct_get_option('portfolio_index_page')): ?>
  17. <?php
  18. if(function_exists('icl_object_id')){
  19. $iclpageid = icl_object_id($worksPage, 'page', true, ICL_LANGUAGE_CODE);
  20. $worksPage = $iclpageid ? $iclpageid : $worksPage;
  21. }
  22. ?>
  23. <a href="<?php echo get_permalink($worksPage);?>" class="all"><?php _e('All', 'ct_theme');?></a>
  24. <?php endif;?>
  25. <?php if($next):?>
  26. <a href="<?php echo get_permalink($next->ID);?>" class="next"><?php _e('Next', 'ct_theme'); ?></a>
  27. <?php endif;?>
  28. </nav>
  29. <?php if (ct_get_option("portfolio_single_show_title", 1)): ?>
  30. <h4><?php the_title();?></h4>
  31. <?php endif;?>
  32. <?php if (ct_get_option("portfolio_single_show_content", 1)): ?>
  33. <?php the_content();?>
  34. <?php endif;?>
  35. <div class="spacer" style="height: 30px;"></div>
  36. <?php if (ct_get_option("portfolio_single_show_date", 1) && isset($custom['date'][0]) && $custom['date'][0]): ?>
  37. <?php $dateIcon = isset($custom['date_icon'][0]) && $custom['date_icon'][0] ? $custom['date_icon'][0] : 'icon-calendar'?>
  38. <h4><i class="<?php echo $dateIcon; ?>"></i> <?php echo $custom['date'][0];?></h4>
  39. <?php endif;?>
  40. <?php if (ct_get_option("portfolio_single_show_client", 1) && isset($custom['client'][0]) && $custom['client'][0]): ?>
  41. <?php $clientIcon = isset($custom['client_icon'][0]) && $custom['client_icon'][0] ? $custom['client_icon'][0] : 'batch user-2'?>
  42. <h4><i class="<?php echo $clientIcon; ?>"></i> <?php echo $custom['client'][0];?></h4>
  43. <?php endif;?>
  44. <?php if (ct_get_option("portfolio_single_show_venue", 1) && isset($custom['venue'][0]) && $custom['venue'][0]): ?>
  45. <?php $venueIcon = isset($custom['venue_icon'][0]) && $custom['venue_icon'][0] ? $custom['venue_icon'][0] : 'icon-map-marker'?>
  46. <h4><i class="<?php echo $venueIcon; ?>"></i> <?php echo $custom['venue'][0];?></h4>
  47. <?php endif;?>
  48. <?php $cats = ct_get_categories_string(get_the_ID(), ', ', 'portfolio_category');?>
  49. <?php if (ct_get_option("portfolio_single_show_cats", 1) && $cats): ?>
  50. <?php if ($cats): ?>
  51. <h4><i class="icon-tag"></i> <?php echo $cats; ?></h4>
  52. <?php endif; ?>
  53. <?php endif;?>
  54. <?php if (isset($custom['external_url'][0]) && $custom['external_url'][0]): ?>
  55. <?php $externalLabel = (isset($custom['external_label'][0]) && $custom['external_label'][0]) ? $custom['external_label'][0] : $custom['external_url'][0]?>
  56. <h4>
  57. <a href="<?php echo $custom['external_url'][0]?>"><i class="icon-link"></i> <?php echo $externalLabel;?></a>
  58. </h4>
  59. <?php endif;?>
  60. </div>
  61. </div>
  62. <div class="spacer" style="height: 30px"></div>
  63. <?php if (ct_get_option("portfolio_single_show_other_projects", 1)): ?>
  64. <?php echo do_shortcode('[works header="' . __('Related Works', 'ct_theme') . '" alllabel="" summaries="no" notids="' . get_the_ID() . '"]');?>
  65. <?php endif; ?>
  66. <?php comments_template('/templates/comments.php'); ?>
  67. <?php //highlight manu portfolio item ?>
  68. <?php if ($id = ct_get_option('portfolio_index_page')): ?>
  69. <?php if ($page = get_post($id)): ?>
  70. <?php
  71. if(function_exists('icl_object_id')){
  72. $iclpageid = icl_object_id($id, 'page', true, ICL_LANGUAGE_CODE);
  73. $page = $iclpageid ? get_post($iclpageid) : $page;
  74. }
  75. ?>
  76. <script type="text/javascript">
  77. jQuery(document).ready(function () {
  78. var $menu = jQuery('#nav-main');
  79. var $element = $menu.find('a[href*="/<?php echo $page->post_name?>/"]').parent();
  80. if ($element.length == 1) {
  81. $menu.find('li').removeClass('active');
  82. $element.addClass("active");
  83. }
  84. });
  85. </script>
  86. <?php endif; ?>
  87. <?php endif; ?>
  88. <?php endwhile; ?>