No url when downloading PDF

See the answer here https://stackoverflow.com/a/13839507/1466973 , which involves sending headers with the appropriate values to cause the ‘save as’ dialog box to appear. That process will allow you to not provide the URL (which anyone can share), but provide the file (which people can share after they download).

Get WordPress username to customize url

You can only do that if the user is logged in (otherwise there is no “current” user). Depending on what your specific use case is, it would be something like this: if ( is_user_logged_in() ) { global $current_user; $current_user = wp_get_current_user(); // get the username: $username = $current_user->user_login; // set up the URL: $url = … Read more

Using a template file for a specific custom URL

I don’t know what nepal is (text prefix only or maybe taxonomy term), but it is not the most important thing, you will correct it if necessary. Rewrite rule like this should resolve the case. add_action( ‘init’, ‘se356109_events_custom_rule’ ); function se356109_events_custom_rule() { add_rewrite_rule( ‘nepal/events/(.+?)/([0-9\-]+)(:?/page/?([0-9]+))?/?$’, ‘index.php?events=$matches[1]&paged=$matches[3]’, ‘top’ ); } If you need to use URL date … Read more

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