Skip to main content
1 of 2

Dynamically Create Custom Post Type According to Relationship Another Custom Post Type

It is hard explain what I am trying to build. So I will try to explain it via example.

Custom Post Type : Mobile

Assume that there there mobile posts..

  1. Nokia 6
  2. Samsung S 7
  3. Huawei P 10
  4. Apple iPhone 7

Custom Post Type : Compare

Following compare posts should be auto created..

  1. Nokia 6 vs Samsung S 7
  2. Nokia 6 vs Huawei P 10
  3. Nokia 6 vs Apple iPhone 7
  4. Samsung S 7 vs Huawei P 10
  5. Samsung S 7 vs Apple iPhone 7
  6. Huawei P 10 vs Apple iPhone 7

Every compare posts should be have two custom fields like mobile1 and mobile2 and it includes the post id of mobile post type.


Should building this type of thing is possible with WordPress? I have some ideas build it using cron... I mean reading Mobile Posts and create compare posts.... But seems like it takes too much time... Is there any easy way?