check if comment submitted was successful

You can use wp_insert_comment($data); function to check your comment is submit or not. This function will return (integer) The new comment’s ID. on success & (boolean) false if the insert failed. Hope this will helps you

404 error when I acess the second page of post-type

For modifying the main query, I think it is best to take advantage of the pre_get_posts action. When using pre_get_posts the $query variable is passed “by reference” which means we can directly manipulate the $query object with the shortcut functions such as set_query_var. Remove the query code from your taxonomy template, and try the following … Read more

Generate sidebar depending on height of post

JavaScript is definitely the way to go. Have a look at jQuery’s height() and outerHeight() functions. outerHeight() includes margins and padding, height() doesn’t. To keep this as simple as possible I would render a fixed-height sidebar initially (from WP/PHP) where the height is a sensible estimate of your longest post and then use JavaScript to … Read more

Using custom tables for old posts

a simple and Not perfect solution which will do most of the job for you is to overwrite the table names like this: function custom_prefix_change($sql) { global $wpdb,$wp; $prefix = $wpdb->prefix; if(is_single()){ //check if the post exists in the genuine posts table $results = $wpdb->get_results($sql,”ARRAY_A”); if($results[0][‘ID’]){ //if exists then return return $sql; }else{ //else change … Read more

Widget HTML Display Problem

That’s a common mistake, Shortcodes should return values and not echo. Remember, the Codex is your Friend 😉 Shortcode_API#Output Output The return value of a shortcode handler function is inserted into the post content output in place of the shortcode macro. Remember to use return and not echo – anything that is echoed will be … Read more