Support

Account

Forum Replies Created

  • I see, I’ll the simply need to create the relation from the Post manually, not such a big deal would just be much more elegant to just do it once. Thanks for looking at it, keep up the great work!

  • Sorry if I wasn’t clear, I know about the default WP behaviour and I need something different. This is how it is set up:

    This Relationship field:

    array (
    				'key' => 'field_5231bd6773a84',
    				'label' => 'Product',
    				'name' => 'category_product',
    				'type' => 'relationship',
    				'return_format' => 'object',
    				'post_type' => array (
    					0 => 'product',
    				),
    				'taxonomy' => array (
    					0 => 'product_cat:3',
    				),
    				'filters' => array (
    					0 => 'search',
    				),
    				'result_elements' => array (
    					0 => 'post_type',
    					1 => 'post_title',
    				),
    				'max' => 1,
    			)

    Is attached to the default Categories:

    'location' => array (
    			array (
    				array (
    					'param' => 'ef_taxonomy',
    					'operator' => '==',
    					'value' => 'category',
    					'order_no' => 0,
    					'group_no' => 0,
    				),
    			),
    			array (
    				array (
    					'param' => 'ef_taxonomy',
    					'operator' => '==',
    					'value' => 'post_tag',
    					'order_no' => 0,
    					'group_no' => 1,
    				),
    			),
    		)

    My question is how to query the category on the product post type template.
    Hope I was clear and thanks so much for your time!

  • Hi Elliot,

    the relationship relates to a custom post type “Product” with a Category.

    Imagine the Category is a Magazine Issue which has Posts (default WP functionality) and then this Magazine Issue Category is connected to a Product to buy the printed Issue. I now want to link to the Category which is connected to the Product from the Product Page. Does this make sense?

    The Code would run on the Template displaying the Products (CPT) where I’d try to query: “Get the Category ID of the Category related to this Product ID”.

    Does this make it clearer?

Viewing 3 posts - 1 through 3 (of 3 total)