The Gutenberg Editor is a block-based editor introduced in WordPress 5.0. It’s designed to revolutionize the editing experience by using a content structure based on blocks. Each element of content, such as paragraphs, headings, images, videos, and widgets, is treated as an individual block. Users can manipulate and arrange these blocks more intuitively, allowing for… Continue reading New Gutenberg Editor in WordPress
Category: Wordpress
How to get the name of the image fetched in WordPress using WP inBulit-function
In WordPress, when you fetch an image, you typically retrieve its metadata, which includes various information about the image, such as its title, alt text, URL, etc. To get the name of the image (assuming you’re working within a WordPress loop or have access to the image data), you can use the following code: <?php… Continue reading How to get the name of the image fetched in WordPress using WP inBulit-function
Use of wp-reset-postdata() in WordPress
In WordPress, wp_reset_postdata() is a function used to reset the global $post variable back to the current post in the main query. It’s commonly used after a custom loop or secondary query using WP_Query to restore the global post data to the main query. When you run a custom query using WP_Query, it changes the… Continue reading Use of wp-reset-postdata() in WordPress
How to implement maintenance mode in Nextjs?
Maintenance mode is a state in which a website or application is temporarily taken offline or limited in functionality to perform necessary updates, improvements, or maintenance tasks. The implementation of maintenance mode serves involves following steps: Set up an Environment Variable: In your Next.js project, define an environment variable to indicate whether the application is in… Continue reading How to implement maintenance mode in Nextjs?
How to handle Delete option in Nextjs
const handleDelete = async () => { // Prompt the user for confirmation before proceeding with the deletion const confirmDelete = window.confirm(“Are you sure you want to delete?”); // Check if the user confirmed the deletion if (confirmDelete) { try { // Replace ‘YOUR_API_ENDPOINT’ and ‘YOUR_DELETE_PATH’… Continue reading How to handle Delete option in Nextjs
Limit tags to a pre-defined list in bbpress?
Create a plugin using the code below: <?php /* Plugin Name: Restrict Topic Tags Description: Restricts tags to a pre-defined list. Author: _mr_raptor_ Version: 0.1 */ $allowed_tags = array( ‘test’, ‘test2’, ); function restrict_topic_tags_form( $args = null ) { $defaults = array( ‘topic’ => 0, ‘submit’ => __(‘Add »’), ‘list_id’ => ‘tags-list’ ); $args =… Continue reading Limit tags to a pre-defined list in bbpress?
What is WP-CLI?
WP-CLI, which stands for WordPress Command Line Interface, is a powerful command-line tool that allows users to interact with their WordPress installations from the command line. It provides a set of commands for various tasks related to managing and maintaining WordPress sites, making it easier for developers and administrators to perform actions without using the… Continue reading What is WP-CLI?
Jetpack AI Assistant in WordPress.com
Jetpack AI Assistant is seamlessly integrated as a block within the WordPress.com editor. (If your WordPress site is hosted elsewhere, the AI Assistant is also available through the Jetpack plugin.) (still in the experimental phase) 5 ways you can make writing a breeze with Jetpack AI Assistant Create customized content Jetpack AI Assistant utilizes a… Continue reading Jetpack AI Assistant in WordPress.com
How to synchronize your staging sites on WordPress.com
First, create a staging site on a Business or Commerce site with Hosting Features enabled. Once your staging site is created, try out some new plugins, play around with a new site design, or build a brand new homepage. When you are satisfied with your changes and would like to copy them from staging to… Continue reading How to synchronize your staging sites on WordPress.com
Detect when the reader is in a mobile device – WordPress
In WordPress, wp_is_mobile() is a function that is used to determine whether the current user agent (web browser) is accessing the site using a mobile device. This function checks if the user is browsing the site from a mobile device and returns a boolean value accordingly. Here’s an example of how you might use wp_is_mobile()… Continue reading Detect when the reader is in a mobile device – WordPress