Delete products and category programmatically magento

This tutorial explains how to remove the products and categories from the magento backend pro grammatically. This code deletes all the products and categories from the magento backend.

If you want to delete all the products it is not easy to remove it one by one.The code below removes all the products and the categories programmatically.

Upgrade product attribute magento

This tutorial explains how to upgrade product attribute magento using the install script.In the previous tutorial I have explained how to create the custom product attribute.Please click here for the file structure and step by step explanation.If you want to create custom dropdown attribute with options please click here.

In the previous tutorial I have created Burn time custom dropdown attribute. Here I am upgrading the product attribute type to multiselect input type .

Create ,update static blocks magento script

This tutorial explains how to create and update static blocks using the magento scripts.For that I have create a file in the magento root folder. Then I have created an array which contains the details of the static block as shown below.

If we are creating the CMS blocks using the script it is easy to move the blocks from the develop database to live database without redoing those changes in the magento backend.

Filter posts by custom fields wp_query

This tutorial I am explaining how to filter posts by custom fields using wp_query. Using wordpress meta_query() parameter we can retrieve the post based on the custom field.

Here I am filtering the post based on the category name and the custom field ‘front_page’ checkbox. Then displaying those filtered posts as blocks in the home page.Please refer the image below.I have created a custom field checkbox and filtering the post based on that from the database.