So I have multiple custom post types. On a particular custom post type (a), I am looking to pull in another type of post (b). But I have a custom field on (a) which is the ID of one of the (b) posts which needs to be excluded.
This custom field on (a) changes for each post so cannot be hard coded.
So far I have this:
New-Service -BinaryPathName $servicePath -Name $serviceName -Credential $cred -Description $description -DependsOn $dependsOn -DisplayName $friendlyName -StartupType $startupType
But it's not doing anything. I'm probably doing something stupid. Not much of a coder as you can tell so I'm using Google and the tiny bit of common sense I have.
Thanks for any help!
答案 0 :(得分:0)
在$exclude = the_field( "exclude_tipster_id" );
,您应该使用get_field()
代替the_field()
。
当您使用the_field()
时,该值将回显到屏幕,当您使用get_field()
时,该值将分配给$ exclude。
有关详细信息,请参阅此处的文档: https://www.advancedcustomfields.com/resources/get_field/ https://www.advancedcustomfields.com/resources/the_field/