get the count of table rows

I think that’s you must using : $wpdb->get_results( “SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1”, OBJECT ); And if you give us the message of error ?

Order taxonomy terms by the frequency of use in the last 30 days

First thing’s first — You’ll have to add that table. The way you do that if you were writing this in a plugin is as follows: function customtaxorder_init() { global $wpdb; $init_query = $wpdb->query(“SHOW COLUMNS FROM $wpdb->terms LIKE ‘term_order'”); if ($init_query == 0) { $wpdb->query(“ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT ‘0’”); … Read more

RSS Subscriber count

A reliable subscriber count is not possible, unless you require registration to access your RSS feeds. For example, my site is being autopolled by 5 other sites using auto aggregators, including 2 or 3 devices of mine, including Google Reader. I count as 1 subscriber, yet if I counted subscribers by how many accesses I … Read more

Retrieve IDs from custom field, count and display results differently according to count

I answer to myself, since this code is working better (previous had an issue) and also I removed a useless “for”: echo ‘<ul class=”related-content”>’; $count = 0; foreach(get_field(‘related_content’) as $post_object) : $count++; if ($count > 0 && $count < 4 ) { printf(‘<li class=”large”><a target=”_blank” title=”‘.get_the_title($post_object->ID).'” href=”‘.get_permalink($post_object->ID).'”><span style=”display: block” title=”‘.get_the_title($post_object->ID).'”>’.get_the_post_thumbnail($post_object->ID, ‘small’).'</span><span class=”thumb-title”>’.get_the_title($post_object->ID).'</span></a></li>’); } elseif ($count … Read more