Duplicate Slugs on multilingual site (with Polylang)

Go on your back-office, and go on Polylang (Languages) Settings. Then, on URL modifications, check if the option “The language is set from the directory name in pretty permalinks” is checked. If not, check it. Then click on Save changes. Now, you should see this option below : “Share slugs Activated” “Allows to share the … Read more

Ultimate get current page’s slug function

There’s no such thing as a single permalink document name. It varies depending on what is being queried. Taxonomy terms use the slug of the term, pages and posts uses the slug of the posts. Post type archives sometimes use the post type name, but they might use something else entirely depending on how it’s … Read more

How to put title slug into content when create a new post?

You have to use the_content filter. Following example is to just adds a featured image set from the single post Edit screen which displays before the content on single posts only. You can change it to display title and permalink. add_filter( ‘the_content’, ‘featured_image_before_content’ ); function featured_image_before_content( $content ) { if ( is_singular(‘post’) && has_post_thumbnail()) { … Read more

can’t change page slug

My first guess would have been that the page was in the Trash, but you’ve said in the OP that it isn’t. So… If you have access to your MySQL database, run this query: SELECT * FROM wp_posts WHERE post_name=”page-title” That will return the post that’s using the slug.

list child pages as slug

Ok, this code should set you on the right path. It’s not designed to do exactly what you want, but judging by your code above, you seem fairly compitent, so should be able to amend as required. I’d also recommend looking at the Walker_Page Class, that way you can compare the methods below to those … Read more