Required Field for Comment parent only?

$comment is not set inside that function. Look into variable scope. $_POST[‘comment_parent’] should be set though. function custom_validate_comment() { //validate rating if( isset($_POST[‘comment_parent’]) && $_POST[‘comment_parent’] === 0) { if( empty( $_POST[‘rating’]) ) wp_die( __(‘Error: Please Include Your Rating (0 to 5 Stars)’) ); } } add_action(‘pre_comment_on_post’, ‘custom_validate_comment’); You could also rewrite your function to take … Read more

Using Custom Fields in post, need to put into the_content

I think that I would hijack the gallery shortcode. function my_gallery_shortcode($atts) { global $post; $str = gallery_shortcode($atts); $project_title = get_post_meta($post->ID, “Project_Title”, true); $project_date = get_post_meta($post->ID, “Project_Date”, true); $project_location = get_post_meta($post->ID, “Project_Location”, true); $str .= ‘<div class=”project_details”>’; $str .= ‘<div class=”project_details_title”>’.$project_title.'</div>’; $str .= ‘<div class=”project_details_date”>’.$project_date.'</div>’; $str .= ‘<div class=”project_details_location”>’.$project_location.'</div>’; $str .= ‘</div>’; return $str; } add_shortcode(‘gallery’,’my_gallery_shortcode’); … Read more

Link to all posts page?

Your 2nd example omits the leading / in the URL — does /wp-admin/edit.php work? Also, you’re wiser to use admin_url(), since it’s possible to change the Admin URL to something other than /wp-admin. Instead of <a href=”https://wordpress.stackexchange.com/wp-admin/edit.php”>, use <a href=”https://wordpress.stackexchange.com/questions/103685/<?php echo( admin_url(“edit.php’ ) ); ?>”>. It’s more complicated, but much safer.

Create thumbs only when a post is sticky or any other way?

As i understand you want new thumb size only for sticky post and for rest is same 1).define a new size using add_image_size() and use is_sticky() to check post is sticky or not add_image_size(‘thumb-sticky’,’your_width’,’you_height’) 2.)and put if condition in your slider or whatever if( has_post_thumbnail() ): //check post is sticky if( is_sticky() ): //This post … Read more

Custom Post Type Template based on Taxonomy

I’m afraid you have to do this manually. You can put someting like this in your single-vehicles.php file: if ( … ) { // check if it’s in used category/term get_template_part(‘part-single-vehicles-used’); } else { get_template_part(‘part-single-vehicles-new’); } And then put new car template into part-single-vehicles-new.php file and used car template into part-single-vehicles-used.php.