301 Redirect /author/username/ to /profile/username/
Add this to ‘your’ section of the .htaccess file (so not in the WordPress section): Redirect 301 /author http://yourdomain.com/profile
Add this to ‘your’ section of the .htaccess file (so not in the WordPress section): Redirect 301 /author http://yourdomain.com/profile
I found the answer with a little more searching. Sorry — Admins feel free to delete this question! The answer is here add_action( ‘template_redirect’, ‘wpse_76802_maintance_mode’ ); function wpse_76802_maintance_mode() { if ( ! is_page( 1618 ) ) { wp_redirect( home_url( ‘index.php?page_id=1618’ ) ); } } EXCEPT …. if there is a way to enhance this redirect … Read more
There’s actually a hook for this: wp_login_failed.
I figured it out, and it’s kinda boneheaded, but an easy mistake. I originally had the site running under a development domain (domain.info), then went live under a different domain (domain.com). I had FTP access to both domains, and it seemed while logging in using the “.info” domain was having an effect if I tried … Read more
home_url() will accept a parameter that will be used in the creation of the URL. The bare minimum solution would be: add_action( ‘wp_logout’, create_function( ”, ‘wp_redirect(home_url(“/path/to/page”));exit();’ ) ); site_url() will also accept the same parameter and may be (probably is) a better choice. I believe that using either of those will make the link dependent … Read more
If BigOffer part is static it can be easyly done with a rewrite rule: add_action(‘init’, ‘big_offer_rule’); function big_offer_rule() { add_rewrite_rule(‘^BigOffer([0-9]+)/?’,’index.php?pagename=bigoffer&offerId=$matches[1]’,’top’); } add_filter(‘query_vars’, ‘big_offer_vars’); function big_offer_vars( $vars ) { return array_merge($vars, array(‘offerId’) ); } After you added this code, you have to flush rules going in Settings -> Permalinks section in your backend and saving changes. … Read more
Rename your <select> to something other than page_id. The problem is that page_id is already taken (and handled) by WordPress (as query var). This should do, for example: <?php if (isset($_GET[‘editevent’]) && true == $_GET[‘editevent’]) echo ‘Post ID: ‘.$_GET[‘my_page_id’]; ?> <form method=”GET” action=”#”> <select name=”my_page_id” id=”my_page_id” onchange=”this.form.submit()”> <?php $args = array( ‘posts_per_page’ => -1, ‘post_type’ … Read more
When you designate a page as the posts page, is_page() will no longer be true for that page, as it is now the “Home Page”. Use is_home() instead to test if the posts page is the current page.
You need to use the same method qtranslate uses to get the language parameter in the url. Quickly glancing through the source it seems to be qtrans_getLanguage() $url = home_url( qtrans_get_language() ); wp_redirect( esc_url( $url ) );
Two (give or take) points to consider here. One – we don’t want anyone to see direct links in first place. Scrubbing them from admin side is quite a pain, but a post_link filter in get_permalink() (and maybe couple more filters in others) should allow to (mostly) override those. Two – we don’t want users … Read more