Forum Replies Created
-
AuthorPosts
-
cjwebdesignttMemberI read that document hughc and I have the two files, I have the form where I have my configuration options. The issue comes with showing content on the frontend based on those configuration options. See screenshot from tomhodg. I have since given up on piklist implementation and documentation always seems to be lacklustre and did it the WordPress way.
cjwebdesignttMemberwow it’s been a month, no response. Can anyone point us to where the documentation for displaying the widgets html and css on the frontend?
cjwebdesignttMemberI have the same issue. There is no documentation on what file you need to create for the widget to be displayed on the front end.
March 5, 2016 at 4:13 pm in reply to: get_post_meta not working on CPT with custom post statuses #6033
cjwebdesignttMemberHi, I have come across this before and its not because of post statuses. It seems from your explanation that you are not saving the meta data.
wp_insert_postandwp_update_postonly save the standard fields you need to save the post_meta usingadd_post_metaandupdate_post_meta.Can you post the function that creates the post and saves the post meta data so I can get a better understanding. An example of how I did this is below:
/** * Insert the new post and associated post meta */ $fullname = $_POST['first-name'] . ' ' . $_POST['last-name']; $entry = array( 'post_title' => wp_strip_all_tags( $fullname ), 'post_type' => 'tgu_form_entry', 'post_status' => 'publish', 'post_author' => $user_id ); $the_post_id = wp_insert_post( $entry ); if($the_post_id) { $wp_tgu_session['user_temp'] = $the_post_id; //Related Job add_post_meta( $the_post_id, '_tgu_related_job', $_POST['job-id'], true ); //Personal Info post meta add_post_meta( $the_post_id, 'tgu_job_first_name', sanitize_text_field($_POST['first-name']), true ); add_post_meta( $the_post_id, 'tgu_job_last_name', sanitize_text_field($_POST['last-name']), true ); add_post_meta( $the_post_id, 'tgu_job_email', sanitize_email( $_POST['email']), true ); add_post_meta( $the_post_id, 'tgu_job_phone', $_POST['phone-number'], true ); //add_post_meta( $the_post_id, 'tgu_job_region', $_POST['region'], true ); add_post_meta( $the_post_id, 'tgu_job_city', $_POST['city-borough'], true ); // Custom Questions for ($i=1; $i < 6; $i++) { if( ! empty( $_POST['tgu_cus_q_' . $i] ) ) { add_post_meta ($the_post_id, 'tgu_cus_q_' . $i, $_POST['tgu_cus_q_' . $i]); } } /** * Upload Resume */ // These files need to be included as dependencies when on the front end. require_once( ABSPATH . 'wp-admin/includes/image.php' ); require_once( ABSPATH . 'wp-admin/includes/file.php' ); require_once( ABSPATH . 'wp-admin/includes/media.php' ); $attachment_id = media_handle_upload( 'upload-resume', $the_post_id ); /** * Handle Add More/ Repeater Fields */ //There are arrays //Education $institution = $_POST['tguinstitution']; $year = $_POST['tguyear']; $degree = $_POST['tgudegree']; $course = $_POST['tgucourse']; $grade = $_POST['tgugrade']; if( count($institution) > 0 ) { for ($i=0; $i < count($institution); $i++) { add_post_meta( $the_post_id, 'tgu_app_ins_' . $i, $institution[$i]['name'], true ); } } if( count($year) > 0 ) { for ($i=0; $i < count($year); $i++) { add_post_meta( $the_post_id, 'tgu_app_yr_' . $i, $year[$i]['name'], true ); } } if( count($degree) > 0 ) { for ($i=0; $i < count($degree); $i++) { add_post_meta( $the_post_id, 'tgu_app_deg_' . $i, $degree[$i]['name'], true ); } } if( count($course) > 0 ) { for ($i=0; $i < count($course); $i++) { add_post_meta( $the_post_id, 'tgu_app_crse_' . $i, $course[$i]['name'], true ); } } if( count($grade) > 0 ) { for ($i=0; $i < count($grade); $i++) { add_post_meta( $the_post_id, 'tgu_app_grade_' . $i, $grade[$i]['name'], true ); } } //----------- //Experience $company = $_POST['tgucompany']; $industry = $_POST['tguindustry']; $jobtitle = $_POST['tguexpjobtitle']; $year = $_POST['tguexpyear']; $role = $_POST['tguexproles']; if( count($company) > 0 ) { for ($i=0; $i < count($company); $i++) { add_post_meta( $the_post_id, 'tgu_app_exp_co_' . $i, $company[$i]['name'], true ); } } if( count($industry) > 0 ) { for ($i=0; $i < count($industry); $i++) { add_post_meta( $the_post_id, 'tgu_app_exp_in_' . $i, $industry[$i]['name'], true ); } } if( count($jobtitle) > 0 ) { for ($i=0; $i < count($jobtitle); $i++) { add_post_meta( $the_post_id, 'tgu_app_exp_job_' . $i, $jobtitle[$i]['name'], true ); } } if( count($year) > 0 ) { for ($i=0; $i < count($year); $i++) { add_post_meta( $the_post_id, 'tgu_app_exp_yr_' . $i, $year[$i]['name'], true ); } } if( count($role) > 0 ) { for ($i=0; $i < count($role); $i++) { add_post_meta( $the_post_id, 'tgu_app_exp_rr_' . $i, $role[$i]['name'], true ); } } //References $reffulln = $_POST['reffn']; $refco = $_POST['refco']; $reftitle = $_POST['reftitle']; $refPhone = $_POST['refphone']; if( count($reffulln) > 0 ) { for ($i=0; $i < count($reffulln); $i++) { add_post_meta( $the_post_id, 'tgu_ref_fn_' . $i, $reffulln[$i]['name'], true ); } } if( count($refco) > 0 ) { for ($i=0; $i < count($refco); $i++) { add_post_meta( $the_post_id, 'tgu_ref_co_' . $i, $refco[$i]['name'], true ); } } if( count($reftitle) > 0 ) { for ($i=0; $i < count($reftitle); $i++) { add_post_meta( $the_post_id, 'tgu_ref_job_' . $i, $reftitle[$i]['name'], true ); } } if( count($refPhone) > 0 ) { for ($i=0; $i < count($refPhone); $i++) { add_post_meta( $the_post_id, 'tgu_ref_ph_' . $i, $refPhone[$i]['name'], true ); } } return $the_post_id; } else { throw new Exception('There was a problem creating your application'); }Notice that on successful wp_insert_post you will get the post_id, therefore if the post_id is present then you update_post_meta.
cjwebdesignttMemberHi ndbe,
Thanks for the suggestion, I will try it. I came across that filter but was unsure since it fires after the post is saved and wanted to manipulate before it was saved to the database but perhaps this is my best shot. I will let you know if it works out.
Thanks again
March 5, 2016 at 3:57 pm in reply to: First time Piklist user having problem limiting metabox to specific post type. #6031
cjwebdesignttMemberHi,
Could you provide how you registered your post type and its name when registering. You have to make sure Post Type is set to the registered name of the post type example if I registered a post with piklist e.g
$post_types['client'] = array( 'labels' => piklist( 'post_type_labels', 'Client' ), 'title' => __('New Client', 'cjwd-scm'), 'public' => true, 'supports' => array( 'title', 'editor', 'thumbnail' ), 'menu_icon' => 'dashicons-store', 'edit_columns' => array( 'title' => __('Client Name', 'cjwd-scm' ) ), );Post Type: client
March 25, 2015 at 11:26 am in reply to: Installing piklist via composer / Piklist composer package #3496
cjwebdesignttMemberOh Cool. Never knew of this resource. Thanks very much. It will do nicely.
March 24, 2014 at 7:38 pm in reply to: Displaying post meta from advanced add_more grouped fields #1611
cjwebdesignttMemberThanks a million Steve for clearing that up.
Yea the docs need to be updated with this example because I would’ve never thought to call piklist’s get template part for the features from within main template.You should also mention in the docs that when doing it with a plugin, the main template file needs to go in the parts folder of the plugin folder structure and initial call to the main template file can be in your theme template files.
Thanks again so much.
cjwebdesignttMemberThanks much Marcus, I was getting so frustrated. You are a Godsend.
That last thing worked.My theme is a child theme with theme_name/piklist/parts/etc as usual.
Thanks again so much. I guess I have to keep this edit file handy if there is another update to the piklist plugin. So annoying.
On a totally unrelated matter: Do you have experience with getting advanced group add_more fields values displaying on the front end?
See thread post: HERE
cjwebdesignttMemberMarcus I tried making your edits.
But I get an error on one of your changes line 208:
$spt = self::$paths[$_theme];NOTICE: C:\wamp\www\tap\plugins\piklist\includes\class-piklist.php:208 - Undefined index: parent-theme
cjwebdesignttMemberAn update to this problem. The errors above only happen when the folder structure ( piklist/parts/etc….) are added to the theme.
In fact just adding an empty piklist folder triggers the errors.I still don’t understand why this is happening.
March 23, 2014 at 12:31 pm in reply to: Displaying post meta from advanced add_more grouped fields #1599
cjwebdesignttMemberYes I did and I tried that as mentioned in my post above. I haven’t gotten it to work.
One of the latest attempts is presented below (This is in a shortcode funtion):$loop = new WP_Query( array( 'post_type' => 'cjwd_product', 'orderby' => 'title' ) ); if ( $loop->have_posts() ) { $output = '<div class="products">'; while( $loop->have_posts() ) { $loop->the_post(); $meta = get_post_meta( get_the_id(), 'pricing_tier_group', true ); //var_dump($meta); } $output .= ' <article class="product"> <header class="product-header"> <div class="grid"> <div class="grid__item one-whole desk-one-half"> <h2 class="product-name"> ' . get_the_title() . '</h2> <p class="product-description"> ' . get_the_content() . '</p> </div> </div> </header> ' . piklist("content-product", array( "data" => $meta, "loop" => "data" ) ) . '</article>'; } return $output;And the template part for testing (template name: content-product.php):
<li><?php echo $data['pricing_tier_group']; ?></li>
cjwebdesignttMemberHi Marcus,
Thanks for the suggestion but that did not solve the problem.
cjwebdesignttMemberOk let me clarify as much as possible.
I’m working on my local development machine which is a Windows 7 machine running Wamp to run WordPress 3.8.1 etc.Problem 1: About and Settings Page for Piklist Plugin (v 0.9.3.1) are both blank.
Problem 2: I believe as a result of Problem 1, my metabox fields are not showing up. I can see the metabox with its title but its blank. The metabox fields are created by custom post types using my own custom post type plugin ( which is a piklist plugin)
Problem 3: A previous install of WordPress had 0.9.3 and I updated to 0.9.3.1 and it stopped working giving the following errors:
Notice:Undefined variable: Notice: Undefined variable: _part in C:\wamp\www\wpthemetester\wp-content\plugins\piklist\includes\class-piklist.php on line 208Notice: Undefined variable: _part in C:\wamp\www\wpthemetester\wp-content\plugins\piklist\includes\class-piklist.php on line 210
Warning: include(C:\wamp\www\wpthemetester\wp-content\themes\cjwebdesign\piklist): failed to open stream: Permission denied in C:\wamp\www\wpthemetester\wp-content\plugins\piklist\includes\class-piklist.php on line 272
Warning: include(): Failed opening ‘C:\wamp\www\wpthemetester/wp-content/themes/cjwebdesign/piklist’ for inclusion (include_path=’.;C:\php\pear’) in C:\wamp\www\wpthemetester\wp-content\plugins\piklist\includes\class-piklist.php on line 272
I have the correct permissions. I tried chmod’ing other permissions settings and nothing has worked.
Please Advised.
cjwebdesignttMemberHi
I am having this issues as well.
Piklist 0.9.3.1
Windows 7
wampIt was working one minute and next minute it was blank. I can see my piklist post type producing the necessary custom post types
as well as the meta box title but the fields are not showing up.This is after a clean wordpress install to fix another bug piklist stopped working after updating from WordPress dashboard from 0.9.3 to 0.9.3.1. I uninstalled it but could reinstall because for some reason it locked file permissions to the plugins folder in wp-content and could not create the folder to reinstall.
-
AuthorPosts