Viewing 7 reply threads
  • Author
    Posts
    • #117
      ehoanshelt
      Member

      Hey guys,

      So I got the basics down now where I can display a list of post_metas along the side of the post editor. This is a replica of what the tags and categories looks like.

      What I’m trying to do now is to be able to make that more dynamic rather then static php.

      This is what I would like to do and hopefully you can guide me to the right path. I created a custom post type “Providers” and I would like to have a taxonomy of “Specialty” where we can add more specialties as they come in via the admin menu Providers > Specialties. I got the taxonomy menu to show up using this code:

      http://pastebin.com/aBitgirP

      I also have the specialty values pulling into the post editor using this code:

      http://pastebin.com/3fQ1Wn17

      Now I understand that I would need to plug in the values in the taxonomy page but how would I pull in those taxonomies using piklist?

      Thanks for the support!

    • #120
      Kevin
      Keymaster

      Of course 🙂

      ‘choices’ => piklist(get_terms(‘specialty’), array(‘slug’, ‘name’))

      The piklist function works like wp_list_pluck when you pass an object or array as the first parameter and an array containing the key or key/value pair you want to pluck as the second parameter.

      Let us know if you need anything else.

      Thanks,

      Kevin

    • #121
      ehoanshelt
      Member

      Hey Kevin,

      That looks great 🙂

      Is their anywhere in the documentation that mentions this?

      I tried the code above and when I added a taxonomy, it doesnt show up in the specialty sidebar.

      This is the current side bar code. Sorry to ask so many questions!

      http://pastebin.com/BFdX9YFV

    • #123
      Steve
      Keymaster

      @ehoanshelt– This is a little confusing and definitely needs a tutorial… which we will write up this week.

      You can try this code, which I reformatted a bit to make it easier to explain:http://pastebin.com/RCaFUdcP

      Essentially you can use any of the parameters in the WordPress get_terms function. The reason nothing was showing up was probably because no posts (or CPT’s) were actually assigned as a “specialty”. By default get_terms only shows taxonomies that have content assigned to it.

      By setting “hide_empty” => 0, you told WordPress to pull all the taxonomy values for “specialty”, regardless if they have content assigned or not.

      Try out that code and let us know if it works.

    • #125
      ehoanshelt
      Member

      You guys have been great thus far and that worked for me like a charm. This is a really neat system once you know the ins and outs.

      The finally thing I’m running into and this project is done on my side is these errors:

      Warning: Illegal offset type in isset or empty in /Applications/MAMP/htdocs/woocommerce/wp-includes/taxonomy.php on line 223

      Warning: Illegal offset type in isset or empty in /Applications/MAMP/htdocs/woocommerce/wp-includes/taxonomy.php on line 223

      Warning: Cannot modify header information – headers already sent by (output started at /Applications/MAMP/htdocs/woocommerce/wp-includes/taxonomy.php:223) in /Applications/MAMP/htdocs/woocommerce/wp-includes/pluggable.php on line 881

      Have you seen these before?

      I disabled all plugins but piklist. I can move this question to a new thread if that would be better!

      Thanks for the support guys. I really appreciate it!

    • #126
      Steve
      Keymaster

      These look like PHP notices, which we are working on. Check out this thread and see if they go away: http://piklist.com/support/topic/new-install-w-errors/

    • #127
      ehoanshelt
      Member

      Thanks Steve,

      That is what I did for now and it works good enough for me 🙂

      Thanks for the great support!

    • #142
      Steve
      Keymaster

      All PHP notices should be gone in v0.5.6

Viewing 7 reply threads
  • You must be logged in to reply to this topic.