Advertisement
Guest User

hide author

a guest
Nov 24th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.39 KB | None | 0 0
  1.  
  2. add_filter('jnews_module_post_meta_1', function($output, $post){
  3.     $output = '';
  4.     $comment            = jnews_get_comments_number($post->ID);
  5.  
  6.     // author detail
  7.     $author             = $post->post_author;
  8.     $author_url         = get_author_posts_url($author);
  9.     $author_name        = get_the_author_meta('display_name', $author);
  10.  
  11.     if( jnews_is_review($post->ID) )
  12.     {
  13.         $rating = jnews_generate_rating($post->ID, 'jeg_landing_review');
  14.         $output .=
  15.             "<div class=\"jeg_post_meta\">
  16.                    {$rating}
  17.                    <div class=\"jeg_meta_author\"><span class=\"by\">" . jnews_return_translation('by', 'jnews', 'by') . "</span> <a href=\"{$author_url}\">{$author_name}</a></div>
  18.                </div>";
  19.     } else {
  20.         $output .=
  21.             "<div class=\"jeg_post_meta\">
  22.                    <div class=\"jeg_meta_date\"><a href=\"" . get_the_permalink($post) . "\"><i class=\"fa fa-clock-o\"></i> " . \JNews\Module\Block\Block_1_View::getInstance()->format_date($post) . "</a></div>
  23.                    <div class=\"jeg_meta_comment\"><a href=\"" . jnews_get_respond_link($post->ID) . "\" ><i class=\"fa fa-comment-o\"></i> {$comment}</a></div>
  24.                </div>";
  25.     }
  26.  
  27.     return $output;
  28. }, null, 2);
  29.  
  30.  
  31. add_filter('jnews_module_post_meta_3', function($output, $post){
  32.     $output = '';
  33.  
  34.     if(jnews_is_review($post->ID))
  35.     {
  36.         $rating = jnews_generate_rating($post->ID, 'jeg_landing_review');
  37.  
  38.         $output =
  39.             "<div class=\"jeg_post_meta\">
  40.                    {$rating}
  41.                    <div class=\"jeg_meta_date\"><a href=\"" . get_the_permalink($post) . "\"><i class=\"fa fa-clock-o\"></i> " . \JNews\Module\Block\Block_1_View::getInstance()->format_date($post) . "</a></div>                    
  42.                </div>";
  43.     } else {
  44.  
  45.         // author detail
  46.         $author             = $post->post_author;
  47.         $author_url         = get_author_posts_url($author);
  48.         $author_name        = get_the_author_meta('display_name', $author);
  49.  
  50.         $output .=
  51.             "<div class=\"jeg_post_meta\">
  52.                    <div class=\"jeg_meta_date\"><a href=\"" . get_the_permalink($post) . "\"><i class=\"fa fa-clock-o\"></i> " . \JNews\Module\Block\Block_1_View::getInstance()->format_date($post) . "</a></div>
  53.                </div>";
  54.  
  55.     }
  56.  
  57.     return $output;
  58. }, null, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement