Tagged: ,

Viewing 4 reply threads
  • Author
    Posts
    • #7199
      hrmervin
      Member

      Hi Everyone,
      I’m stumbling on something likely simple–but I have looked at the documentation, and taken a few minutes to try to find the solution here, and I have not come across the solution yet.

      MY GOAL: is to create a “mybook_author” field, directly under the title field of my new post type (mybook) and show this field ONLY in the edit window of THIS post type (and not have this field show up in the edit window of other post types).

      This is the content of my piklist plugin file defining the new post type, and the field.

      https://gist.github.com/MervinHernandez/2e134fd925f19a448a1ed6b7eb91f5e1

    • #7202
      intrepidrealist
      Participant

      Hi hrmervin!
      In the header of your file after POST TYPE, you need to use the exact word you used to register the post type.
      “My Books” is in accurate.

      So it should be: POST TYPE: mybook.
      Also, this file should be placed in the piklist/parts/meta-boxes folder, if you haven’t done so.

    • #7204
      hrmervin
      Member

      I’m familiar with how you create a separate meta box, and that you can set ‘false’ for it to look like a meta box, but the function that creates the field by itself, allows it to be visible inline, immediately below the title.

      What I accomplished here, next to where I define the post type (in the root of my piklist plugin file) is what I’d like to see, however I’m not sure how to set the condition on this function that displays the field, so it only displays in this post type.

    • #7206
      intrepidrealist
      Participant

      Did you try changing:

      POST TYPE: My Book

      to:

      POST TYPE: mybook

      Sorry, I’m not familiar with using Piklist with plugin development. But, I do know what you have wouldn’t work for me conditionally because it’s not the code name of you Post Type, but the title…

    • #7213
      hrmervin
      Member

      RESOLVED: I removed the default editor in the post type definition + created a “main” meta box to include first, the long field for the subtitle, and then the re-instanced editor box via piklist, immediately below the subtitle field + made the whole meta box NOT look like a meta box.

      Thanks for the tweet hint!

Viewing 4 reply threads
  • The topic ‘Single Field Condition’ is closed to new replies.