Tagged: related posts
- This topic has 5 replies, 2 voices, and was last updated 6 years, 8 months ago by
Steve.
-
AuthorPosts
-
-
May 28, 2015 at 12:17 pm #3745
vgrchMemberHello,
I’m building a daily report divided into 3 parts: morning, afternoon and evening. Each of parts has the same set of fields including related custom posts (field names have respective suffix so they all are different).
Is it possible to include the same set of related posts for each part?
Thanks.
-
May 29, 2015 at 10:21 am #3754
SteveKeymaster@vgrch– I’m not 100% clear on your question, however, this may help.
You don’t have to include the field code in each part file. You can have it sit in your main plugin file wrapped in a function, and then call that function in the part file.
For example:
In your main plugin file, or theme’s
functions.php, add this:function my_text_field() { $field = array( 'type' => 'text' ,'field' => 'my_text_field' ,'label' => __('My Text Field') ); return $field; }And then in your parts files just call this:
my_text_field();Does that help?
-
May 31, 2015 at 10:03 am #3768
vgrchMemberI see the idea but it didn’t work.
I need to attach post-to-post field, so in functions.php I added:
function djs_field() { $field = array( 'type' => 'post-relate' ,'scope' => 'dj' ,'template' => 'field' ); return $field; }And in piklist/parts/meta-boxes/fields.php added:
djs_field();But it didn’t change a thing, anything I’m doing?
Thanks.
-
May 31, 2015 at 11:26 am #3769
SteveKeymasterI guess I didn’t understand your question. Can you provide more details?
-
May 31, 2015 at 9:32 pm #3775
vgrchMemberNo problem. So we a talking about daily reports for a restaurant.
I have custom post type called Daily Reports. Each one has meta-boxes for morning, afternoon and evening reports, each of them with the same set of fields, like weather (choose from dropdown), manager (choose from users), revenue etc.
I also have a custom post type called DJ. Each meta-box of Daily Reports has to have it’s own dropdown with the list of DJs to choose, so we have 3 DJs attached to 1 report.
My problem is to show DJ dropdowm 3 times in 1 report.
I hope I explained more than confused. )
Thanks. -
June 1, 2015 at 12:25 pm #3790
-
-
AuthorPosts
- You must be logged in to reply to this topic.