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

Create rewrite rule for subpage

I do something similar. I have a page (country_tc) that uses a custom page template that either dynamically generates info for requested country, or a series of sub-pages for the country e.g. /country/Egypt (index.php?pagename=country&countrytc=egypt) /country/egypt/safety (index.php?pagename=country&countrytc=egypt/safety) I use page_rewrite_rules for the re-write. I’ve not had time to vet your code, so this is how I’d … Read more

WP in subfolder hidden by htaccess, but media links show the subfolder

One option is to explicitly move the wp-content folder one level up so it resides at /public_html/wp-content by defining WP_CONTENT_DIR in wp-config.php. For this I’d recommend something more like the second method described in Giving WordPress Its Own Directory. Editing wp-config.php has an example for the WP_CONTENT_DIR change. The resulting directory structure (relative to public_html … Read more

Rewrite author URL to example.com/u/{user_id}/{username}/

Figured it out! /** * Replace %author_id% by author_id. * * @since 1.0.0 * @param string $link * @param int $author_id */ add_filter( ‘author_link’, ‘wpse_298572_change_author_link’, 10, 2 ); function wpse_298572_change_author_link( $link, $author_id ) { $link = str_replace( ‘%author_id%’, $author_id, $link ); return $link; } /** * Rewrite the user link. * * @since 1.0.0 */ … Read more

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