Advertisement
nlozovan

Untitled

Mar 11th, 2014
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. <?php
  2. if( !isset( $post ) ){
  3. return '';
  4. }
  5. $meta = meta::get_meta( $post -> ID , 'settings' );
  6.  
  7. if( isset( $meta[ 'author' ] ) && strlen( $meta[ 'author' ] ) && !is_author() ){
  8. $show_author = meta::logic( $post , 'settings' , 'author' );
  9. }else{
  10. if( is_single() ){
  11. $show_author = options::logic( 'blog_post' , 'post_author_box' );
  12. }
  13.  
  14. if( is_page() ){
  15. $show_author = options::logic( 'blog_post' , 'page_author_box' );
  16. }
  17.  
  18. if( !( is_single() || is_page() ) ){
  19. $show_author = true;
  20. }
  21. }
  22.  
  23. if( ( is_single () || is_author() || is_page() ) && $show_author ){
  24. ?>
  25. <aside id="archives-3" class="widget">
  26. <h4 class="widget-title">
  27. <?php _e( 'By' , 'cosmotheme' )?>
  28. <span class="vcard">
  29. <a class="url fn n" href="<?php echo get_author_posts_url( $post-> post_author ) ?>" title="<?php echo esc_attr( get_the_author_meta( 'display_name' , $post-> post_author ) ); ?>" rel="me">
  30. <?php echo get_the_author_meta( 'display_name' , $post-> post_author ); ?>
  31. </a>
  32. </span>
  33. <?php
  34. if( !is_author() && options::logic( 'general' , 'enb_likes' ) ){
  35.  
  36. $url = get_author_posts_url( $post-> post_author );
  37.  
  38. $all = array( 'type' => "all" );
  39. $url_all = add_query_arg( $all , $url );
  40.  
  41. $like = array( 'type' => "like" );
  42. $url_like = add_query_arg( $like , $url );
  43.  
  44. $like = array( 'type' => "post" );
  45. $url_post = add_query_arg( $like , $url );
  46. ?>
  47. <span class="links">
  48. <a href="<?php echo $url_all; ?>"><?php _e( 'All' , 'cosmotheme' ); ?></a>
  49. <a href="<?php echo $url_post; ?>"><?php _e( 'Posts' , 'cosmotheme' ); ?></a>
  50. <a href="<?php echo $url_like; ?>"><?php _e( 'Likes' , 'cosmotheme' ); ?></a>
  51. </span>
  52. <?php
  53. }
  54. ?>
  55. </h4>
  56. <div class="box-author clearfix">
  57. <p>
  58. <a href="<?php echo get_author_posts_url( $post -> post_author) ?>"><?php echo cosmo_avatar( $post -> post_author , $size = '60', $default = DEFAULT_AVATAR ); ?></a>
  59. <?php
  60. $author_bio = get_the_author_meta( 'description' , $post -> post_author );
  61.  
  62. if( $author_bio != '' ){
  63. echo '<span class="author-page">' . $author_bio . '</span>';
  64. }
  65. ?>
  66. </p>
  67. </div>
  68.  
  69. <?php
  70. $author_url = get_user_meta($post -> post_author, 'user_url', true);
  71.  
  72. if( $author_url != '' ){ ?>
  73.  
  74. <form style="display:block; clear:both;" action="<?php echo $author_url;?>">
  75. <input type="submit" value="Visit author's site">
  76. </form>
  77. <?php }?>
  78. </aside>
  79. <?php
  80. }
  81. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement