Rachel Carden
  • Member for 9 years, 10 months
  • Last seen more than 5 years ago
add_rewrite_rule - working fine but broken for pagination
Accepted answer
18 votes

Have you tried: The main one: add_rewrite_rule( 'region/([^/]+)/type/([^/]+)/?', 'index.php?taxonomy=region&term=$matches[1]&post_type=$matches[2]', 'top' ); For pagination ...

View answer
Nested custom post types with permalinks
Accepted answer
14 votes

If you want to keep 'authors' as the base slug in the permalinks, i.e. example.com/authors/stephen-king/ for the 'authors' CPT, example.com/authors/stephen-king/the-shining/ for the 'books' CPT and ...

View answer
Custom Post Type Slug / Page Slug Conflict - Prevent use of reserved slug on page save?
13 votes

The following 2 filters allow you to hook into when WordPress checks the slug and are found in the function wp_unique_post_slug() in the wp-includes/post.php file. There are 2 filters, one for ...

View answer
rewrite rules and querystring
12 votes

You can add your own rewrite rule which will let you tweak the query via URL parameters: add_action( 'init', 'rewrite_photo_url' ); function rewrite_photo_url() { add_rewrite_rule( 'photos/([^/]+)...

View answer
Is slug "type" reserved and can't be used in taxonomy rewrite?
4 votes

It's not working because "type" is reserved for post format archive pages, i.e. http://example.com/type/video.

View answer
URL rewrite and navigation structure for wordpress custom post type
Accepted answer
3 votes

In order to rewrite a custom post type's URL, or permalink, you'll need to filter the 'post_type_link', which is run whenever get_permalink() is called, allowing you to change a post's permalink. I've ...

View answer
Add Post Screen Keep Category structure
3 votes

The 'wp_terms_checklist_args' filter might not have been around back in August 2012 but now there's a much easier way of making sure checked terms stay put. This filter is called right inside the ...

View answer
Make a custom column sortable, by custom post count
Accepted answer
2 votes

Users are queried differently than posts so you have to hook into the 'pre_user_query' action to filter user queries. Let me know if this works: add_action( 'pre_user_query', 'my_pre_user_query', 1 );...

View answer
Custom Permalink with Dynamic Taxonomy for Custom Post Type - Works, but breaks other permalinks
2 votes

If you're running WordPress 3.0.1 or later, I believe your problem lies with the 'post_type_link' filter declaration and function arguments. When the 'post_type_link' filter is applied, it passes the ...

View answer
get_terms problem : related articles
1 votes

get_post_taxonomies( $post->ID ) allows you to dynamically retrieve the names of the taxonomies attached to a post. So you could retrieve ALL of the terms that belong to the current post's ...

View answer
How do I list custom taxonomy terms without the links?
1 votes

If you just want the terms assigned to a specific post: <?php $object_terms = wp_get_object_terms( $post_id, 'skills', array( 'fields' => 'names' ) ); if ( $object_terms ) { ?><ul><...

View answer
Get_the_term_list inexplicably adds values in foreach
Accepted answer
1 votes

The problem lies with the get_the_term_list() function, which is defined with the following arguments: get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' ) You're defining ...

View answer