Forum Replies Created
-
AuthorPosts
-
SteveKeymasterThis reply has been marked as private.
SteveKeymaster@dawood– This should work after you run
get_post_meta():foreach ($dawood as $key => $value) { echo get_permalink($value); }
SteveKeymaster@dawood– Take a look at the array example given in this doc, that should help explain.
Use can always use
print_r()to view the array:print_r($data);
SteveKeymaster@dawood– You can’t get the full permalink directly. Take the ID and use get_permalink().
SteveKeymaster@dawood– The $data array is only made up of one key,
exercise, that’s why$dataworks.
SteveKeymaster@dawood– Try changing the field template, and setting the columns to 12. Add this code to each field:
'template' => 'field ,'columns' => 12Let us know if that works.
SteveKeymasterGreat! closing ticket.
SteveKeymaster@dawwod– Please post your field code.
SteveKeymaster@dawood– You may want to create two text boxes that repeat. One is for the link, and one is the page name. Then put them together in your theme.
SteveKeymaster@dawood– Metaboxes are in the admin, not the front of the site. Let us know where you want to display them and we’ll show you how.
SteveKeymaster@dawood– Would a text box, repeater, work? All you need to do is create a standard text field and add:
'add_more' => truepiklist('field', array( 'type' => 'text' ,'field' => 'field_name' ,'label' => 'Example Field' ,'description' => 'This is a description of the field.' ,'columns' => 12 ,'add_more' => true ));
SteveKeymasterThis is the way the default WordPress media uploader works. Go to add new Post, add a featured image and then click on it again. Should be the same UX.
SteveKeymaster@cosmocanuck– I believe your are talking about two different things:
1) URL Slug: This is set with this parameter,
'rewrite' => array('slug' => 'recipe'). However, you may want to read this article on Single vs Plural permalinks, before you change it.2) Breadcrumbs: I’m not 100% sure, but breadcrumbs may be generated from labels. You don’t have to use the Piklist function to generate the labels. You can manually set them up. Borrowing on the example in the codex:
add_filter('piklist_post_types', 'recipe_post_type'); function recipe_post_type($post_types) { $labels = array( 'name' => _x( 'Recipes', 'post type general name', 'your-plugin-textdomain' ), 'singular_name' => _x( 'Recipe', 'post type singular name', 'your-plugin-textdomain' ), 'menu_name' => _x( 'Recipes', 'admin menu', 'your-plugin-textdomain' ), 'name_admin_bar' => _x( 'Recipes', 'add new on admin bar', 'your-plugin-textdomain' ), 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ), 'add_new_item' => __( 'Add New Recipe', 'your-plugin-textdomain' ), 'new_item' => __( 'New Recipe', 'your-plugin-textdomain' ), 'edit_item' => __( 'Edit Recipe', 'your-plugin-textdomain' ), 'view_item' => __( 'View Recipe', 'your-plugin-textdomain' ), 'all_items' => __( 'All Recipes', 'your-plugin-textdomain' ), 'search_items' => __( 'Search Recipes', 'your-plugin-textdomain' ), 'parent_item_colon' => __( 'Parent Recipes:', 'your-plugin-textdomain' ), 'not_found' => __( 'No Recipes found.', 'your-plugin-textdomain' ), 'not_found_in_trash' => __( 'No Recipes found in Trash.', 'your-plugin-textdomain' ) ); $post_types['recipe'] = array( 'labels' => $labels ,'title' => __('Enter a new recipe title') ,'menu_icon' => 'dashicons-welcome-write-blog' ,'public' => true ,'taxonomies' => array('recipe_tags') ,'rewrite' => array('slug' => 'recipe') ,'supports' => array( 'author' ,'title' ,'thumbnail' ,'revisions' ) ); return $post_types; }Let me know if this makes sense.
SteveKeymasterAdvanced Add-mores are multi-layered. Please read the docs and let us know if it helps.
-
AuthorPosts