Adding a Table to the wordpress database

Try: function vw_postcode_checker_create_db () { global $wpdb; // Create Table Name $table_name = $wpdb->prefix . “vw_postcode_checker”; // Write Query to add table to database if ( $wpdb->get_var(“SHOW TABLES LIKE ‘$table_name'”) != $table_name) { $sql = “CREATE TABLE $table_name ( id INTEGER(10) UNSIGNED AUTO_INCREMENT, postcode varchar(250) DEFAULT ” NOT NULL, area varchar(250) DEFAULT ” NOT NULL, … Read more

For custom templates, is it better to use `template_include` or `type_template`?

{type}_template is a filter inside the get_query_template function. That function is called by a series of functions called get_home_template, get_category_template and so on. It allows you to very specifically target templates. You can see it in action in template-loader.php, where the $tag_templates variable is defined, binding conditions like is_home, is_category and so on to the … Read more

Post Thumbnail help

That is one strange add_image_size() call. You are missing size’s name and mixing up string with integer. And you specify crop mode, when you actually need resize mode. Try this: add_image_size( ‘portfolio-shot’, 640, 9999 ); Then fetch it with: the_post_thumbnail( ‘portfolio-shot’ ); This should properly register image size under portfolio-shot name in soft-resize mode to … Read more