Advertisement
fauzanjeg

Change Latest Article text on 404 Page Not Found

Jun 8th, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. /* Change Latest Article text on 404 Page Not Found */
  2. function jnews_change_latest_articles_text_on_404_page_not_found($translated_text, $text, $domain) {
  3.     if ( is_404() ) {
  4.         switch ($translated_text) {
  5.             case 'Latest Articles':
  6.                 $translated_text = __('Your Title');
  7.                 break;
  8.         }
  9.     }
  10.     return $translated_text;
  11. }
  12. add_filter( 'gettext', 'jnews_change_latest_articles_text_on_404_page_not_found', 20, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement