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
2answers
3k views

Using a portfolio_category slug in wordpress URL

I won't lie - I don't know php but I enjoy digging around trying to find ways to customize themes so that they behave how I want them to. Any help would be very much appreciated. What I am trying to ...
2
votes
3answers
888 views

How to prevent duplicate slugs for wp_insert_post?

I have a function that creates a page when I create a post (so as to construct parent-child relationship trees). I'm using the $title of the post to create the page and this also creates a duplicate ...
1
vote
1answer
718 views

Make wp_list_pages print slugs instead of titles

By default wp_list_pages spits out an unordered list of post titles. To save space in a sidebar menu I´m trying to create a list of page slugs instead of page titles. I suppose I´ll need to write a ...
0
votes
1answer
336 views

wp_insert_post generated mixed permalinks

I'm writing a plugin which uses wp_insert_post() to insert posts programatically and my permalink setting is /%category%/%postname%/ Of all the post inserted, wp_posts.guid shows 2 types of output. ...
1
vote
2answers
681 views

How to get full slug, including all parent pages

I am trying for hours and I managed to get full slug for parent of sub-page when I am on 3rd level sub-page I can not get slug of the top parent page. Example domain.com/top_page/sub_page/sub_sub_page ...
1
vote
1answer
477 views

Non latin post slug truncate

I created a custom post type and set its permalink structure to 'category/postname'. I found that sometimes, when i create a post in a non latin characters, the post slug is getting cut. I googled ...
3
votes
3answers
816 views

How to control which category will be picked for the slug of a post?

I'm using the permalink structure "/%category%/%postname%/". What bothers me is that I have posts that belong to two categories. And of course, unfortunately, Wordpress always picks the wrong one for ...
1
vote
1answer
197 views

How to create a custom CSS class for a specific page template?

I created a page in called "mypage". Then I created a custom template page called "page_mypage.php". Now, I just wanted to create some custom CSS classes in style.css. I tried with: ...
5
votes
3answers
1k views

Regenerate slugs from title of posts

is it possible to regenerate the slugs programmatically after changing the titles of the post? The girl that updated the title of more than 200 posts just "forgot" to update the slug too, so i was ...
1
vote
3answers
462 views

Easiest way to simulate WordPress's URL resolution to retrieve post ID, etc?

I'm curious if it is possible, in a plugin/custom code, to take an URL that has been generated by the currently running WordPress site & parse it to retrieve the $blog_id and $post_id? ie. taking ...
1
vote
2answers
1k views

Custom Permalink with Dynamic Taxonomy for Custom Post Type - Works, but breaks other permalinks

My custom permalink with dynamic taxonomy is working for my custom post type. However, it breaks all my other permalinks. They display a 404 error in the content area (header and sidebar still ...
0
votes
1answer
707 views

I use same slug name for category and page

I added one slug and page with the same name and they worked fine, but when creating a second WP forced me to rename the page (being created after the category) with an additional "-2" how to clear ...
1
vote
2answers
4k views

When I change slug, will WordPress create redirect from the old URL?

When I change a slug from post-a to post-b, will WordPress create a redirect from /post-a to /post-b, like HTTP 301 or something similar? If not, is there a plugin for that?
0
votes
2answers
1k views

Automaticly add slug to posts

I'm using a us/news/%postname%/ structure for my permalinks. This works great for regular posts. However, I have a few different custom post types, and I don't want the us/news part in their slug. ...
2
votes
1answer
340 views

Set default (auto) slug prefix for Tags

Is it possible to add default prefix to the slug of each newly added Tag. So that full slug, would be stored in database (no rewrites). For example: Name: Tag1 -> Slug: prefix-tag1 Name: Tag2 -> ...
4
votes
3answers
25k 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 ...
8
votes
1answer
4k views

Redeclare/Change Slug of a Plugin's Custom Post Type

Is it possible to redeclare/change the slug of a plugin's existing custom post type (without simply editing the plugin)? That is, if Plugin X creates a custom post type with the slug /uncookedtoast/, ...
1
vote
2answers
75 views

Define a name to the posts slug

I would like to use the url http://site.com/post/title-of-the-post for my posts and I've saw in my admin page I have the current url http://site.com/%slug%/title-of-the-post obiouvsly incorrect. How ...
5
votes
3answers
388 views

Prevent Wordpress from abbreviating-long-slugs…-in-the-admin

On post edit pages, when a slug exceeds a certain number of characters, Wordpress abridges it with an ellipsis (...). For example, if my slug is i-want-to-be-able-to-see-this-slug, it appears on the ...
0
votes
1answer
4k views

custom htaccess rewrite rule for page

i have a page in wordpress called "video". its page id is 6, and its slug is "video" in my theme ive set it up to show content based on GET variables here is the URL rewrite im trying to set up: ...
0
votes
1answer
184 views

Is this the correct way to add post-slug input field?

I added slug input field in my custom post type and allow users to edit it at front end. Then, when insert post, I use this: $wp_insert_post_args = array( 'post_status' => 'publish', ...
1
vote
1answer
310 views

filtering special chars from post slug

Is there a way to prevent WordPress from including special characters like – (long dash), ", ', etc.. from the post slugs? Basically, I'd like to run the post-slug through a filter when it is ...
1
vote
0answers
123 views

How to avoid directory name collisions with root Wordpress install [closed]

I need to know how I can keep the end-user of a wordpress site installed in the root directory from creating slugs that will interfere with sub-directories that are already present. I've Googled ...
-2
votes
2answers
380 views

author slug in the backend

hi and thanks for reading i try to grab the authors slug in the backend. get_the_author_meta( 'user_nicename' ); is empty. i tried to google this issue, but cant find any concrete info on how to ...
5
votes
1answer
3k views

custom slug for custom post type

Hi and thanks for reading. I want to insert the post author into my custom post type slug. Example: http://example.com/charts/%author%/ Any ideas how to accomplish this? Here is my custom post ...
3
votes
2answers
1k 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? ...
1
vote
2answers
2k views

Get list of all registered post types slugs

I'd like to get a list (array) of all the post types I registered. Precisely I would like to retrieve their slugs. Could someone help me? thanks!
0
votes
1answer
66 views

One Page or Post, n Slugs

What would be the best option for serving up a page for any one of many slugs. Suppose I have the following: example.com/the-broken-slug example.com/thebrokenslug example.com/broken-slug ...
0
votes
1answer
300 views

Can’t use a specific custom URL (slug)?

I’m having some problems understanding an error I’m getting. I have a page which is called “pitch” and as such the URL and the slug should be “pitch” as well, so: www.my-domain.com/pitch/ But when I ...
0
votes
1answer
168 views

BuddyPress Component Slug 404 [closed]

I have created a custom component using the latest skeleton framework that needs to have its URLs as part of the current group. I have accomplished this is in my component's setup_nav() function, but ...
0
votes
3answers
3k views

Using same slug name for a page and category

I know it isn't good practice but I'm considering using same name slugs for some pages and categories on a site that I'm working on. It's a small site and it doesn't seem to affect anything in ...
10
votes
3answers
4k views

Custom Post Type Slug / Page Slug Conflict - Prevent use of reserved slug on page save?

I have a custom post type of portfolio (slug portfolio) in my theme and all is working well except one thing. When people create a page with a slug of portfolio, eg: example.com/portfolio, the theme ...
5
votes
4answers
4k views

Theme localization of “slugs” (custom post types, taxonomies)

in my theme I want to define a series of custom post types and custom taxonomies, each one having its own customized slug; the base language of my theme is english, therefore the slugs will be in ...
0
votes
1answer
481 views

How can I edit the slugs of tags?

I'm interested in specifying different URL slugs for tags than the text they contain (e.g. changing the slug for a "QnA" tag to "questions-and-answers"). What's the easiest way of making and ...
1
vote
1answer
281 views

How to edit/remove a term that's in multiple taxonomies?

Some of the terms on my site appear with the same exact slug, in multiple taxonomies. For example: 'education' appears in both the 'department' taxonomy and the 'topic' taxonomy. Now, I can't seem ...
1
vote
1answer
76 views

Displaying a full post instead of a slug per category?

I have a single category on my blog that I want to display full posts in when looking at the category instead of just slugs. The category is for Podcasts, and presently it displays slugs which: ...
0
votes
2answers
274 views

Select query with two and two related taxonomies

is this possible for 2 taxonomy and 2 terms $querystr = " SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) ...
0
votes
1answer
3k views

Show all posts in category

I am trying to show all posts in each category. I've been searching around and it seems I need to have either the category slug or term_id to do so, like the code below. <?php ...
0
votes
1answer
2k views

Add category to custom post type automatically, using category slug

I'm using this excellent function to automatically add a category to my custom post type "Videos" on publish, if there's no category already chosen. This works great: function ...
0
votes
2answers
2k views

Get taxonomy slug from url

Sorry I'm new to taxonomies & trying to learn quickly. I've set up sectors and assigned a post to it. If I go to the post, I can see the URL has www.mydomain.com/sectors/auto/ How can I get auto ...
1
vote
2answers
398 views

Is using %postname% for permalinks really that bad for performance?

I've seen in various places, including the Wordpress admin and on this page, that using string based identifiers is "strongly not recommended for performance reasons". I understand that looking up a ...
3
votes
3answers
2k views

How to check if a slug exists?

I have a arbitrary string and want to check if a post with that slug string exists in the site. I tried to find a way to list all slugs, but can't find such a thing. Thanks
0
votes
1answer
363 views

Get plugin download URL from slug

Is there a way to take a plugin slug (e.g. 'akismet') of a plugin that is NOT currently installed and somehow retrieve the download URL of the current version (e.g. ...
3
votes
1answer
716 views

Slugs as breadcrumbs for Pages

I´m trying to create a function that creates a breadcrumb trail of Page slugs outside of The Loop. These breadcrumbs show the path from the homepage to the current (sub)page. For example, on the ...
1
vote
1answer
1k views

Setting a title on a Custom Post Type that doesn't support titles

I have a CPT called "profile" that only supports the editor and thumbnail. Each user is limited to posting just 1 profile. I'm looking for a way to prefill the title and slug fields with the display ...
0
votes
1answer
375 views

add slug of child(ren) to li using wp_list_pages

For a page template I am trying to include the 3 children of each page. That works fine. However as I want to include a different image for each of the children, I would like to add the slug of each ...
0
votes
1answer
828 views

Function to list all post slugs for every post in my WP database?

Function to list all post slugs for every post in wp_posts table? I assume there's an official function to generate a post slug, but maybe someone here already has the answer.
3
votes
1answer
864 views

The same slug in multiple taxonomies

We have a project that uses several custom taxonomies, and we're finding that the client wants to add the same term in several of them. While the first slug for Foo may be foo, subsequent copies of ...
0
votes
2answers
965 views

Remove international characters from slug - Almost done - Bit help

I want to remove some characters from the slug, like "¿" that we use in spanish for opening a question. If I go to wp-includes/formatting.php and in function sanitize_title_with_dashes($title) ...
11
votes
1answer
6k views

Is sanitize_title enough to generate post slugs?

I want to generate slug for some strings without going through WordPress slug generation flow. Therefore, I want to know which functions it calls to get a neat slug. I tried sanitize_title() but it ...