Table not getting created upon activation of WP Theme

dbDelta is extremely picky. Looking at your code I’d say you’ve violated this rule: You must put each field on its own line in your SQL statement Two of your fields are sharing lines with parenthesis. I haven’t tested that particular pattern but dbDelta is extremely picky. I don’t know if that space after NOT … Read more

Show recent posts in a table format

You still can use lists – just use proper CSS (every third li – first li in every row – should have clear property set; You can use CSS classes or :nth-child selector to do this). If you really have to use table (I don’t suggest it – it’s not a very good idea, because … Read more

Table appears in Visual mode of editor but not in preview or after publish

Whenever $results_desc->feed_product_desc is empty, the post content is used. Otherwise the content is never used. if (!empty($results_desc->feed_product_desc)){ $content = $results_desc->feed_product_desc; } else { $content = get_the_content(); $content = strip_tags($content); } Whenever the post content is used, all HTML tags are stripped. $content = get_the_content(); $content = strip_tags($content); To get the full content with all the … Read more

How to populate custom tables with rows of data

Looking at this article on WP.org it seems you have to create your database first, with some SQL: function mp_install_table() { global $wpdb; $table_name = $wpdb->prefix . “countries”; $sql = “CREATE TABLE $table_name ( id mediumint(9) NOT NULL AUTO_INCREMENT, name tinytext NOT NULL, labour_cost INT, overheads FLOAT, profits FLOAT );”; require_once( ABSPATH . ‘wp-admin/includes/upgrade.php’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)