WordPress: get recent posts, delete the current category

Assuming you are using custom query to fetch the latest posts from other categories. In that case, you don’t need to hook into pre_get_posts as the category__not_in parameter can be passed directly into the query arguments. //Get the current category ID $catID = get_queried_object_id(); //Pass it to the Query arguments $args = array( //Your other … Read more

How can we take into account post types when constructing permalinks?

When you register your taxonomy you can create the rewrite rule for the slug register_taxonomy(‘investment_country’,array(‘investment’), array( ‘hierarchical’ => true, ‘labels’ => $labels, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => array( ‘slug’ => ‘country’ ), )); so whenever I’m showing something that I have included in the country taxonomy I get http://www.domain.com/country/unitedkingdom for example don’t … Read more

How to configure apache to create files with correct group owner [closed]

You may as I have found need to change the group that apache runs under. In ubuntu you can do this by editing the /etc/apache2/envvars file. The above answer by AlxVallejo is mostly correct but this (Tom’s) is a better answer with regards to setting permissions https://serverfault.com/questions/6895/whats-the-best-way-of-handling-permissions-for-apache2s-user-www-data-in-var Also I found that even when you do … Read more

mod_rewrite loop, redirecting http to https on certain section of wordpress blog

I am by no means a mod_rewrite expert but would something like this work? <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # Force HTTPS for /cart/ RewriteCond %{HTTPS} !=on RewriteCond %{THE_REQUEST} ^[A-Z]+\s/cart [NC] RewriteRule ^(cart) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] # Force HTTPS for /my-account/ RewriteCond %{HTTPS} !=on RewriteCond %{THE_REQUEST} ^[A-Z]+\s/my-account [NC] RewriteRule ^(my-account) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] # Force HTTPS … Read more

Apache Fallback instead of add_rewrite_rule

This fixed my issue. function my_query_vars($vars) { $my_vars = array( ‘PARAMETERS’ ); return array_merge($my_vars, $vars); } add_filter(‘query_vars’, ‘my_query_vars’); function my_rewrite_rules($rules) { global $wp_rewrite; $my_page=”PAGESLUG”; $my_rule = array( ‘URL/?’ => ‘index.php?pagename=” . $my_page . “&school_type=$matches[1]’ ); return array_merge($my_rule, $rules); } add_filter(‘page_rewrite_rules’, ‘my_rewrite_rules’);

.htaccess Security Header Rules

The RewriteEngine On line (as you have indicated) isn’t necessary, and pertains to a different module, mod_rewrite. You should remove it from the mod_headers block. It’s possible that you don’t have the Headers Apache module installed or activated on your host. If it is possible to run the test with some breakage, you could try … Read more

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