Archive for September, 2013

SQL manipulations for WordPress comments and trackbacks

Disable comments and trackbacks globally:

UPDATE wp_posts SET comment_status = 'closed';
UPDATE wp_posts SET ping_status = 'closed';

Disable comments and trackbacks on post type:

UPDATE wp_posts SET ping_status = 'closed' WHERE post_type = 'post|page';

Disable comments and trackbacks on post status:

UPDATE wp_posts SET ping_status = 'closed' WHERE post_status = 'publish|inherit|pending|private|future|draft|trash' AND post_type = 'post';

EWEA Navigation include

Here’s how to include the EWEA navigation file in templates for microsites:

<div id="navigation">
<?php
// INCLUDE EWEA MENU
$naviURL = "http://www.ewea.org/navigation-file/";
if ($fh = fopen($naviURL,"r"))  {
   fpassthru($fh);
} else {
   echo "<p>Unable to load menu.</p>\n";
}
?>
</div><!-- end #navigation -->

Postfix doesn’t start after a re-install

Perhaps this might be the solution. Check if there are the necessary sendmail files below.
If you do not have /usr/sbin/sendmail, check if after installing postfix package, you have:

/usr/sbin/sendmail.postfix

If you do, simply make a symlink:

ln -s /usr/sbin/sendmail.postfix /usr/sbin/sendmail