• Resolved Julie

    (@habannah)


    Hi Eliot,

    I’m using the WCK plugin to create custom post types and taxonomies and everything works great with the Custom Content plugin, but I can’t for the life of me get custom fields to display.

    I’m able to display the WCK custom fields on the WCK custom pages using a WCK php code, but that’s not what I want… I’m using the custom fields specifically to pull content into other areas of the site, so if I can’t get them to work with Custom Content plugin, they’re useless to me.

    I’ve been using the regular custom fields instead (so far, and hopefully just for now), but they’re messy and disorganised and I would really like to be able to take advantage of the added functionality of the WCK custom fields. And I really don’t want to use yet another plugin such as ACF just to get more functionality with custom fields.

    But after seeing all the shortcode options specific to the ACF plugin, I’m afraid WCK might require the same kind of additional support.

    Could you please check into it to see if WCK custom fields would indeed need additional support? I don’t want to ask you to actually implement the support for WCK — that feels like too much to ask — but it would be nice to know whether I’m defeated or whether I should keep trying. Clearly, it’s not urgent… Lol.

    Thanks so much! I love your plugin ??

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hi Julie,

    I looked into WCK’s documentation – I see what you mean, the plugin uses its own PHP functions to retrieve the fields, similar to ACF.

    Since it looked fairly simple, I decided to implement shortcodes for it. In the latest update to Custom Content Shortcode, I added a small module that will load if the WCK plugin is installed.

    You can use it like this:

    [wck-field meta="metabox_name" name="field_name"]

    The repeater feature is quite nice, so I included it:

    [wck-repeat meta="metabox_name"]
       [wck-field name="field_name]
       [wck-field name="another_field]
    [/wck-repeat]

    These can be used inside [loop] also.

    For documentation, please see in the Overview tab, under Support for other plugins, there’s a link to the page.

    Thread Starter Julie

    (@habannah)

    Eliot, you’re amazing! Thank you so much!! This looks like exactly what I need ?? I hope I didn’t cause you too much work…

    I’ll set up a few custom fields with WCK and test it out. If I have any issues, I’ll let you know — otherwise you can assume the best ??

    Thanks again, and cheers!

    Thread Starter Julie

    (@habannah)

    Hi again Eliot,

    Everything works great on your side of things — that is, I can display the WCK custom fields using Custom Content Shortcode now ??

    Unfortunately, shortcodes don’t work in the WCK custom fields for some reason. All I see is the [shortcode] text rather than the desired output. I tried using the textarea and the wysiwig editor (in source mode). Textarea doesn’t actually output anything at all, not even the shortcode text. I also tried pulling the custom field content from another post and from the default current post — same results.

    I thought I would check with you first, but please let me know if this is something I should be asking over at the WCK forum instead.

    Thanks!

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    I looked into it, and found that WCK formats the textarea but doesn’t run shortcodes inside. I added a new parameter to [wck-field] to enable it: shortcode=”true”.

    One thing to note is, the formatting of textarea interferes with the [loop] shortcode, so I made a work-around to prevent it. This means if you want a break line, you need to insert the <br> tag where you want.

    For example, inside the textarea field:

    [loop type="post"]
        [field title]<br>
    [/loop]
    Thread Starter Julie

    (@habannah)

    Excellent! Thanks again for all your hard work, Eliot.

    Hi Eliot, I’ve been playing around with you plugin but I haven’t been able to make it work for my WCK custom fields. I created a custom type called “survey”, it has a metabox argument called survey-info and I haven’t been able to access the metabox-fields. If I use survey-info as the parameter it shows the word Array, which makes sense, but I haven’t found the proper way to access the different array elements… please help! ??

    Plugin Author Eliot Akira

    (@miyarakira)

    Hi Sergio,

    The documentation for displaying WCK fields may not be so easy to find – it’s on the first page at the bottom, where it lists “Support for other plugins”.

    WCK stores metaboxes as arrays, so an additional shortcode or parameter is necessary to display the fields inside. For example:

    Recent surveys:
    [loop type="survey" count="3"]
      [field title]
      [metabox name="survey-info"]
        [field description]
        [field another_field]
      [/metabox]
    [/loop]

    You can use the [metabox] shortcode outside loop to display fields from the current post.

    To display a single field from a metabox:

    [field description metabox="survey-info"]

    It worked perfectly… a very powerful plugin… Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Using WCK Custom Fields’ is closed to new replies.