Rewrite rules applied differently after upgrade

I recognize that rule. It’s the unusual rule I wrote to deal with the permalink uncertainty issue. 🙂 First, you’ll only get that weird rule if you have your custom permalinks set to start with a non-numeric value. Like, if you have your custom permalink string as just %postname% instead of something like %year%/%postname%. Next, … Read more

Custom post rewrite rule not working

The undesirable answer I alluded to in my question is to intercept WordPress’ routing and URL generation. Manipulate the URLs with: add_filter(‘post_type_link’, ‘my_post_link’, 10, 3); function my_post_link($permalink, $post, $leavename) { if ($post->post_type == ‘publication’) { $year = date(‘Y’, strtotime($post->post_date)); return site_url(“/publications/$year/$post->post_name”); } return $permalink; } Then intercept the routing: add_action(‘template_redirect’, ‘my_template_redirect’); function my_template_redirect() { if … Read more

Custom url structure – pages under a custom post type

example.com/event/london-2012/speakers/john-doe You need an “event” post type and a “speaker post type. The event post type should be hierarchical and should have a sub-page called “speakers” which should use a custom template that displays all the “speaker” post types assigned to that event (see the Posts 2 Posts plugin). Then you can create other sub-pages … Read more

WordPress Rewrite Rule

As the question was modified, I modify my answer. This task is relatively easy, doable just with a single rewrite rule, which converts everything after /mypage/ string into a variable – I call it var. As this is added to query_vars via hook, is reachable via global $wp_query; echo $wp_query->var;. add_filter( ‘query_vars’, ‘binda_query_vars’ ); function … Read more

Why is a rewrite rule in wordpress prevent pagination?

I changed: add_rewrite_rule(‘^brand-list/([^/]*)/([^/]*)/page/([0-9]+)?’,’index.php?pagename=brand-list&brand=$matches[1]&section=$matches[2]&paged=$matches[3]’,’top’); to: add_rewrite_rule(‘^brand-list/([^/]*)/([^/]*)/page/?([0-9]{1,})/?$’,’index.php?pagename=brand-list&brand=$matches[1]&section=$matches[2]&paged=$matches[3]’,’top’); Note the difference is /page/([0-9]+)? is now /page/?([0-9]{1,})/?$ seems to be working now.

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