Why is my mod_rewrite not working?

First, your additional line comes too late. The rule before catches everything you want to match. Second, it doesn’t what you want. Your … RewriteRule /([0-9]+/?)$ /about/latest-news/$1 [NC,L] … matches requests like example.com//0000000000000000000/ or example.com/about/latest-news/2010/ (infinite loop!). The first argument for RewriteRule omits the starting /. To match year archives you need rather: RewriteRule ^(\d\d\d\d)/?$ … Read more

Filter my home page posts by category or by tag

You can use the following code to list the posts that are categorized under category id 3 OR have tag ‘urgent’ function exclude_category($query) { if ( $query->is_home ) { $query->set( ‘tax_query’, array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘ID’, ‘terms’ => 3 ), array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => … Read more

The best way to write an FAQ page?

For one project, I created a Custom Post Type called FAQ. From there I just used a page-template to display all FAQ titles with the snippet and a “..Continue Reading” link . This way, if a particular FAQ answer was really long the user could just click to read more. You could also design the … Read more

Search a post using the date it was posted

You can make a custom page template for this specific search page http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates. Then set some $_GET variables (using a form with method GET). And do a custom query for these $_GET values: $date_query = new WP_Query( ‘year=” . $_GET[“year’] . ‘&monthnum=’ . $_GET[‘month’] . ‘&day=’ . $_GET[‘day’] ); Then your custom loop: <?php if … Read more

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