Guest User

Untitled

a guest
May 16th, 2019
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 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. if ( ! function_exists( 'appointment_aside_masonry_meta_content' ) ) :
  26. function appointment_aside_masonry_meta_content()
  27. {
  28. $appointment_options=theme_setup_data();
  29. $blog_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
  30. if($blog_setting['blog_meta_section_settings'] == '' ) {
  31. ?>
  32. <!--show date of post-->
  33. <div class="blog-post-sm">
  34. <?php _e('By','appointment');?><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) );?>"><?php echo get_the_author();?></a>
  35. <?php _e('Posted','appointment');?>
  36. <a href="<?php echo get_month_link(get_post_time('Y'),get_post_time('m')); ?>">
  37. <?php echo get_the_date('M j, Y'); ?></a>
  38. <?php $tag_list = get_the_tag_list();
  39. if(!empty($tag_list)) { ?>
  40. <div class="blog-tags-sm"><?php _e('In','appointment');?><?php the_tags('', ', ', ''); ?></div>
  41. <?php } ?>
  42. </div>
  43. <?php } } endif;
  44.  
  45.  
  46. //Hide post meta like author name,category on Blog page, archive pages
  47. if ( ! function_exists( 'appointment_post_meta_content' ) ) :
  48. function appointment_post_meta_content()
  49. {
  50. $appointment_options=theme_setup_data();
  51. $blog_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
  52. if($blog_setting['blog_meta_section_settings'] == '' ) { ?>
  53. <div class="blog-post-lg">
  54. <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) );?>"><?php echo get_avatar( get_the_author_meta('user_email'), $size = '40'); ?></a><?php _e('By','appointment');?><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) );?>"><?php echo get_the_author();?></a>
  55. <?php $tag_list = get_the_tag_list();
  56. if(!empty($tag_list)) { ?>
  57. <div class="blog-tags-lg"><i class="fa fa-tags"></i><?php the_tags('', ', ', ''); ?></div>
  58. <?php } ?>
  59. </div>
  60. <?php }
  61. } endif;
  62. // this functions accepts two parameters first is the preset size of the image and second is for additional classes, you can also add yours
  63. if(!function_exists( 'appointment_post_thumbnail')) :
  64.  
  65. function appointment_post_thumbnail($preset,$class){
  66. if(has_post_thumbnail()){
  67. $defalt_arg =array('class' => $class);
  68. if(!is_single()){?>
  69.  
  70. <div class="blog-lg-box">
  71. <a class ="img-responsive" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  72. <?php the_post_thumbnail($preset, $defalt_arg); ?></a>
  73. </div>
  74. <?php } else { ?>
  75.  
  76. <div class="blog-lg-box">
  77. <a class ="img-responsive" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  78. <?php the_post_thumbnail($preset, $defalt_arg); ?></a>
  79. </div>
  80. <?php } } } endif;
  81. // this functions accepts one parameters for image class
  82. if(!function_exists( 'appointment_image_thumbnail')) :
  83. function appointment_image_thumbnail($preset,$class){
  84. if(has_post_thumbnail()){ $defalt_arg =array('class' => $class);
  85. the_post_thumbnail($preset, $defalt_arg); } } endif;
  86. // This Function Check whether Sidebar active or Not
  87.  
  88. if(!function_exists( 'appointment_post_layout_class' )) :
  89.  
  90. function appointment_post_layout_class(){
  91. if(is_active_sidebar('sidebar-primary'))
  92. { echo 'col-md-8'; }
  93. else
  94. { echo 'col-md-12'; }
  95. } endif;
  96. //get thumbnail image id
  97. if(!function_exists( 'appointment_portfolio_clearfix' )) :
  98. function appointment_portfolio_clearfix($j){
  99. global $j;
  100. if(is_page_template('portfolio-2-col.php'))
  101. {
  102. if($j%2==0){ echo "<div class='clearfix'></div>"; } $j++;
  103. }
  104. if(is_page_template('portfolio-3-col.php'))
  105. {
  106. if($j%3==0){ echo "<div class='clearfix'></div>"; } $j++;
  107. }
  108. if(is_page_template('portfolio-4-col.php'))
  109. {
  110. if($j%4==0){ echo "<div class='clearfix'></div>"; } $j++;
  111. }
  112. } endif;?>
Add Comment
Please, Sign In to add comment