Get Posts that have featured Images

$args = array(
'post_type' => 'post',
'posts_per_page' => 7,
'meta_query' => array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'

$query = new WP_Query($args);
while($query->have_posts()) {
if ( has_post_thumbnail() ) { // double checking
$out.= the_title();
$out.= get_the_post_thumbnail('thumbnail');

MySQL query logging

As of MySQL 5.1.12, you can rename the general query log file at runtime by disabling the log:

SET GLOBAL general_log = ‘OFF’;

With the log disabled, rename the log file externally; for example, from the command line. Then enable the log again:

SET GLOBAL general_log = ‘ON’;

This method works on any platform and does not require a server restart.

Network windows 7 and OS X

Goto Start Menu
Search for: security
Click on Local Security Policy
Goto Local Policies> Security Options
Double Click on Network security: LAN Manager Authentication

Look in Network for the OS X computer you have enabled sharing on !
Change level to: Send LM # LTLM Responses

Then, scroll down to Network security: Minimum session security for NTLM SSP
De-select Require 128-bit encryption
Hit OK

OS X apache permissions

Setting up a web server on OS X other than the built in one and serving sites from the Document directory always causes permissions headaches this stackoverflow response helped nut it out ( )

In Summary

This is the most restrictive and safest way I’ve found, as explained here for hypothetical~/my/web/root/ directory for your web content:

  • For each parent directory leading to your web root (e.g. ~/my~/my/web~/my/web/root):
    • chmod go-rwx DIR (nobody other than owner can access content)
    • chmod go+x DIR (to allow “users” including _www to “enter” the dir)
  • sudo chgrp -R _www ~/my/web/root (all web content is now group _www)
  • chmod -R go-rwx ~/my/web/root (nobody other than owner can access web content)
  • chmod -R g+rx ~/my/web/root (all web content is now readable/executable/enterable by _www)