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.

Create custom attribute source type magento

This tutorial explains how to create custom attribute source type in magento. Here I am creating an attribute and set the source type as categories in the product page.

This module creates a dropdown attribute and listed all the categories in the category section as the options.This dropdown options change dynamically based on the categories in the category section.