How to get WordPress image link from the media ID
In this example, I’m using ID 14988 Using Media Library If you are logged in as admin, add the media ID in the website URL: then copy the file URL: Using SQL Using WPCLI or
In this example, I’m using ID 14988 Using Media Library If you are logged in as admin, add the media ID in the website URL: then copy the file URL: Using SQL Using WPCLI or
AJAX enables tasks such as fetching, inserting and deleting records from a MySQL database, as well as file uploading. AJAX sent URL should be admin-ajax.php. wp_ajax action hooks. Here are well-explained tutorials from Yogesh Singh on how to send AJAX requests from a WordPress theme and a WordPress plugin:
Here is a snippet that allows you to set a custom image on the WordPress login page and set a custom link: Replace https://your-domain.com/wp-content/uploads/2023/custom-logo.png with your logo https://your-domain.com with your link
Here is a simple code snippet that you can add to your theme functions.php file to show the “last updated” date in your posts. A new line will be added to the beginning of the post content if the last modified and published time is different:
WordPress is an awesome content management system. You can install it in one click, you can find professional-looking themes for as little as a few dollars, and you can use a wide range of plugins for added functions and features. Nonetheless, WordPress websites can become sluggish sometimes, chasing impatient visitors away. This article is going … Read full article →
wp_delete_post function allows us to permanently delete posts, pages, attachments. When a post is deleted, all the associated content will also be deleted, this includes the comments, custom fields, and category entries. Instructions Parameter PARAMETER TYPE DESCRIPTION DEFAULT REQUIRED $postid intiger article ID 0 no $force_delete boolean skip recycle bin and delete permanently false no … Read full article →
In this guide We’ll cover how to reset a WordPress user password using WP-CLI. Step 1. Ensure WP-CLI is installed and you are in the website directory run the following command to check if you are in the right folder: Step 2. List all users and note user_login for the user Step 3. Replace the … Read full article →
Deleting all inactive WordPress themes and plugins from your website is a recommended security practice. Even when deactivated, old, insecure plugins and themes might still pose a threat to the security of your WordPress website. Here are oneliners to remove inactive themes and plugins from your WordPress website using WP-CLI. List all inactive WordPress themes: Delete … Read full article →
IF you use the same commands often you can save them as aliases so that you have them always available. For example, the following commands will check if WP core, installed plugins and themes have updates available: You can combine the commands into a one-liner: and you can create an alias for this command: so … Read full article →
The principle of WPCLI is to add install it on the server, add it to path so that it can be accessed from any folder and then enter the installation folder of the website for which you want to run commands. The basic use of WP-CLI is: wp [COMMAND], e.g. wp config list will show … Read full article →