Category: Code Snippet
WordPress: How to Display Date and Time with User-preferred Formatting
We set Date Format and Time Format in WordPress General Setting and we want to display that date on WordPress template. The Date Format and the Time Format settings allow us to set Date and Time to any format we wants, it also easier to use with localization. Use following code in WordPress template Date…
How to Modify get_comment_author_link to Open Comment Authors Website on new Window
By default, get_comment_author_link redirects the user to the site which was entered by comment author when they wrote comment in same window of our site. What if we want this to open on new window? Add following code to functions.php in your live theme directory
WordPress: Conditional tag to check a specific menu
Following conditional tag usually use in this filter function, wp_nav_menu_items For an example, I want to add search box to Primary Menu in WPZOOM theme name Videozoom. Conditional tag above make sure the search only show in a specif menu (Primary) 1. Open functions.php 2. Add following code to functions
WordPress Conditional Tag for Login Page
WordPress have conditional tags. The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches Following conditional tag is specific to Login Page, that is currently not available on WordPress Codex