Guest User

Untitled

a guest
Apr 8th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. <?php
  2. /**
  3. * Custom template tags for appointment
  4. *
  5. * @package WordPress
  6. * @subpackage appointment
  7. * @since appointment 1.0
  8. */
  9.  
  10. //Hide meta Like Date from Blog pages, category pages
  11. if ( ! function_exists( 'appointment_aside_meta_content' ) ) :
  12. function appointment_aside_meta_content()
  13. {
  14. $appointment_options=theme_setup_data();
  15. $blog_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
  16. if($blog_setting['blog_meta_section_settings'] == '' ) {
  17. ?>
  18. <!--show date of post-->
  19. <aside class="blog-post-date-area">
  20. <div class="date"><?php echo get_the_date('j'); ?> <div class="month-year"><?php echo get_the_date('M'); ?>,<?php echo get_the_date('Y'); ?></div></div>
  21. <div class="comment"><a href="<?php the_permalink(); ?>"><i class="fa fa-comments"></i><?php comments_number( '0', '1', '%' ); ?></a></div>
  22. </aside>
  23. <?php } } endif;
  24.  
  25. //Hide post meta like author name,category on Blog page, archive pages
  26. if ( ! function_exists( 'appointment_post_meta_content' ) ) :
  27. function appointment_post_meta_content()
  28. {
  29. $appointment_options=theme_setup_data();
  30. $blog_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
  31. if($blog_setting['blog_meta_section_settings'] == '' ) { ?>
  32. <div class="blog-post-lg">
  33.  
  34. <?php $tag_list = get_the_tag_list();
  35. if(!empty($tag_list)) { ?>
  36. <div class="blog-tags-lg"><i class="fa fa-tags"></i><?php the_tags('', ', ', ''); ?></div>
  37. <?php } ?>
  38. </div>
  39. <?php }
  40. } endif;
  41. // this functions accepts two parameters first is the preset size of the image and second is for additional classes, you can also add yours
  42. if(!function_exists( 'appointment_post_thumbnail')) :
  43.  
  44. function appointment_post_thumbnail($preset,$class){
  45. if(has_post_thumbnail()){
  46. $defalt_arg =array('class' => $class);
  47. if(!is_single()){?>
  48.  
  49. <div class="blog-lg-box">
  50. <a class ="img-responsive" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  51. <?php the_post_thumbnail($preset, $defalt_arg); ?>
  52. </div>
  53. <?php } else { ?>
  54.  
  55. <div class="blog-lg-box">
  56. <a class ="img-responsive" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  57. <?php the_post_thumbnail($preset, $defalt_arg); ?>
  58. </div>
  59. <?php } } } endif;
  60. // this functions accepts one parameters for image class
  61. if(!function_exists( 'appointment_image_thumbnail')) :
  62. function appointment_image_thumbnail($preset,$class){
  63. if(has_post_thumbnail()){ $defalt_arg =array('class' => $class);
  64. the_post_thumbnail($preset, $defalt_arg); } } endif;
  65. // This Function Check whether Sidebar active or Not
  66.  
  67. if(!function_exists( 'appointment_post_layout_class' )) :
  68.  
  69. function appointment_post_layout_class(){
  70. if(is_active_sidebar('sidebar-primary'))
  71. { echo 'col-md-8'; }
  72. else
  73. { echo 'col-md-12'; }
  74. } endif;
  75. //get thumbnail image id
  76. if(!function_exists( 'appointment_portfolio_clearfix' )) :
  77. function appointment_portfolio_clearfix($j){
  78. global $j;
  79. if(is_page_template('portfolio-2-col.php'))
  80. {
  81. if($j%2==0){ echo "<div class='clearfix'></div>"; } $j++;
  82. }
  83. if(is_page_template('portfolio-3-col.php'))
  84. {
  85. if($j%3==0){ echo "<div class='clearfix'></div>"; } $j++;
  86. }
  87. if(is_page_template('portfolio-4-col.php'))
  88. {
  89. if($j%4==0){ echo "<div class='clearfix'></div>"; } $j++;
  90. }
  91. } endif;?>
Add Comment
Please, Sign In to add comment