How to add admin menu in WordPress Below is the step-by-step guide to help you create an admin menu: 1. Register admin menu: Add the following code to your plugin file or functions.php to register a new menu page: add_action(‘admin_menu’, ‘esparks_admin_menu’); function esparks_admin_menu() { add_menu_page( ‘Esparks Page’, ‘Esparks’, ‘manage_options’, ‘e-sparks’, ‘esparks_menu_callback_function’ ); } Here, Esparks […]
Category Archives: Uncategorized
How to create custom post type in WordPress
How to create custom post type in WordPress Custom post types in WordPress allow you to create and manage different types of content that are separate from regular posts and pages. They provide a way to organize and structure content based on specific needs and requirements. To create a custom post type in WordPress, you […]
WordPress Backend Development Best Practices
WordPress Backend Development Best Practices WordPress is incredibly popular and widely used for website development, thanks to its many advantages. However, the core codebase of WordPress, which has evolved over time, can be challenging to navigate and maintain. This complexity can also affect third-party developers who build on top of WordPress. It’s important to note […]
How to include CSS and Javascript files in WordPress Plugin
How to include CSS and Javascript files in WordPress Plugin To include JavaScript and CSS files in WordPress, you can use the wp_enqueue_script() and wp_enqueue_style() functions, respectively. These functions ensure that the files are properly loaded and managed by WordPress. Here’s how you can include JavaScript and CSS files in WordPress: 1. Include JavaScript files: […]
How to create a custom plugin in WordPress
How to create a custom plugin in WordPress In WordPress, you can add any type of custom functionality to your code by creating plugins. The process of creating plugin can be both easy and complicated, depends upon the functionality you want to add. In this blog, I will provide you the beginners’ guide to create […]
How to create a custom module in Magento 2
How to create a custom module in Magento 2 1. Create the module directory structure Inside the app/code directory of your Magento installation, create a directory for your module. For example, if your module is named “CustomModule”, create the following directory structure: “app/code/Esparksinc/CustomModule” Here Esparksinc is the vendor name. 2. Create the module configuration file Inside the […]
How to add quantity increment and decrement button on Mini Cart
Add Quantity Increment And Decrement Button on MiniCart 1. Create custom module on the path: app/code/Esparksinc/QtyCounterMinicart You can follow the guide to create custom module in magento 2. 2. Create “default.html” file on the path: app/code/Esparksinc/QtyCounterMiniCart/view/frontend/web/template/minicart/item And paste the below code into it: <!– /** * Copyright © Magento, Inc. All rights reserved. */ –> <li […]
Add Quantity Increment And Decrement Button on Shopping Cart
Add Quantity Increment And Decrement Button on Shopping Cart 1. Create a checkout_cart_item_renderers.xml file on the path.Path:app/code/Esparks/QtyCounter/view/frontend/layout And paste this code into it: <?php /** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile /** @var $block MagentoCatalogBlockProductView */ ?> <?php $_product = $block->getProduct(); ?> <?php […]
How To Add Quantity Increment And Decrement Button On Product page Magento 2
How To Add Quantity Increment And Decrement Button On Product page Magento 2 E-commerce store owners are constantly working to improve the online shopping experience and make it more convenient for customers. One way to achieve this is by adding useful features to the product page. These features can include size charts, easy returns, quantity […]
Deleting Attribute Through Patch ( Programmatically ) In Magento
Deleting Attribute Through Patch ( Programmatically ) In Magento Method To Assigning A Group To The Product Attribute. 1- For deleting product attributes you need to create custom modules.Like:Vendor/ModuleEsparks/DeleteAttr 2- Create DeleteCustomAttributes.php file inside. app/code/Esparks/DeleteAttr/Setup/Patch/Data And paste this code into it: <?php // Created By @Esparks namespace EsparksDeleteAttrSetupPatchData; use MagentoFrameworkSetupPatchDataPatchInterface; use MagentoFrameworkSetupModuleDataSetupInterface; use MagentoEavApiAttributeRepositoryInterface; use […]