Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?

The following 2 filters allow you to hook into when WordPress checks the slug and are found in the function wp_unique_post_slug() in the wp-includes/post.php file. There are 2 filters, one for hierarchical posts and one for non-hierarchical. The hierarchical filter provides the ID for the post parent so if the $post_parent is 0, you know … Read more

Show page without reference to post (like front-page)

Thanks to toschos hint I could solve the problem. This is the code that I use: // Register the endpoint function my_init() { add_rewrite_endpoint(‘votes’, EP_ALL); } add_action(‘init’, ‘my_init’); // Execute a function when the endpoint is called function my_redirect() { global $wp_query; if (isset($wp_query->query_vars[‘votes’])) { $wp_query->is_404 = false; add_filter( ‘wp_title’, ‘my_title_votes’, 10, 2 ); // … Read more

Pagination posts. Url format

Your rewrite rule format is not correct. The $rewrite argument must point to index.php with query vars set so WordPress can create the default query: add_action( ‘init’, ‘wpa103850_init’ ); function wpa103850_init() { add_rewrite_rule( ‘^([^/]+)([0-9]{1,2}).htm$’, ‘index.php?name=$matches[1]&page=$matches[2]’, ‘top’ ); } However, this will still not work correctly, due to the canonical redirect. WordPress wants to enforce a … Read more

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