Taxonomy rewrite question

Your permalink structure for taxonomy will conflict with default one for pages. In the case of the address domain.com/item-one/item-two how does WordPress know if it’s a page item-two with the parent page item-one or item-two is custom post type and item-one is term of region taxonomy? The order of rewrite rules will decide, and because … Read more

Changing directory and/or URL structure

@kureikain’s answer looks great, and it probably works really well in a wide variety of circumstances. But for author URLs specifically, there’s a simpler way. Change the author_base, like so: global $wp_rewrite; $wp_rewrite->author_base = “people”; $wp_rewrite->flush_rules(); You should only need to run this once, perhaps on a plugin activation. Updating WordPress should not affect this … Read more

How to create the pseudo static rules of the page I created

You need a rewrite rule! First things first let’s get that in place: function wpse_226796_rewrite_rule( $rules ) { global $wp_rewrite; // http://php.net/manual/en/reference.pcre.pattern.syntax.php $regex = ‘postcomment-page/([1-9][0-9]*)-paged-([1-9][0-9]*)\.html’; $query = sprintf( ‘%s?pagename=postcomment-page&postid=%s&paged=%s’, $wp_rewrite->index, $wp_rewrite->preg_index( 1 ), $wp_rewrite->preg_index( 2 ) ); // Push our rule to the top of $rules return array( $regex => $query ) + $rules; } … Read more

Google is indexing wordpress attachment pages

Just add this to your functions.php or plugin. add_action( ‘template_redirect’, ‘attachment_redirect’, 1 ); /** * Redirect any attachment page to their parent with 301 redirection */ function attachment_redirect() { global $post; if ( is_attachment() AND isset( $post->post_parent) AND is_numeric( $post->post_parent ) ) { wp_redirect( get_permalink( $post->post_parent ), 301 ); exit(); } }

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