One of my favorite things about developing sites with Hugo is that, with each new site I create, I learn something new. Sometimes, more than one thing.
Hugo’s Secret Parameters Okay, maybe these aren’t really secret parameters, but the documentation is often difficult to find if I don’t know what the parameters are called, or the documentation is only in the corresponding theme file itself. Frequently, the parameters are not documented at all.
I have embraced Hugo’s Page Bundles ever since I first learned about them. With a Page Bundle1, I can organize the files for a given post or page in a folder named for the post or page, making it much easier to manage the post’s or page’s resources, and to allow more flexibility with folder and file names. Page Bundles are a great way to organize content, especially for sites that include a lot of posts, pages, and associated files.
Unless the theme or the user has configured it otherwise, by default, Hugo will use the section with the most posts to determine the list of posts to display on the home page.
Setting the Source You can use the following parameter in the “params” section of a Hugo site config.toml to specifiy the source of the list of posts on the home page:
[params] mainSections = ['articles'] Simply replace “articles” with the section to use for the home page posts list.
The Problem In WordPress 5.8, Gutenberg blocks were introduced to the Widgets Page. If you’ve found this post, chances are you’ve noticed that setting the alignment of a widget Gutenberg Image Block to “align right” in order to float it to the right of the Gutenberg Latest Posts Block doesn’t work as you’d expect.
The Gutenberg Latest Posts Block includes a lot of nice features, one of which allows the inclusion of a post’s featured image in the list.
In an earlier post, I described a method of including an automatically updated age in a WordPress post using a shortcode.
In this post, I’ll show you another shortcode based on PHP’s DateTime extension and the diff method that will generate a string composed of the number of years, months, and days from a specified date.
The Code To include an automatically updating string composed of the years, months, and days from a specified date in WordPress using PHP, start by adding the following code to your child theme’s functions.
There are plenty of WordPress plugins out there that will quickly and easily add social media share buttons to WordPress posts. However, that ease-of-use comes with a price: those plugins frequently include far more functionality than you need. Since they’re typically designed to handle every conceivable social media platform, they include a lot more code, images, and web fonts than you need, if all you’re doing is adding Facebook, Twitter, and LinkedIn share buttons to your posts.
Most people these days know not to click links in suspicious emails; however, what if one of your WordPress site’s harried administrators or editors receives an authentic-looking email from the developers of one of the plugins the site relies on? The email asks them to click a link to provide an application password to increase the security/features or to continue to use the plugin?
WordPress 5.6 is due for release today, and one of its new features, Application Passwords, is a cause for concern among some security experts.
I often need to put the ages of people and events in a WordPress post, and the last thing I want to do is to come back and update them each year when the age(s) will no longer be correct.
Recently, I needed to add a custom shipping method to a site running WooCommerce 4.6. While there are a number of plugins available that will add custom shipping methods to WooCommerce, I only needed to add a single, custom shipping method and didn’t want the overhead of a full-featured plugin.
The folks at WooCommerce were kind enough to supply a code snippet for adding a custom shipping method by creating a simple plugin containing a class to handle the shipping method addition; however, as of the date of this post, there were a few issues with the code snippet on WooCommerce’s site that prevented it from working in the current version of WooCommerce:
Lost Lake/Mt. Hood photo by Schick at Morguefile.com.