Create a permalink to a pdf?

You can accomplish the first part using the Quick Page/Post Redirect Plugin. Just set the Request URL to /resume and the Destination URL to /wp-content/uploads/2021/07/Resume-v4.pdf For the second part of your question, you can add a redirect rule to your .htaccess file: Redirect /wp-content/uploads/2021/07/Resume-old.pdf /resume The way you worded your question you actually would set … Read more

help with custom rewrite rules

The part that modifies the blog post URLs/permalinks is in the mandoe_update_post_link() function (which is hooked on post_link), and the part that you need to adjust is this: return home_url( ‘/blog/’ . $post->post_name ); Just change the ‘/blog/’ . $post->post_name to ‘/blog/’ . $post->post_name . “https://wordpress.stackexchange.com/” and the URLs would end with a slash. However, … Read more

Custom Post Type posts, conflict with posts after add_rewrite_rule to top

I think I solved my problem. So if you have your WordPress post permalink set to %category%/%postname%/, and you want this for custom post type and taxonomy, you could prepare your rewrite links for all generated taxonomy terms (cat-a, cat-b etc.). Code: add_filter( ‘rewrite_rules_array’, function($rules) { $categories = get_terms([‘taxonomy’ => ‘success-category’ ]); foreach ($categories as … Read more

Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?

By default, WordPress disallow 2 identical slugs because if you change your permalink structure for custom structure, you should be able to have in your case: https://example.com/saint-louis/ https://example.com/saint-louis/ And you can understand, it’s impossible. The only way is checking by code, you are not in “custom structure” and then save in db with the WordPress … Read more

Get wordpress installation folder

You don’t need to do this. As long as your site URL in Settings is set to mydomain.tld/wordpress you don’t need to include /wordpress in your rewrite rules. If you look at the rewrite_rules option in the wp_options table you’ll see that none of the default rules are using it, because it’s not required.

HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?

Parameter in add_permastruct() The third parameter of add_permastruct() is for the is_front parameter. This is a basename, which you can add to the default permalink structure of all your posts in the WordPress admin. For example, if you have set the permalink structure to /blog/%postname% the word blog will be prepended to your rule. In … Read more

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