How to prevent apostrophes and quotes from appearing in permalinks?

In WordPress, “—” and ” — ” become em-dashes (— —) and “–” becomes an en-dash (— #8212;). The sanitize_title_with_dashes() function doesn’t catch these. That function uses the databased copy, but the title displayed to the user always goes through a texturize function. So if we replace en/em dashes on their way into the database, … Read more

Custom Taxonomy in Permalink of Post

Assuming your custom taxonomy is called artist (and you don’t override the slug in the rewrite parameter) you can use the rewrite tag %artist%. WordPress implements almost every functionality to use those rewrite tags in post permalinks. There are only a few small adaptations necessary. Building the Permalink First, you’ll need to use the post_link … Read more

My permalinks are broken! Can I use mod_rewrite to ignore a physical file?

The reason that’s happening at all is because of content negotiation. /2011.html wouldn’t normally be accessible through /2011/, but content negotiation is making Apache automatically look for files named 2011 (whatever the extension) when it can’t find the folder before it passes control to WordPress. This can be quite useful, but if you don’t particularly … Read more

Page begins with number, WordPress adds 2

Within the wp_unique_post_slug function, checks are made to “Prevent new post slugs that could result in URLs that conflict with date archives.” Here’s the relevant code from line 3812 from wp-includes/post.php // Prevent new post slugs that could result in URLs that conflict with date archives. $post = get_post( $post_ID ); $conflicts_with_date_archive = false; if … Read more

What is the difference between get_permalink vs get_the_permalink?

Nothing. get_permalink() is the original function, and is used to get the permalink URL for a post. get_the_permalink() was introduced in 3.9 simply so the permalink function was consistent with the other post-related template tags, such as get_the_title(), get_the_content(), which are all prefixed with get_the_. The equivalent functions for echoing the result of those functions … Read more

Remove index.php in permalink structure on IIS server

According to the documentation here: http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress I assume you have already selected Post Name in your permalink structure: Then include this code in web.config <rewrite> <rules> <rule name=”Main Rule” stopProcessing=”true”> <match url=”.*” /> <conditions logicalGrouping=”MatchAll”> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” /> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> </conditions> <action type=”Rewrite” url=”index.php” /> </rule> </rules> </rewrite>

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