Forum Replies Created
-
AuthorPosts
-
SteveKeymasterWhen you activate the Piklist Demos, and add a new Demo, is the first tab highlighted?
SB
SteveKeymasterDoes this happen on EVERY new post?
Try this and see if it helps:
piklist('field', array( 'type' => 'textarea' ,'scope' => 'post_meta' // Not used for settings sections ,'field' => 'project_description' ,'label' => 'Project Description' ,'description' => 'This is a description of the project.' ,'attributes' => array( 'rows' => 10 ,'cols' => 50 ,'class' => 'large-text' ) ));
SteveKeymasterI tested this code and it works great for me. Are there any other Piklist meta boxes on the page? If so, make sure none of them have a field called
project_description
SteveKeymaster@cosmocanuck– Glad you figured it out!
Since Piklist does everything the WordPress way, in most cases you can use standard WordPress functions to solve your issue. So don’t only look on the Piklist.com site for your answers, any WordPress tutorial on getting images would work.
Closing ticket.
SteveKeymasterWhat happens? Which tab is default? Please post a screenshot.
SteveKeymasterDid you register a taxonomy?
In the demos, you can add terms at Piklist Demos > Demo Taxonomies.
SteveKeymaster@achowell– This code snippet looks fine. It would help if we can see all your code. Either post here, or email to [email protected]
SteveKeymasterI think I understand now:
1) Your Piklist Field ‘collections’ should go in the meta-boxes folder.
2) Building widgets with Piklist is easy. You can follow this doc.Let me know if this helps.
SteveKeymaster@redywebs– Welcome to the Piklist community!
One of the best parts of Piklist is that it’s code-based, which allows you to do almost anything.
If you only want Editors (or above) to select child terms than you can wrap the field in a conditional statement:
if(current_user_can('edit_pages')) : $parents = get_terms('colections', array('hide_empty' => false,'parent' => 0 )); foreach ($parents as $parent => $value) { piklist('field', array( 'type' => 'checkbox', 'scope' => 'taxonomy', 'field' => 'colections', 'label' => $value->name, 'choices' => piklist( get_terms('colections', array( 'hide_empty' => false, 'child_of' => $value->term_id )), array( 'term_id', 'name' ) ) )); } endif;Let me know if that works for you.
SteveKeymasterHey Tyler– Glad to help! If you have a minute, please tell the world how much you love Piklist by leaving a 5 Star review on WordPress.org.
Closing this ticket.
SteveKeymaster@nate9024– Welcome to the Piklist community!
Glad all is working for you. Closing this ticket.
SteveKeymasterFrontend rendering for this type of field isn’t implemented yet. You need to go old school. Try this:
$yachts_fuel = get_post_meta($post->ID, 'yachts_fuel', true ) switch ($yachts_fuel) { case 'option1': echo 'Πετρέλαιο'; break; case 'option2': echo 'Βενζίνη'; break; }
SteveKeymasterI misunderstood what you wanted. This is the perfect way to do it. Piklist way == WordPress way.
SteveKeymaster@vagelis– Easily getting term meta is something that is lacking from WordPress. You have two choices:
1) Use WordPress function get_metadata.
2) There’s a helper function in Piklist you can use. get_term_meta works exactly likeget_post_meta.
SteveKeymasterGreat! Closing ticket.
-
AuthorPosts