Prepend meta_value to permalink of post

In this case it seems like you’ll want to hook into the WordPress rewrite rules. {$permastruct}_rewrite_rules doesn’t have a lot of information, but this filter would allow you modify the array of existing rewrite rules to add in your new rewrite rule for series. For this to work: http://example.com/series/movie_slug/parrent_series_slug/series_slug You’ll need to add in movie_slug, … Read more

Rewrite category slug

It can be done by writing a code on post_link filter. This filter allows you to change the final post link. Since you are showing categories in your permalink, so I am assuming that your permalink structure contains %category% in it. Below code will help you to get links the way you want. add_filter( ‘post_link’, … Read more

Replace WordPress %postname% suffix with %postid%?

I suppose you could filter wp_unique_post_slug and have it return the original slug for posts, but I’m not sure what kind of side-effects this may have: add_filter( ‘wp_unique_post_slug’, function( $slug, $post_id, $post_status, $post_type, $post_parent, $original_slug ) { if ( $post_type == ‘post’ ) $slug = $original_slug; return $slug; }, 10, 6 ); And here’s how … Read more

Slugs as breadcrumbs for Pages

Ok, problem solved. I´ll add the script below. Hope it´s useful for someone. if ( is_page() ) { $post = $wp_query->get_queried_object(); if ( $post->post_parent == 0 ){ echo “<li> &raquo; “.ucwords(str_replace(“-“, ” “, $post->post_name)).”</li>”; } else { $title = the_title(”,”, FALSE); $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); array_push($ancestors, $post->ID); foreach ( $ancestors as $ancestor … Read more

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