Tagged Questions

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

3
votes
1answer
2k views

Remove taxonomy base or term from url

I know there are a lot of posts about this here, but NONE of them have answered my problem. I am working with a custom built theme that has a custom category type (named messagetypes). I have a ...
2
votes
1answer
330 views

Why does WP rename similar “term name”-slugs in separate taxonomies?

I have several custom taxonomies and within two of those ( Company Categories and Photographer Categories ) I have a term that is similar. The Company Category called Boudoir and the Photographer ...
1
vote
1answer
568 views

How can I filter by slug depending on language selection

I'm new to this site but looking at the quality of answers provided here I will be here for a long time :) Ok, first a bit of info: I'm developing a bilingual website (English & Japanese) using ...
1
vote
4answers
733 views

How can I force WordPress to redirect to canonical permalinks?

In WordPress 3.1 a post can be reached a number of ways, for example each one of these takes you to the same post (where /id is the base) http://myblog.com/id/1008 http://myblog.com/id/1008/my-slug ...
1
vote
2answers
313 views

Category slug $_SERVER['REQUEST_URI'];

I'm not sure whats wrong with this line. Have I place this incorrectly? How do I get it to recognize the $yourcat->slug; $cat = get_query_var('cat'); $yourcat = get_category ($cat); $uri = ...
2
votes
1answer
221 views

Adding more pages to author pages

At the moment I have the following code for changing the author_base slug. /** ADD REWRITE RULES **/ function change_author_permalinks() { global $wp_rewrite; $wp_rewrite->author_base = ...
1
vote
1answer
1k views

How can I automatically set a post slug based on the post title during post publish?

When you create a post in WP, if you don't specify a title rapidly, WP generates a default slug on autosave, based on the post ID. Then, when you add the title later, unless you modify the slug by ...
0
votes
2answers
879 views

Modify Wordpress to not replace + (plus) characters from URLs?

This is happening in more than one section of our website, but in different yet similar ways. Scenario One: We have a URL structure like this... mydomain.com/some-category/?subject=Some+Subject ...
0
votes
1answer
629 views

How to create posts or pages with the names in wordpress?

When you develop a site on wordpress you may want to create posts/pages with the same name, something that wordpress does not allow by default. Use cases: example.com/en/contact ...
1
vote
2answers
1k views

How do I fix permalinks for custom post types that has the same slug as a page?

I know that it's impossible to have the same custom post type slug as a page. So, I thought it might be resolved in this way: 'rewrite' => array('slug' => 'my-category/!#') for ...
5
votes
1answer
3k views

Change Author Base Slug for different Roles

is it possible to change the author base slug in dependency of the role? For example, authors get example.com/ninja/%username% and subscribers get example.com/trainee/%username% ? I am thinking of ...
4
votes
1answer
12k views

How to get a taxonomy term name by the slug?

If I know a taxonomy term slug, how can I get that term's name?
0
votes
1answer
1k views

Custom Post Type pagination when CPT 'rewrite' rule and a page have the same slug

I would like to achive the following link structure on my site: /properties/ -> a properties page with properties CPT, page 1. /properties/page/2 -> a properties page with properties CPT, page 2. ...
0
votes
1answer
340 views

Category Slugs = 404s?

With the help of the internet and you lot, I have been stumbling about to create a worpress site here. So at this stage, its not exactly a default install. - Im running the boldy theme from Site5. - ...
3
votes
2answers
11k views

Get post by page name or slug

I know this is very avant-garde, but bear with me. I've read that one is able to query a page by the page/post name or slug. I'm trying to do this because I need information from a page with a similar ...
0
votes
1answer
947 views

get_term_by with a variable

I have a Custom template with a custom query. I want to use additional information about the current taxonomy > description and name (and use it in the HEAD, desc, keywords, etc...) <?php ...
2
votes
4answers
1k views

WordPress 3.1 removing 'category' from the slug

Is there a way to remove 'category' from the slug when viewing posts in a particular category in WordPress 3.1 without it breaking? My client is asking me to remove it, but it seems necessary - I get ...
3
votes
1answer
513 views

Stop Wordpress Redirection From /keyword to /some-post-containing-keyword/

I have tried everything I've found. I can't stop webhostingbreak.com/ipage/ from redirecting to webhostingbreak.com/hosting-directory/ipage-hosting/ I tried remove_filter('template_redirect', ...
1
vote
1answer
1k views

Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url

I have been reading dozens of posts and honestly, I have many doubts on how this work. Furthermore, I think that with WP3.1 more issues have been added here because I am having even more problems now ...
1
vote
1answer
196 views

Editing URL character replacement

Whereabouts can I edit which characters in permalinks are replaced? For example apostrophe's are replaced with nothing, and I would like to have them replaced with hyphens instead. Thanks.
1
vote
1answer
299 views

Wordpress slugs and 404 handling takes preference over folders in site root?

I have wordpress installed and permalink structure set to /%postname%/ In addition to WordPress folders, I also have a public_html/beta folder where I wanted to copy the same site and test some ...
3
votes
3answers
5k views

How do I get a post (page or CPT) ID from a title or slug?

I've scoured the Codex, failed to get get_page_by_title() to work and am quite surprised that there doesn't seem to be a standard WP function for this task. I need to get the ID of any given post/ ...
2
votes
3answers
1k views

Add parent template name to body class filter when visiting subpage or single post

how would I go about creating a filter for the body_class() tag that allows me to add the the parent pages slug name as a class to the body whenever visiting a subpage or post?
-1
votes
1answer
400 views

WordPress v3.1 Has Character Encoding Issue With Title/Permalink?

I was on the latest v3.0.x series and had no issues. Once I upgraded to WP v3.1, I am having a strange issue with character encoding in permalinks. If my title was "I have $50 today" in WP 3.0.x, the ...
6
votes
2answers
2k views

How to prevent apostrophes and quotes from appearing in permalinks?

I'm using custom permalinks "/%category%/%postname%/". Whenever a post title contains quotes or apostrophes they appear in the URL. Can someone tell me how prevent them from appearing in the slug? ...
0
votes
1answer
1k views

Getting Post ID from slug during init

I am trying to add a url rewrite rule that finds any posts that are connected to the current post (using Posts 2 Posts by scribu). It's tied into the WP Query object, so all I have to do is pass ...
0
votes
1answer
1k views

Listing all slugs?

I have a number of slugs and items in my custom category: SLUG - number video - 5 items music - 5 items [no-slug] - 5 items empty - 0 items blabla - 0 items I want to list all non-empty slugs ...
0
votes
2answers
1k views

Remove permalink for custom post type

I have multiple custom post types and custom taxonomies, "staff", "games", which have the permalinks: domain.com/staff/%staff-name% domain.com/games/%game-name% However, I'm only using these custom ...
0
votes
1answer
2k views

Interesting Custom Post Type Slug with Taxonomy and Custom Field

I have created a custom post type called "events" and have also created a custom taxonomy which only shows up on this specific post type through which the admin must select an "event category" ...
0
votes
3answers
2k views

Get wordpress taxonomy slug name(s) to use as div class

I'm trying to mark up my posts using their custom taxonomy slug as the div class so that they can be filtered... So far what I have displays the taxonomy name but what I need is the slug so I have a ...
2
votes
5answers
7k views

Change the Author Slug from Username to Nickname

Hi to the community, is it possible to change the default username slug to nickname if is available? By default the url is something like: http://domain.tld/author/(admin) , is it possible to ...
2
votes
1answer
1k views

Create terms when registering taxonomy?

I'm registering taxonomy in my functions.php file: register_taxonomy("our_gallery_types", array("gallery"), array("hierarchical" => true, "label" => "Categories", "singular_label" => ...
2
votes
3answers
2k views

How to create non-unique sub-category slugs?

What’s the best way to make Wordpress accept non-unique sub-category slugs? By default, Wordpress ensures that every ‘slug’ portion of permalink URLs is unique, and is very savvy about using this to ...
5
votes
1answer
4k views

Rename files during upload using variables

I'd like to rename files during upload and set their names to the post slug the files are being attached to, plus some random characters (a simple incremental counter will de just fine) to make the ...
0
votes
1answer
535 views

Removing Automatic Redirects Without Plugin

I've been working on a wordpress site and run into the automatic redirect feature when you change a slug. On the current site I am using the Redirects plugin, and was able to modify the redirects so ...
7
votes
1answer
3k views

custom taxonomy and pages rewrite slug conflict gives 404

I'm using the Custom Post Type UI plugin to create my custom taxonomies. I have a portfolio that is made up of projects (custom post type) with 2 custom taxonomies of technologies and clients. The ...
1
vote
1answer
687 views

Slug is redirecting to 404

I had a page called Recipes. I changed it to Recipes_old and changed the slug so I could create a new Recipes page. When I created the new Recipes page the slug was properly defined as /recipes/ but ...
2
votes
2answers
3k views

Removing the number in a category slug

I have a category that ends with -2, and there's no way I can change it back to the plain word. I know there are problems with numeric slugs, but this is just a word. I also know that a common answer ...
5
votes
4answers
2k views

Removing Metabox for “Slug” without removing functionality

Here is an interesting question. I have recently noticed that if you utilize the code remove_meta_box('slugdiv', 'post', 'normal'); you are actually unable to modify the slug when you click on ...
0
votes
2answers
433 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 ...
3
votes
1answer
207 views

Editing the Number at the end of Page URLs / Editing Page Slugs

I am playing around with wordpress and a few plugins. Say I have something called "Shopping Cart" and I delete the page. Then I recreate it, I can't have the old URL back. I get ...
4
votes
3answers
864 views

Natural URL Design and static front page

A static front page and other pages which are children of it are used on a blog. To give an example: www.example.com The slug for that page shows up in the permalink for sub pages like ...
3
votes
4answers
2k views

Can I use a number for a post/page slug?

Is it possible to use a number for a post/page slug? I have tried to use e.g. '123' for my page slug, but each time WordPress converts it to '123-2'. I'm guessing that any number is perhaps ...