PHP code refactoring and settings for display link on posts and pages.