fauzanjeg

Meta Author on Certain Posts

Mar 5th, 2021 (edited)
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. /* Meta Author on Certain Posts */
  2. function jnews_meta_author_on_certain_post() {
  3.     if ( is_singular() && is_single() ) {
  4.         $url_list = array( /* List Permalink When You Make Post or Edit Post  */
  5.             'http://localhost/wordpress2/2021/03/01/hello-world/',
  6.             'http://localhost/wordpress2/2021/02/05/theres-no-such-thing-as-a-good-dog/'
  7.         );
  8.  
  9.         if ( ! in_array( get_permalink(), $url_list ) ) {
  10.             ?>
  11.                 <style id="meta_author_on_certain_post" scoped>
  12.                     .jeg_content.jeg_singlepage .jeg_main_content .entry-header .jeg_meta_container .jeg_post_meta .meta_left .jeg_meta_author, /* For Meta Author */
  13.                     .jeg_content.jeg_singlepage .jeg_main_content .jnews_author_box_container /* For Author Box if you want to display it too */ {
  14.                         display: none;
  15.                     }
  16.                 </style>
  17.             <?php
  18.         }
  19.     }
  20. }
  21.  
  22. add_action( 'wp_head', 'jnews_meta_author_on_certain_post' );
Add Comment
Please, Sign In to add comment