Advertisement
Guest User

portfolio.php

a guest
Oct 25th, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. <?php /* Template Name: Portfolio */ ?>
  2. <?php
  3. get_header();
  4. wp_reset_query();
  5.  
  6. ?>
  7.  
  8. <section id="content" role="main" class="main-content">
  9. <header style="background-image: url(<?php echo get_template_directory_uri()?>/assets/images/banner.jpg);">
  10. <div class="container text-center">
  11. <h1 class="page-title-container"><span class="page-title bold-impact text-uppercase">Portfolio</span></h1>
  12. </div>
  13. </header>
  14.  
  15. <article>
  16. <div class="container">
  17. <div class="row">
  18. <?php
  19. $args = array( 'hide_empty=0' );
  20.  
  21. $terms = get_terms( 'protfolio-cat', $args );
  22. if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
  23. $count = count( $terms );
  24. $i = 0;
  25. $term_list = '<p class="my_term-archive">';
  26. foreach ( $terms as $term ) {
  27. $i++;
  28. $term_list .= '<a href="' . esc_url( get_term_link( $term ) ) . '" alt="' . esc_attr( sprintf( __( 'View all post filed under %s', 'my_localization_domain' ), $term->name ) ) . '">' . $term->name . '</a>';
  29. if ( $count != $i ) {
  30. $term_list .= ' &middot; ';
  31. }
  32. else {
  33. $term_list .= '</p>';
  34. }
  35. }
  36. echo $term_list;
  37. }
  38. ?>
  39. <?php foreach(get_posts(array('posts_per_page'=>30,'category_name'=>'responsive','post_type'=>'portfolioo')) as $post) { setup_postdata($post); ?>
  40.  
  41.  
  42. <div class="col-sm-4 col-md-3 portfolio-item">
  43. <a href="<?php the_permalink()?>">
  44. <div class="portfolio-image-cat"><?php the_post_thumbnail('large')?></div></a>
  45. <footer class="portfolio-info">
  46. <div class="portfolio-name text-center">
  47. <?php the_title()?>
  48. </div>
  49. <div class="portfolio-links clearfix text-center">
  50. <a href="<?php the_permalink()?>" class="portfolio-link-design">View Design &gt;</a>
  51. <a href="<?php echo esc_url( get_post_meta( get_the_ID(), 'wpcf-url', true ) ); ?>" class="portfolio-link-website" target="_blank">View Site &gt;</a>
  52. </div>
  53. </footer>
  54. </div>
  55. <?php } ?>
  56.  
  57. </div>
  58.  
  59. <h2>JS Applications</h2>
  60. <div class="row">
  61. <?php foreach(get_posts(array('posts_per_page'=>30,'category_name'=>'js','post_type'=>'portfolioo')) as $post) { setup_postdata($post); ?>
  62. <div class="col-sm-4 col-md-3 portfolio-item">
  63. <div class="portfolio-image-cat"><?php the_post_thumbnail('large')?></div></a>
  64. <footer class="portfolio-info">
  65. <div class="portfolio-name text-center">
  66. <?php the_title()?>
  67. </div>
  68. <div class="portfolio-links clearfix text-center">
  69. <a href="<?php the_permalink()?>" class="portfolio-link-design">View Design &gt;</a>
  70. <a href="<?php echo esc_url( get_post_meta( get_the_ID(), 'wpcf-url', true ) ); ?>" class="portfolio-link-website" target="_blank">View Site &gt;</a>
  71. </div>
  72. </footer>
  73. </div>
  74. <?php } ?>
  75. </div>
  76. </div>
  77. </article>
  78. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement