How do I get the URL section to show use a different domain in the WordPress Admin?

You can use the post_link filter to do this. Example: function modify_post_link( $url, $post, $leavename=false ) { if ( $post->post_type == ‘post’ ) { $url = str_replace(home_url(), ‘https://preview.domain.com’, $url); } return $url; } add_filter( ‘post_link’, ‘modify_post_link’, 10, 3 ); In fact, with this you don’t even need your previous filter for get_sample_permalink.

WP_PLUGIN_URL equivalent

WordPress is expecting http, but you’re visiting with https which is causing the mixed content error. Setting your site and address URLs to use https should solve your problem. If you can’t use https in the admin, then you’ll need to try ways to tell WordPress to use https only on the frontend. Try something … Read more

Link from page to category posts

Instead of hard-coding the pages, categories and sidebars in your template file(s) you could consider registering a custom metabox to store the category relation (i.e. the category term ID) in the page post meta. This way you could make the sidebar handling dynamic. The first step would be to register, render and handle the saving … Read more

Adding tag slug to post permalink

You need to add a new tag (e.g. %tag%) that you can use in post links. One possibility is to use the add_rewrite_tag() function. Then use the post_link filter to replace the %tag% in the link with the appropriate value. Finally, change the post link structure in the settings. Settings -> Permalinks -> Custom Structure: … Read more

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