Hide post title when single post with specific category

Instead of !is_category(‘campaign-post’) I think it’s !in_category(‘campaign-post’) is_category() is used within Archives pages, when it’s in WP Query. Like your viewing a category archive page, and you’re asking: is this the category queried. in_category() (which uses has_category() which then uses has_term() which then uses is_object_in_term()) relates to single posts, asking: does this post have this … Read more

how to iterate through xml data?

Looks like you would need to loop the XML object results, eg: $comments = array(); foreach ($object->survey as $index => $survey) { if (is_string($survey->comments)) {$comments[$index] = $survey->comments;} } print_r($comments); // to see comments

Database size Widget

Add the following code to your widget code: function fileSizeInfo($filesize) { $bytes = array(‘KB’, ‘KB’, ‘MB’, ‘GB’, ‘TB’); if ($filesize < 1024) $filesize = 1; for ($i = 0; $filesize > 1024; $i++) $filesize /= 1024; $dbSizeInfo[‘size’] = round($filesize, 3); $dbSizeInfo[‘type’] = $bytes[$i]; return $dbSizeInfo; } function databaseSize() { global $wpdb; $dbsize = 0; $rows … Read more

Attach posts based on category and position

I’m wondering if you’re actually looking at post revisions. Keep in mind that WordPress creates a revision of a post any time you make a change to it. Each revision stays in the database, however, the way you access it is by going into the post itself and then locating the revision section in the … Read more