How do I prefix blog post urls as mysite.com/blog/%postname%/ but allow authors to still be located at mysite.com/authors/%nicename%?

You can set the author base independently by manipulating the $wp_rewrite global: function wpa55976_author_base() { global $wp_rewrite; $wp_rewrite->author_base=”authors”; $wp_rewrite->author_structure=”https://wordpress.stackexchange.com/” . $wp_rewrite->author_base . ‘/%author%’; // EDIT – rewrite rule to force author urls to resolve: add_rewrite_rule(‘authors/([^/]+)/?$’, ‘index.php?author_name=$matches[1]’, ‘top’); } add_action( ‘init’, ‘wpa55976_author_base’ ); Make sure to visit your permalinks page to flush rewrites after you add … Read more

Link to blog index from template

if you are referring to the ‘posts page’ as set under dashboard – settings – reading: <?php if( get_option( ‘page_for_posts’ ) ) { echo get_permalink( get_option( ‘page_for_posts’ ) ); } else { echo home_url(); } ?>

Problem the_permalink

the_permalink() will echo the content immediately. You can’t use it for string concatenation. What is happening is that your permalink gets echoed by the_permalink() before the string is finished building, so the permalink ends up in the wrong place. What you need instead is get_the_permalink(). Side note: Because PHP’s echo will take multiple parameters, separating … Read more

I copied my site to another site but all links point to old site

What web addresses are in your Dashboard > Settings > general? if it is the old site, try changing it, if changing is impossible, try putting the following code at the top op wp-config.php: define(‘WP_HOME’,’http://www.new_site.com’); define(‘WP_SITEURL’,’http://www.new_site.com’); Are the site urls correct? Try searching your page template and see if you have still some old links … Read more