Prints date even if on second post on same day. $post_id is optional if inside of posts loop. See Formatting_Date_and_Time for $format value. Does not print date if displaying second post on same day in loop, or second time used on single post. (For example, if you use this function to display the time and also […]
By Template: Check if got anything and use it from query above: By Path:
Returns an array of menu items. $menu parameter is slug or id of Menu created in WordPress. $args is from here: get_posts, which isn’t very helpful for filtering what menu items you want to display. This function returns an array that you can display manually, but does not include any data about which menu item […]
The following functions can be used on the category.php template to display information about the current category. Display Current Category Title on category.php: Display Current Category Description: Get Current Category Object: Use Category Object returned above to get ACF fields on category: Display Category Link – works for custom taxonomies and post categories.
A collection of WordPress functions I use often. Link to Home: Include another php file: *File name separated on ‘-‘ between two inputs to function. So if named include-content-blocks.php call is: Custom field images (not featured): Get image values in array instead of outputting image: Retrieving featured images is a different function: Get Image Caption […]
The Code Always call wp_reset_postdata() afterwards to reset the global $post value. Otherwise, any attempt to retrieve data from the page will return null.
I currently manage over 50 WordPress websites and have the ‘Limit Login Attempts’ plugin set to send an email whenever anyone tries to log into one of these sites and fails. It doesn’t take long for a new WordPress website to go through its first brute force login attack. When this happens, I monitor the […]
Below are slides from my WordCamp Milwaukee 2014 presentation entitled “Comparing WordPress Hosting Companies”. I discuss my experiences hosting over 50 WordPress websites with hosting companies such as WP Engine, Flywheel, Pressable, HostGator, Site5 and SiteGround, comparing each host’s Security, Backups, Support, Speed and Price. I hope this information helps you make better hosting decisions […]