Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?

To cut a long story short the answer to the question is Yes. In the end I was able to create: tax-1/tax-2/cpt-1/cpt-1-post/cpt-2/cpt-2-post/ and another structure: tax-1/tax-2/cpt-1/cpt-1-post/cpt-2/custom-field/cpt-2-post/ I used Types from http://wp-types.com/ to create the hierarchical custom taxonomy, the custom post types, custom fields, but most importantly the parent/child relationship between custom post types. That plugin … Read more

Strip hashtag off permalink with php

echo get_permalink($post);, or the_permalink() in the Loop context, will give you the canonical URL for the post, without the trailing hashtag part– technically the ‘fragment’. You could also use PHP’s parse_url to break the URL apart if *_permalink functions don’t work for you for some reason, or even PHP’s strpos and substr for a really … Read more

Pagination breaks on child-categories, works fine on parent-category

I was finally able to get this working! Here’s how: What I had misunderstood (being a WP noob and all…) is that get_query_var(‘page’) is for pages, and get_query_var(‘paged’) is for posts. http://codex.wordpress.org/Function_Reference/get_query_varfor So I replaced these two lines $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; // FOR PAGINATION ‘page’ => $paged, // FOR PAGINATION with … Read more

Making posts permalinks consistent numbers

I don’t really have the time or will to write and debug the code to make this work, but I can point you down a path to how you might make this work. A word of warning: it’s certainly not simple. You have to save the current number somewhere so you can retrieve and increment … Read more

Long permalinks get split with multidots and get broken

Turn off all plugins, switch to TwentyTen or – even better – this theme. Then add another post with an ridiculously long title Lopado­temacho­selacho­galeo­kranio­leipsano­drim­hypo­trimmato­silphio­parao­melito­katakechy­meno­kichl­epi­kossypho­phatto­perister­alektryon­opte­kephallio­kigklo­peleio­lagoio­siraio­baphe­tragano­pterygon Source: Wikipedia Then see if it works now. If it doesn’t: Re-install WP from the Admin > Dashboard/Updates page. If it does work, activate one plugin and retry, then the next … Read more

placing the media uploads in a subdirectory

Add the following to your theme’s functions.php file, making sure you replace the example CDN URL with your own: function my_cdn_upload_url() { return ‘http://mk124.yourcdn.com/yoursite/wp-content/uploads’; } add_filter( ‘pre_option_upload_url_path’, ‘my_cdn_upload_url’ );