Build a Custom WordPress User Flow — Part 1: Replace the Login Page

Thanks to its nearly endless customizability through plugins and themes, WordPress has come a long way from its roots as a blogging platform, today acting as the backbone for all kinds of web based applications from online stores to membership sites and e-book authoring platforms. While traditionally only the site admins would log in to the WordPress dashboard, many of these new, application-like uses change that: when users need to be authenticated, the WordPress login is extended to visitors and customers. WordPress provides good tools for managing user roles and capabilities, and they can be further extended with the help...

Activate the Default Maintenance Mode with Code

Method 1: In the root folder of your WordPress installation, click New File.  Name the file .maintenance, making sure to include the dot (.) at the beginning.  Right-click the .maintenance file and select Edit.  If you can’t see the .maintenance file, click Settings in the upper right corner and ensure that Show hidden files (dotfiles) is selected. The file opens in the File Manager editor. Add the following lines to the file: <?php $upgrading = time(); ?> Your site will be in maintenance mode as soon as you save the file. Click Save Changes. The site now displays the default maintenance mode message. Disabling manual maintenance mode When you’re...

Add an Expiry Date to WordPress Posts

I run a few sites which include notices and important information in a banner on their home page. I tend to use a custom post type for this, adding my banners and displaying them where I need to in my theme. (If you want to do something similar, it's explained in this tutorial.) But invariably my banners have an expiry date. They might contain information about an upcoming event or a vacancy, for example. Once the event has passed or the vacancy has been filled, I have to go into the site and manually trash the post. It would be so...

How to Build a Library Collection and Circulation System in WordPress

How to build a library collection and circulation system in Wordpress - https://www.wpbeginner.com/plugins/how-to-build-a-library-collection-and-circulation-system-in-wordpress/ How to Create a Library Management System in WordPress - https://www.greengeeks.com/tutorials/create-a-library-management-system-in-wordpress/ WordPress .htaccess: The Ultimate Guide to Manage Your Content - https://www.greengeeks.com/tutorials/wordpress-htaccess/ How to Create and Access Error Logs for WordPress - https://www.greengeeks.com/tutorials/error-logs-wordpress/ How to Set Up an Invoice System to Get Paid in WordPress - https://www.greengeeks.com/tutorials/invoice-system-wordpress/

Modify recent post sidebar to show post thumbs without plugins

/** * Extend Recent Posts Widget * * Adds different formatting to the default WordPress Recent Posts Widget */ Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); if( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 10; $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if( $r->have_posts() ) : echo $before_widget; if( $title ) echo $before_title . $title . $after_title; ?> <ul> <?php while( $r->have_posts() )...

Filtering post or custom post type by a specific taxonomy term in the WordPress admin

This is a powerful little snippet to allow filtering your post or custom post type by a specific taxonomy term in the WordPress admin. In my use case I had a custom post type for ‘Team’ members. I then had a custom taxonomy called ‘Group’ that associated each member with one or more groups within the organization. The client wanted to be able to filter all Team members by Group in the admin. My first thought was to use sortable columns, but that would still require scrolling and possibly paging to get the right people. I tried a few things...

How to Modify the Parent Theme Behavior Within the Child Theme

What are child themes? Child themes are a useful WordPress feature that allows developers to build a new template without starting from scratch, but by taking advantage of all the features already available in an existing theme. Sometimes however, the parent theme we have chosen for our site may have some features that we don't need (or we need to customize to best suit our needs), for example custom post types with a different slug, Shortcodes, JavaScript libraries, image sizes that we don't use and so on... Customize the Theme in Two Ways While it could be easy to achieve what we want...