A few lowercase words separated by dashes, describing a post and usually derived from the post title to create a user-friendly (that is readable and without confusing characters) permalink. Post slug substitutes the `%posttitle%` placeholder in a custom permalink structure. Post slug should not be ...

learn more… | top users | synonyms

0
votes
1answer
18 views

Automatically remove repeated words in slug

i am looking for a way to remove repeated words in wordpress slug. let say my domain is 'example.com' and i have a category named 'WordPress How To' i have configured the permalinks to be ...
3
votes
2answers
482 views

How to change ?lang=cn into /cn/

I'm trying to add languages to my wordpress driven website and i installed xili-languages plugin. Unfortunately it uses lang param to differentiate between languages and i rather have seen something ...
0
votes
1answer
464 views

How to get category slug link? ( include parent categories)

for example, if main category slug is cars; sub-category slug is: Ford; how to get the permalink of Ford, including its parent categories' slug? ( get_category_link() returns mysite.com/?cat=19 type ...
0
votes
0answers
13 views

How to control the the URL of a Custom Post Type to have multiple slugs?

I currently have a custom post type whose rewrite rule is this: 'rewrite' => array( 'slug' => 'tests', 'with_front'=> false ), So the URL is www.domain.com/tests/post-name ...
0
votes
1answer
27 views

Rewriting archive page slug to be different than custom post type slug

I am having trouble changing the slug of my archive page. The goal is to create a page that can be edited from the back end of WP with the slug 'speakers', but that has already been taken by the ...
0
votes
0answers
9 views

wp_rewrite page 404

wp_rewrite gives me an 404, don't know what i'm doing wrong. function ftc_flush_rewrites() { global $wp_rewrite; $wp_rewrite->flush_rules(); } function ftc_add_rewrites() { global $wp_rewrite; ...
1
vote
1answer
400 views

wp_insert_post - How do I prevent incremental numbers on child pages?

I'm using wp_insert_post to dynamically generate child pages for a given page using a predefined array of values. The goal is to give each child page the same slug. For example, clicking "Generate ...
0
votes
2answers
384 views

Get ID of child from child slug, while knowing parent ID

I have a hierarchy that I need to get data from. It's the child (by slug name) that I need to get while already having knowledge of the parents. Highest Known Parent Page (slug : 'parent') |_ Child 1 ...
1
vote
1answer
56 views

Get posts from specific taxonomy term

I have nhl news website and I have taxonomy for each season (ex 2014-15) Taxonomy in functions: function wptp_register_taxonomy() { register_taxonomy( 'season', 'post', array( ...
0
votes
1answer
421 views

Change custom post type slug from plugin options

I'd like to give users the option to change a custom post type slug in my plugin. Using this answer, I'm able to hardcode it into a function: Redeclare/Change Slug of a Plugin's Custom Post Type ...
1
vote
1answer
23 views

Get new Wordpress slug from old wordpress slug

I have implemented a shortcode called post which contains an attribute src which has link of an of page [post src="http://www.listenmoneymatters.com/the-betterment-experiment/"] Currently, this ...
0
votes
0answers
17 views

How do I add files into a new folder and keep wordpress page /slug/?

We needed a sub-site on our domain so it would look like domain.com/newsite Due to the instructions of a technician looking after the server, I made a new subsite under my wordpress site by the ...
1
vote
1answer
1k views

List child pages by slug not ID?

I am looking to use the wp_list_pages function to show children pages of a specific page ID. I was able to do this easily, but now I found an issue with it. I am running a Wordpress network of sites ...
0
votes
1answer
36 views

How to add current custom taxonomy slug to body class

My theme uses custom taxonomy called "kbsection" and there are lots of sections set up (instead of categories). There is also a custom post type and the posts are assigned to sections. I need to ...
1
vote
1answer
54 views

Change slug of registered custom post type in child theme

I successfully renamed a custom post type registered by my parent theme in my child theme using this method. The problem is, my permalinks haven't changed. So when I change portfolio to homepage and ...
1
vote
1answer
18 views

Wordpress not adding -2 to slugs when saving post as draft

I have a client that saves pretty much everything as draft before posting it on the website. Thing is, he has a 'Jobs' section, where the name of the job offers might repeat. If they are looking for ...
0
votes
1answer
49 views

Can't remove slug in url

I need remove slug movie from site.com/movie/mymoviename I've tried remove 'slug' => 'movie', 'with_front' => FALSE,), from code, but this don't help's me. Here a code <?php /* Movies post ...
0
votes
2answers
44 views

Custom walker with hashes instead of links (one-page layout)

I am currently developing a one-page based layout with WordPress where the actual content is split up into separate pages in the backend, which are all knit together to a one-page layout in my ...
0
votes
0answers
38 views

Have the same sub-category and slug for two different parent categories?

Just want to make sure: I have category 1, with subcategory 'resources'. Can I have category 2 also with a 'resources' subcategory? I would like the slug to be the same in both categories.
0
votes
1answer
45 views

hierarchical taxonomy in permalinks? using same slug

I use permalink: /%category%/%postname%.html and want to have categories like this: Wheels Mercedes Toyota Brakes Mercedes Toyota I want their URLs like this: ...
0
votes
1answer
99 views

How to Disable UNICODE slug?

I am inserting the post titles in UNICODE, but i dont want to save in unicode UTF8 characters. Instead, i want to use my title convert function before slug auto-creation: like this: function ...
1
vote
2answers
70 views

Removing the redirect after changing a page's slug

On one of my pages I changed the slug to form a different URL. E.g. Old: http://example.com/old-slug New: http://example.com/new-slug WordPress has done it's thing of redirecting ...
0
votes
0answers
6 views

Change “Team” slug on a template post type

thanks in advance. I have a great template that works well for our business. However, I don't want the team members page slug to be /team/[name] - instead, I want it to be /barristers/[barrister ...
0
votes
1answer
50 views

Change Slug of a Custom Post Type

I use a plugin that creates a custom post type with a slug that I am wanting to change. I don't want to overwrite the plugin files, so I'm wondering how I can change the slug using a separate ...
0
votes
2answers
30 views

generate unique slug while inserting post

How can i create unique slug while inserting a new post.. I know i can query posts and compare the records to create unique slug but I want to insert a post with unique slug at the same time. Lets ...
0
votes
0answers
7 views

web.com/post/post-title redirects to web.com/post-title

I'm having a complain of the SEO guy because a post url is not like this web.com/post/post-title But like this web.com/post-title And even web.com/post/post-title redirects to web.com/post-title ...
0
votes
3answers
466 views

How to customize this automatic slug shortener with an overrwrite function

I am using a slick little piece of code which I have included within my functions file which automatically takes any information entered into the title of a new post and create a slug with specific ...
0
votes
0answers
20 views

Weird slug in archives permalink

All my wordpress installs (and some others, as I see) have the archive based index in the following format http://example.com/date/2015/06/02. But most current installs out there display it as just ...
-1
votes
1answer
47 views

Post as frontpage - avoid duplicate content

On one of my WP sites I display a single post on the homepage. It's hard coded in the index.php like: If is home then show post with ID X But now I have the post's content on the homepage but ...
0
votes
3answers
741 views

Remove Slug from Custom Post Type

I was wondering how i can remove the prefix from the slugs of custom post types using htaccess rules or any other appropriate method. Currently my custom post types look like this: ...
0
votes
0answers
28 views

Multiple slugs for a Custom Post Type

A custom post type can be registered with one slug (e.g. products) register_post_type('products', $args); How can I add multiple slugs to the same Custom Post Type? ...
11
votes
6answers
45k views

How to retrieve the slug of current page?

I am trying to retrieve the slug of the current wordpress page outside the loop. The title of the page returns with wp_title () but how can I get the slug? <li><a ...
0
votes
0answers
23 views

404 suggests posts instead of showing custom 404 when the url is not home

I have a custom 404 witch works well when you write the url like www.site.com/randomCrapAbC but when there is post-type or category in the slug, wordpress tries to suggest post in that category ...
0
votes
1answer
24 views

Generate slug and meta data if meta field is empty

I am creating a current vacancies feature in a client site, and am struggling on one area. I want to have a slug generated from a reference number, rather than the post title. This, I have set up. ...
0
votes
3answers
92 views

php string inside shortcode does not work

I want to automatically get products from woocommerce for a chosen brand, inside a brand's listing on a other part of the site using Sabai Directory. this <?php ...
3
votes
3answers
2k views

Must slugs be unique?

Is it true that slugs must always be unique, regardless of the rest of the url, or if it's used by different post-types or taxonomies? For example, is it possible to have both of these urls? ...
0
votes
0answers
43 views

Get full control over custom post type url

The situation I have a custom post type, lets call it 'CP', which has two parent categories named 'companies' and 'category'. Posts of type CP can only have one company and multiple categories. So, ...
0
votes
0answers
27 views

Removing base slug from hierarchical custom post type on a WordPress Multi-site

So, I’ve been trying to remove the base slug from a hierarchical custom post type on a multi-site build for the past week or so, and haven’t found anything that actually works yet. The post type is ...
3
votes
2answers
3k views

Remove parent slug for child pages

I'm looking for a plugin/custom function that removes the parent slug of a child's page permalink. Something that automatically changes the permalink for child pages. Example: ...
3
votes
1answer
121 views

Rewrite rule page url with category

I have enabled the category box for pages with this: // Add to the admin_init hook of your theme functions.php file add_action( 'admin_init', 'page_categories' ); function page_categories() { // ...
2
votes
1answer
532 views

Getting author page slug from get_users() or get_userdata() functions

wp_list_authors() gives a list of author pages permalinks (site.com/author/john, site.com/author/jenny, etc). I want the same links using get_users() or get_userdata() functions instead. I need these ...
4
votes
1answer
96 views

Handle category name URL rewrite before different post type slugs

I went over a hundred similar topics here which were close to what I need, but unfortunately I wasn't able to fine tune this so apologies if it's a duplicate. I have a several post types (such as ...
0
votes
0answers
85 views

Remove Custom Post Type slug from url, two CPT

I have 2 custom post types hilp-a and hilp-b. I want to remove custom post type slug from the url. e.g: test.com/hilp-a/test to be test.com/test and test.com/hilp-b/btest to be test.com/btest I ...
0
votes
1answer
53 views

Why does post-slug not get saved for drafts?

I am trying to get the value of the 'new-post-slug' (the bit that you can edit to customize your slug for a post, but bizarrely doesn't have a 'name' attribute as you'd expect a form field to have ... ...
0
votes
0answers
11 views

Virtual parent in hierarchy for certain categories

I have a website where some posts go into the 'News' category and all the others are dispersed throughout other categories. There's a 'Blog' page set up under Settings>Reading which uses a customised ...
1
vote
2answers
142 views

Exclude category by slug for for each loop

I am trying to exclude some categories from a for-loop. <?php $categories = get_categories(array('exclude' => 'apps, windows')); ?> <?php foreach ($categories as $category) : ?> ...
1
vote
0answers
43 views

wp_update_post adding a -2 to the post slug

I've recently created a php file that is creating posts using the wp_insert_post function. This is working great and its inserting the post as it should do. I am leaving out the post title as I want ...
2
votes
3answers
2k views

Using custom/dynamic “slug” for a page

I have a custom page which uses a template called "Stores" http://example.com/stores/. This page will have a list of states and/or companies as categories. For this system I have a custom post type ...
1
vote
1answer
43 views

Get posts with at least one category in common with current post?

In single.php : I want to get all posts with at least one category in common with the current post. I tried reading through the wordpress codex documentation but I found it rather confusing (I'm ...
1
vote
1answer
34 views

Change post slug but keep old one

I have thousands of posts on my site which are created automatically. Some of them have duplicated titles. I'd like to add some keywords to their slugs, so URLs like domain.com/post-title/ ...