Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks

If you’re running WordPress 3.0.1 or later, I believe your problem lies with the ‘post_type_link’ filter declaration and function arguments. When the ‘post_type_link’ filter is applied, it passes the following 4 arguments: apply_filters(‘post_type_link’, $post_link, $post, $leavename, $sample); But your function accepts $post_link and $id. Try the following adjustments: function custom_post_link( $post_link, $post ) { if … Read more

404 to 301 – Fixing old links

If you intend to do checks based on template tags you should hook on wp action. template_redirect will suffice too, but wp is earlier. This is when WP handles 404 itself. To perform a 301 redirect use status_header( 301 );, wp_safe_redirect(); immediately followed by exit; You could use a plugin handle these for you. It’s … Read more

there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?

The no no about loading wp-* files directly are reasonable when you are developing a WordPress plugin or theme, but if you are developing an external code that require WP (and that seems your case) than you must require that files, there is no alternatives. Consider that including wp-blog-header.php is needed when you need to … Read more

Multisite installation on IIS gives 404 trying to access the admin dashboard

As per this issue on the WordPress trac, the problem are the rules 4 and 5. The solution is to change the url parameter and add 1, so, instead of this: <rule name=”WordPress Rule 4″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)” ignoreCase=”false” /> <action type=”Rewrite” url=”{R:1}” /> </rule> <rule name=”WordPress Rule 5″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$” ignoreCase=”false” /> <action … Read more

Permalinks Structure and 404 Question

It’s a bit of a trick to get a WordPress site working within a framework of a non-Wordpress (html only) site in a fully-integrated way (though it can be done!). To keep things simple, I’d keep them pretty separate for the moment, which it sounds like you’re happy to do. So I guess you have … Read more