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.
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.