One off rewrite for single post-type slug (show normal page with same URL instead)

I installed Monkeyman Rewrite Analyzer https://wordpress.org/support/plugin/monkeyman-rewrite-analyzer/ which helped a great deal. I saw this referenced on Jan Fabry’s detailed answer on this post which also helped me. First thing that I found out with the plugin was that my rewrites weren’t actually getting added; they didn’t appear in the logic. It turns out the add_rewrite_rule() … Read more

Is it possible to restrict access to specific pages in the admin area based on the page slug?

So following from the comment discussion, a sufficient answer on another StackEx question goes like this: add_filter( ‘parse_query’, ‘exclude_pages_from_admin’ ); function exclude_pages_from_admin($query) { global $pagenow,$post_type; if (is_admin() && $pagenow==’edit.php’ && $post_type ==’page’) { $query->query_vars[‘post__not_in’] = array(’21’,’22’,’23’); } } The only part that’s terribly important to us is the array of post IDS. The problem is … Read more

How to prevent WordPress from abbreviating long slugs?

Without you sharing a post title and its resulting slug to see what is happening, I can only guess. But a lot of the time stop words, or extremely common words, are stripped from slugs. This would be words like the, a, an, etc. The plugin Yoast SEO will do this if you’re running it … Read more

Getting page slug

If you are inside the loop, you don’t need to access global $post, you already have $post variable accessible in your local scope, and this variable holds the data from current loop iteration. If you are outside the loop, then you need to access global $post first, and it will hold whatever data it was … Read more

Remove slugs from custom posts type

if ( ! in_array( $post->post_type, array( ‘internal_doors’ ) ) || ‘publish’ != $post->post_status ) replace above with if ( ! in_array( $post->post_type, array( ‘internal_doors’,’custom post type name1′, ‘custom post type name2’ ) ) || ‘publish’ != $post->post_status ) and if ( ! empty( $query->query[‘name’] ) ) $query->set( ‘post_type’, array( ‘post’, ‘internal_doors’, ‘page’ ) ); replace … Read more

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