Questions tagged [slug]
A slug is a few lowercase words separated by dashes, describing a post and is usually derived from the post title to create a user-friendly (that is readable and without confusing characters) permalink. The post slug substitutes the `%posttitle%` placeholder in a custom permalink structure. A post slug should not be changed and is especially useful if the post title tends to be long or changes frequently.
762 questions
0 votes
1 answer
60 views
Custom plugin with dynamic child pages listing database records
I am a bit new to coding in WP (and php) - more of a C# developer. This question is directly related to this one, since I am implementing an analogous scenario, using the base of the example. My real ...
1 vote
0 answers
30 views
How to Programmatically Replace Characters in WooCommerce Product Slugs?
I'm trying to adjust the URL structure of my WooCommerce product slugs by replacing specific characters programmatically. Here's my current situation: Product Title: Desk Flag 15x22,5 Cm Current slug ...
0 votes
0 answers
31 views
Can't Remove Unnecessary Slug
I am using a theme which utilizes different post types such as regular "posts", "videos" and "tv series". I can add a post at "posts" tab, I can add a video(...
0 votes
1 answer
241 views
Changing the URL slug causes redirecting to homepage, or showing 404 or missing lang_code issue
A half cooked WordPress website, using (a) Custom Permalink plugin (b) Poly_lang plugin (c) WP Rocket Pro plugin (no CDN) was assigned to us. We noticed that Slugs of many pages were different in ...
0 votes
1 answer
68 views
Get Page URl when changing slug and permalink
Need to get page URL programmatically as client changes the slug and permalink from time to time. I tried below using permalink but this cannot be used because of the above mentioned issue, $baseUrl = ...
0 votes
2 answers
110 views
category id (term_id) in url instead of slug
For a certain Wordpress shop with woocommerce we need the url to display the category id (term_id) instead of the normal slug with the category name. So instead of www.website.com/categoryname/ it ...
1 vote
0 answers
52 views
How can I add codes to functions.php in WordPress to allow parentheses in slugs, similar to Wikipedia?
Since my website has a lot of pages with similar slugs, I need to add some code to the WordPress functions.php file to enable parentheses in slugs, for example: example.com/article/slug_(explanation). ...
1 vote
0 answers
85 views
WordPress pagination error when using ACF CPT rewrite slug & Polylang CPT slug translation
I use WordPress with Polylang PRO and ACF PRO plugins. Using ACF PRO I've created CPT with post_type 'aktualnosc', with rewrite slug 'aktualnosci' (same slug as page name (with posts list)). I also ...
0 votes
1 answer
210 views
WP appending -2 to the end of my slug
I would like to create a page on wordpress with this URL: https://my-website.org/landing-page/ However, it seems that the slug /landing-page/ has already been created in the past because it does not ...
0 votes
0 answers
31 views
Creating Wordpress pages with post name as slug
I have an issue on a domain with a freshly installed Wordpress. I try to change my permalink structure to be Post Name so that when I create a page with the name "Test" I should be able to ...
0 votes
0 answers
53 views
Custom post type URl Cutomization
I am creating a custom CPT where I have customized CPT URL structure of CPT, I am using the rewrite rule for this but it is conflicting This is a Lessons CPT, and I want to remove lessons from the URL ...
0 votes
2 answers
157 views
Right Permalink for Custom Post Type with number slug
I am working on a little Plugin (based on a Custom Post Type called gallery) for a gallery (that reads out a large number of ftp folders). The post type does not have taxonomies but like pages just ...
0 votes
2 answers
175 views
How to get a custom taxonomy slug in body classes
I've been trying without luck to get a custom taxonomy slug to appear as a class in the body tag of WordPress. Perhaps it has to do with the fact that I'm using a custom taxonomy rather than the build ...
0 votes
1 answer
480 views
Custom post type slug localization
I need to have 2 languages in a website (EN and LT). I have a custom post type 'services'. I need to have the links like this: English version of the service: '/en/services/some-service' Lithuanian (...
0 votes
1 answer
150 views
Show category name in category.php when posts assigned to multiple categories
I'm trying to show the category name in my category.php but it's not working when I have posts assigned to multiple categories as it chooses the first category. <h1><?php $cat = ...