- This topic has 3 replies, 2 voices, and was last updated 5 years, 9 months ago by
Steve.
-
AuthorPosts
-
-
May 10, 2016 at 8:31 am #6465
semwangajoshuaMemberI’ve created my Editor fields and then show up just fine in the metaboxes; but they simply don’t post anything because no matter what try, I can’t any values stored by them. Even at the time of updating a page where I display those metaboxes in which they are, they show no previous content entered in them like the rest of the fields do. I’ve tried copying and using some editor field code from the documentation itself and from the Piklist demo pages but still I get nothing when i try to access their values to show on the frontend. I’m confused and I feel burned out from trying them. Someone please help me out here because using a textarea isn’t in my best interest instead of an editor field because the content may carry some formatting that only the editor can allow.
-
May 10, 2016 at 10:35 am #6470
SteveKeymaster@semwangajoshua- Please post your code here and we’ll take a look.
-
May 10, 2016 at 11:25 am #6473
semwangajoshuaMemberHere’s what I have in my metaboxes parts folder:
//Section 2 Content piklist('field', array( 'type' => 'editor' ,'scope' => 'post' ,'field' => 'sctn2_content' ,'label' => __('Section 2 content') ,'description' => __('Content to appear after the sub-headline') ,'help' => 'Content to appear after the sub-headline' ,'value' => '' ,'placeholder' => 'Content here' ,'options' => array ( 'wpautop' => true ,'media_buttons' => false ,'tabindex' => '' ,'editor_css' => '' ,'editor_class' => '' ,'teeny' => false ,'dfw' => false ,'tinymce' => true ,'quicktags' => true ) ));<code></code>And this is how I access the values:
<?php echo wpautop(get_post_meta($post->ID, 'sctn2_content', true)); ?>And for some reason I that I don’t understand, everytime I try to update a page with after enter new content into the editor field, WordPress throws up the error below:
<br /> <b>Fatal error</b>: Maximum execution time of 30 seconds exceeded in <b>C:\xampp\htdocs\lawyeah\wp-includes\wp-db.php</b> on line <b>1803</b><br />This happens for when I try update a page and part of the new data to be posted is that of the Editor field.
-
May 10, 2016 at 3:03 pm #6476
SteveKeymaster@semwangajoshua– You have some conflicting code here:
'scope' => 'post': means you want to save this data to the wp_posts table
'field' => 'sctn2_content': means you want to save this data to the fieldsctn2_content. HOWEVER,sctn2_contentis not part of the wp_posts table.I’m guessing you want to save this as post_meta, so just remove the scope parameter and it should work.
-
-
AuthorPosts
- You must be logged in to reply to this topic.