Rewrite vs Redirect from ?p={ID}

A rewrite enables http://example.com/post-title/ to translate internally to the proper query vars to load the requested post. The shortlink does a 301 redirect to the pretty URL because it should not be possible to access the same content from more than one URI. This is so a search engine won’t index the same post under … Read more

add_rewrite_rule to remove /category/ from permalink

I believe the rewrite rule your wanting to alter is this category/(.+?)/?$ index.php?category_name=$matches[1] category to do what you want it should just be a case of adding the following rewrite rule in your functions.php add_rewrite_rule(‘(.+?)/?$’, ‘index.php?category_name=$matches[1]’, ‘top’); this should work but might conflict with other rules so that will be worth checking.

Strange behaviour of is_user_logged_in() and get_current_user_id()

I’ve run your code and it works fine to me except for the inclusion in file-access.php: require_once($_SERVER[‘DOCUMENT_ROOT’].’/wp-load.php’); enable debug to see if there are errors depending on other issues and not regarding these specific code lines. But.. as per WP documentation: actions reference the earlier action hook where the authentication process is completed and cookies … Read more

How to rename custom taxonomy URL with extra words

You’d be better off adding or modifying the rewrite variable that’s being passed to your register_taxonomy() call for the custom taxonomy. You can modify the rewrites to suit your purpose. For example: $taxonomy_args = array( // All the variables and their values… ‘rewrite’ => array( ‘slug’ => ‘services/home-care’, ), // …more variables and values… ); … Read more

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

How to rename index.php to home.php

how to correct example.com/home.php? First, put things back the way you found them. Both index.php and home.php are reserved file names. And index.php is special not only to WordPress but to the server itself– look into DirectoryIndex. You should not be manipulating them in this way. Unless you really know what you are doing you … Read more

How do I redirect a post url to a custom url?

Well, actually WordPress provides wp redirect function. And here is a small plugin I’ve used a while back <?php $redirect_meta_key = ‘redirect_to’; add_action(‘template_redirect’, ‘redirect_this’); function redirect_this($nothing) { global $wp_query, $redirect_meta_key; if(is_single() || is_page()) { $redirect = get_post_meta($wp_query->post->ID, $redirect_meta_key, true); if(” != $redirect) { wp_redirect($redirect); header(“Status: 302”); exit; } } } ?> No all you have … Read more