Mapping Domains to Permalinks (not multisite)

If you set domain.com as an alias of original.com, in WordPress you have to do nothing to make it works. The problem is the countrary: once in DNS the 2 domains are aliases, every url of your WordPress will be accessible via user defined domains: domain.com/any/wp/url, but also domain2.com/any/wp/url, domain3.com/any/wp/url and so on… So, what … Read more

How can I reverse engineer a Permalink to Find the Page?

Addressing both your original question and the question implied by your comment … Finding the page ID Every post and page within WordPress is given an ID. By default, WordPress uses the ID in the link structure: http://www.example.com/?page=ID or http://www.example.com/?p=ID (for posts). You can change this to a more user-friendly structure called “pretty permalinks” that … Read more

How can I make Capital letter ( upper-case ) permalinks?

The page URLs are defined by the slugs, and by default they are formatted and lower-cased by the function sanitize_title_with_dashes(). However, this function is called via a filter, and you can unhook the filter so it doesn’t get called: remove_filter( ‘sanitize_title’, ‘sanitize_title_with_dashes’ ); Just doing this is probably not a good idea, as it will … Read more

Custom post type permalink endpoint

A couple things. First, your function names need to be prefixed with something unique. WordPress is a big ecosystem, and someone else has probably used all the generic function names you can think of. Second, add_rewrite_endpoint takes care of adding query variables for you. So you don’t need this: add_filter( ‘query_vars’, ‘add_query_vars’); function add_query_vars($vars){ $vars[] … Read more

Hide permalink and preview button and link on custom post

You can accomplish the above using hooks. Use the code below in your active theme’s functions.php file to get this work delete permalink under wordpress post title add_filter( ‘get_sample_permalink_html’, ‘wpse_125800_sample_permalink’ ); function wpse_125800_sample_permalink( $return ) { $return = ”; return $return; } Customizing post link from original wordpress add_filter( ‘page_row_actions’, ‘wpse_125800_row_actions’, 10, 2 ); add_filter( … Read more

Change author permalink

you need 3 simple functions and hooks first change the author base: //change author/username base to users/userID function change_author_permalinks() { global $wp_rewrite; // Change the value of the author permalink base to whatever you want here $wp_rewrite->author_base=”users”; $wp_rewrite->flush_rules(); } add_action(‘init’,’change_author_permalinks’); then add users to query_vars: add_filter(‘query_vars’, ‘users_query_vars’); function users_query_vars($vars) { // add lid to the … Read more

What is the best permalink structure for SEO?

@nevster, The best permalink structure for seo is /%category%/%postname%/ This permalink structure gives you the most keywords loaded into the URL of your post. Since the category that you’ve placed your post under usually relates to the post title, you will have an extra SEO benefit if other websites use that permalink structure to link … Read more

How to get pretty URLs with add_query_arg in permalinks

Just faced the same situation and stumbled upon this question while googling. It seems like this isn’t possible. Core itself just appends strings to the URL if pretty permalinks are enabled, see https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/link-template.php#L571 For anyone interested in this: You can do something like this in your code: if ( ” != get_option(‘permalink_structure’) ) { // … Read more

Rewrite Rule for Multilingual Website, Like qTranslate?

I got it now , After searched many resources : function lang_support() { return array(‘en’,’fr’); // Add your support lang-code (1st place is a default) } function rewrite_lang(){ $langs = lang_support(); foreach($langs as $lang) { add_rewrite_endpoint($lang,EP_PERMALINK|EP_PAGES|EP_ROOT|EP_CATEGORIES); } } add_action(‘init’,’rewrite_lang’); function lang(){ global $wp_query; $langs = lang_support(); $lang_r = “”; foreach($langs as $lang) { if(isset($wp_query->query_vars[$lang])) { … Read more

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