Tricky URL rewrite with custom values in url

As I mentioned in your other question, you don’t want to be touching the .htaccess file, you need an internal rewrite. So, given the URL: http://mysite.com/image/wp_username/3digitnumber we need to add the following rule to handle it: // set up the rewrite rule function wpa73374_setup_rewrites(){ add_rewrite_rule( ‘image/([^/]+)/([0-9]+)/?$’, ‘index.php?pagename=custompage&iuser=$matches[1]&iname=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘wpa73374_setup_rewrites’ ); Note … Read more

Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?

You can use add_rewrite_rule hooked to the init action, instead of using the generate_rewrite_rules filter (where it gets a bit low-level). But the actual problem with your rewrite rules is the regex in place. Here’s what it’d look like: function wtnerd_edition_specific_categories() { add_rewrite_rule( ‘(.+?)/channel/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$’, ‘index.php?category_name=$matches[1]&channel=$matches[2]&feed=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘(.+?)/channel/(.+?)/(feed|rdf|rss|rss2|atom)/?$’, ‘index.php?category_name=$matches[1]&channel=$matches[2]&feed=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘(.+?)/channel/(.+?)/page/?([0-9]{1,})/?$’, ‘index.php?category_name=$matches[1]&channel=$matches[2]&paged=$matches[3]’, … Read more

Stop unwanted WP redirection to new url

WordPress uses a function called wp_old_slug_redirect() to find out if you’re looking for a post whose slug was recently changed and redirect you to its new home. If you want to prevent this behaviour for this specific post, delete the _wp_old_slug post meta entry from the database for that post. If you want to prevent … Read more

In Settings>>General I am missing some fields

You are in the wrong settings page. Your site is a multi-site setup; the URL is set in the site manager, not in individual sites. Go to Network Admin/Sites in the My Sites menu: Select a site to edit: Change the URL: Update You need a subdomain setup to get editable URLs. See Create A … Read more

Generate one time URL

Is it possible that the problem is in the .htaccess file? Almost certainly. Double check that you’ve updated the correct .htaccess file – and that your host supports using .htaccess files! See this question for more details.

How to increase the character limit for post name of 200?

It happens because when you save a post, WordPress calls sanitize_title function to sanitize your title. This function applies sanitize_title filter. One of core hooks for sanitize_title filter is sanitize_title_with_dashes function, which checks title on utf8 format by calling seems_utf8 function and if the title has utf8 format, the function call utf8_uri_encode function. utf8_uri_encode function … Read more

wordpress – load a template based on the URI

I assume that your custom post type windows would map onto /windows/ etc? You can customise the template for individual custom post types via single-posttype.php in your theme, e.g. single-windows.php single-doors.php and single-garages.php WordPress will automatically pick these up You could also use custom page templates, e.g. page-windows.php or custom templates with the right template … Read more

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