Home / functions.php / April fools: Reverse text in the_title on home page
  • How to April fools: Reverse text in the_title on home page

    april-fools-reverse-text-in-the_title-on-home-page

    Adding this snippet to the functions.php of your wordpress theme will temporarily display the text within your page title in reverse order. For example this page title would be “egap emoh no eltit_eht ni txet esreveR :sloof lirpA” but this is only done on the main page of your website. Just remove the snippet from the functions.php and your website will return to normal.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    function april_fools_wps($text){
        if(is_home()){return strrev($text);}else{return $text;}
    }
    add_filter('the_title', 'april_fools_wps');
    

    ( WordPress codex functions, hooks, in this snippet. )

    home, the_title, add_filter, is_home, wp,
  • salbehe

    Thank you for this!