Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Create "related items" using magic fields WordPress


I have a catalog style website running with Magic Fields. Its for furniture in "collections" but organized by category of type (bed, stool, dresser, etc) we would like to create a way to display items with the same "collection" some how.

This is my first time using this service so please bear with me.

Answers (3)


Oleg Butuzov answers:

*** Related Products by tags
$terms =get_the_terms( $post->ID, 'post_tag' );
if (is_array($terms) && count($terms) > 0){

foreach($terms as $k=>$i){
$terms[$k] = $i->term_id;

$ids = array_unique(get_objects_in_term($terms, 'post_tag'));

if (is_array($ids) && count($ids) > 0){
foreach($ids as $k=>$i){
if ($i == $post->ID){



$params = array(
'showposts' => 9,
'posts_per_page'=> 9,
'post__in' => $ids);

<?php query_posts($params); ?>

[[LINK href=""]]exampples of query_posts[[/LINK]]

On your request. BEAR!


Rashad Aliyev answers:

If you need more you can use: Custom Field Template plugin.

That's wonderful to make your own custom templates.


Matt Heyes answers:

Since WP 2.8 you can use Custom Taxonomies to make more ways to organise your posts. Instead of being limited to just Category and Tags, you can now create your own custom taxonomy called Collection. You can even have a permalink called collection which returns related content for example

I think you will find all the answers you need to create this in the following post: