Can’t add a Page with Name 2011

This has to do with how paging-within-a-page works. See ticket #5305. There’s a plugin that will allow you to have numeric slugs if you’re willing to sacrifice paging: http://wordpress.org/extend/plugins/allow-numeric-stubs/

How to use author id in post permalink

You can do this with a couple of filters: <?php function wpse_112719_pre_post_link( $permalink, $post, $leavename ) { if ( strpos( $permalink, ‘%author%’ ) !== false ) { $authordata = get_userdata( $post->post_author ); $author_id = $authordata->ID; $permalink = str_replace( ‘%author%’, $author_id, $permalink ); } return $permalink; } add_filter( ‘pre_post_link’, ‘wpse_112719_pre_post_link’, 10, 3 ); function wpse_112730_add_rewrite_rules() { … Read more

Remove subfolders from URL

You need to make the WP site url and home url differ in Settings / General. The home url should be example.com, while the site url (where WP lives) should be example.com/wp (or wherever you put it). You can hardcode these in your config file: define(‘WP_HOME’, ‘http://example.com’); define(‘WP_SITEURL’, ‘http://example.com/wp’); WP should know how to take … Read more

Filtering comment permalinks when a condition is met

I’m not completely sure what you are trying to accomplish, but here’s what I think. Normally you would generate a link to a comment like this: echo ‘<a href=”‘ . get_permalink($comment->comment_post_ID) . ‘#comment-‘ . (strval($comment->comment_ID)) . ‘”>’; The problem with filtering get_permalink() is that the filter must know that it is called by the comments … Read more

How can I add dynamic page url in WordPress?

for this you will need to be familiar with rewrite URLs. This results can be achieved by rewrite URL. Here news will be page and postid and action will be query strings internally. Here you can find some tutorials of rewrite URLs in WordPress. For an example http://example.com/news/?edit=100 is the URL lets make prety. /** … Read more

How to map permalinks with accented letters to sanitized slugs?

The best way to accomplish this is remove the default sanitize_title filter and replace it with yours, which will encode those characters properly. Here is an implementation of using accents in permalinks. Example: remove_filter( ‘sanitize_title’, ‘sanitize_title_with_dashes’); add_filter( ‘sanitize_title’, ‘restore_raw_title’, 9, 3 ); function sweURLtoCHAR($text) { $url=array( “%C3%81″,”%C3%A1”, “%C3%8D”,”%C3%AD” ); $char=array( “Á”,”á”, “Í”,”í” ); $str = … Read more

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