Support

Account

Home Forums Front-end Issues Issues creating related posts to multiple CPT and display radio buttons select c Reply To: Issues creating related posts to multiple CPT and display radio buttons select c

  • Hi @graphisterie

    Could you please answer the thread from the forum page, not the email.

    Regarding your issue, multiple post objects field is saved in a serialized data like this: a:3:{i:0;s:3:"810";i:1;s:3:"135";i:2;s:3:"814";}.

    With your query arguments, it won’t match any serialized data. You need the arguments like this:

    $args = array(
    	'numberposts'	=> -1,
    	'post_type'	=> 'post',
    	'meta_query'	=> array(
    		array(
    			'key'		=> 'services',
    			'value'		=> serialize(strval(get_the_ID())),
    			'compare'	=> 'LIKE'
    		),
    	)
    );

    I hope this helps.