How do I update custom field post meta in frontend post template?
How do I update custom field post meta in frontend post template?
How do I update custom field post meta in frontend post template?
I wanted to update this older question. I got this working or at least I got the saving worked out. Thanks Tom J Nowell for your input. I considerd using the REST API yes, I looked at some introductions, but this went over my head. The REST API but also AJAX is kinda new to … Read more
Don’t open edit post link in new tab
in the free theme Customizr, you can add content after the edit link with this code in the file functions.php of the child theme add_action(“__after_regular_heading_title”, function () { $post = $GLOBALS[“post”]; ?> <span> an addition after the link to edit “<?php echo htmlspecialchars($post->post_title);?>” </span> <?php });
Frontend media shows “An error occurred in the upload. Please try again later.”
This worked for me: In the template file (used with that existing form), before the get_header(); call/line, add this code: global $my_dates_MB; // If you changed the meta box ID (i.e. mydates), change it also below. add_filter( ‘rwmb_show_mydates’, ‘__return_false’ ); $meta_boxes = get_dates( [] ); $my_dates_MB = rwmb_get_meta_box( $meta_boxes[0] ); if ( isset( $_POST[‘my_dates_post_ID’] ) … Read more
here is how to do it: <form action=”#” method=”post”> <input type=”checkbox” name=”checklist[]” value=”1″><label>Blue</label> <input type=”checkbox” name=”checklist[]” value=”2″><label>Red</label> … <input type=”submit” name=”submit” value=”submit”/> </form> <?php if(isset($_POST[‘submit’])){ if(!empty($_POST[‘checklist’])){ $selectArr = array(); foreach($_POST[‘checklist’] as $selected){ $selectedInt = (int)$selected; $selectArr[] = $selectedInt; wp_set_object_terms( $thePostId, $selectArr, ‘color’); } } } ?> where the values in input tags are taxonomies IDs … Read more
Your code looks ok. Maybe this line: elseif(email_exists(esc_attr( $_POST[’email’] )) != $current_user->id ) Should be elseif(email_exists(esc_attr( $_POST[’email’] )) != $current_user->ID ) Every developer should start with learning how to debug code. Otherwise you’re just trying stuff like a headless chicken ;-). WP Debugging In your wp-config.php, change: define( “WP_DEBUG”, false ); Into: define( “WP_DEBUG”, true … Read more
How to generate an HTML link automatically from URL in a users’ post
I use Postie to allow non-technical users to post items via email, including pictures/media. Easy enough to set up; checks email every xx minutes (several choices). When an email is found, it converts that to a post. Works well, and is well-used. https://wordpress.org/plugins/postie/