Second, login to your control panel (C-Panel), go to public_html -> wp-content -> themes -> theme that you’re using -> footer.php.
For those who use WordPress 2.3.1 and later, you can go from Presentation -> theme editor -> footer.php.
Add this script in footer.php. You can put it in whenever you like.
From C-Panel, go to public_html -> wp-include -> post.php
Use search function, find this script :
$query .= " WHERE (post_type = 'page' AND post_status = 'publish') $exclusions $inclusions " ;
And replace with this one :
Then click Save.