How to exlude posts that have certain meta_value?

WordPress 3.5 and up supports EXISTS and NOT EXISTS comparison operators. compare (string) – Operator to test. Possible values are ‘=’, ‘!=’, ‘>’, ‘>=’, ‘<‘, ‘<=’, ‘LIKE’, ‘NOT LIKE’, ‘IN’, ‘NOT IN’, ‘BETWEEN’, ‘NOT BETWEEN’, ‘EXISTS’ (only in WP >= 3.5), and ‘NOT EXISTS’ (also only in WP >= 3.5). Default value is ‘=’. http://codex.wordpress.org/Class_Reference/WP_Query … Read more

Custom query variable – get wordpress to redirect to nice permalink url

I figured out a solution myself. No javascript required, only another template function. URL building done manually. The idea is to use the hook ‘template_redirect’, check if the requested page is the corresponding store archive page, then check for $_REQUEST vars there and build a new URL. Finally redirect to this URL. function my_template_redirect() { … Read more

failed to filter hook `get_terms_defaults`

Filters are for modifying data that’s passed through them. You need to take the input, modify it, then return it. function exclude_not_allowed_terms( $args, $taxonomies ) { if(!current_user_can(‘edit_others_posts’) && in_array( ‘my-taxonomy’, $taxonomies ) ) { $args[‘meta_query’] = array( array( ‘key’ => ‘owner’, ‘value’ => get_current_user_id() ) ); } return $args; } add_filter( ‘get_terms_defaults’,’exclude_not_allowed_terms’, 20, 2 );

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