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

2
votes
1answer
104 views

Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?

I have a custom post type called ‘sets’ and a taxonomy set up under it called ‘project’. Most of the posts under this custom post type will be assigned one project term, but not necessarily. When a ...
0
votes
3answers
127 views

How do I get slug of term by his name?

The WC_Order_Item_Meta::get_formatted() function returns terms array of the order. Each term is an array of three things: 'key' => $meta->key // attribute key 'label' => ...
0
votes
0answers
55 views

Unicode permalink slug are getting tuncated

I'm developing a website which is mainly a Bengali language based website. I'm using the post-name permalink structure. Every time a post name get longer, slug is getting truncated. Is there any way ...
0
votes
1answer
290 views

WooCommerce duplicate sub categories and product slugs

I'm building a website that allows you to hire or buy a product. I've set up the following product categories in WooCommerce: Hire Buy Is it possible to have the same sub-category slug under each ...
2
votes
2answers
292 views

How to get Plugin Slugs?

I am trying to get the 'slug' used for each plugin installed. I have not found a good solution for this. I have created this function to get all the slugs and return them in an array. I am hoping ...
0
votes
1answer
47 views

How to use a specific custom field in a custom post type as slug

I'd like use a specific custom field in a custom post type as the slug for the post. My custom post type is members and the custom field that I want to use as the slug is member_user. How can I do ...
0
votes
0answers
104 views

Removing or hiding slug/permalink from htaccess

I have this slug that i want to hide for SEO matters. My current slug is: homepage.com/company/companyname All i want is to be: homepage.com/companyname I tried lots for plugins and htaccess codes ...
0
votes
1answer
36 views

How to create a second set of tags that use the same slug or URL?

Is there a way to create a second set of tags that can use the same slug or URL? Normally, an example set of tags will look like this by default on a WordPress blog page: ■ tag1, tag2, tag3, tag4, ...
10
votes
4answers
4k views

Remove slug from custom post type post URLs

It seems that all web resources based on the subject of removing a custom post type slug ie yourdomain.com/CPT-SLUG/post-name are now very outdated solutions often referencing pre WP version 3.5 ...
0
votes
1answer
38 views

Get all terms/slugs - used, not used & in hierarchical order

I need to get all the slugs/terms - those that are used & those that are not. It's hierarchical (3-4 levels). How to get all (used & not used) terms/slugs in hierarchical order? This code ...
1
vote
1answer
38 views

CPT custom archive template does not get loaded

I have a custom content type called events that I register using the following function: add_action('init', 'events_post_init'); function events_post_init() { register_post_type( 'events', ...
1
vote
1answer
96 views

Change author base slug to user role

My goal is simple, to change authot base role to user role. For example: admin: wwww.mysite.com/admin/username editor: www.mysite.com/editor/username default looks like this to any user: ...
0
votes
0answers
220 views

Get the custom post type slug but remove the rewrite prefix?

I am trying to add a link to the parent custom post archive page in the breadcrumbs. I can get the slug using this: <?php $post_type = get_post_type(); if ( $post_type ) { $post_type_data = ...
0
votes
0answers
58 views

Custom Taxonomy Dynamic Slugs

I have two custom taxonomies named Cities and store-categories. i have following code for that register_taxonomy('cities',array('store-listings'), array( 'hierarchical' => true, 'labels' ...
0
votes
1answer
31 views

How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?

I have a page, say streets, which is a static page and has the slug example.com/streets/, and I want to have many single streets under it. Let these streets be called streetdetails, so a single street ...
0
votes
0answers
44 views

custom post type slug and redirection

I have a custom post type called portfolio (slug portfolio). In this i have entries like toys, bugs, people. So the URL will look like: mysite.com/portfolio/toys mysite.com/portfolio/bugs ...
2
votes
1answer
95 views

Creating a template using a specific slug name, for a page with a parent page

I have always preffered to create layout templates for specific pages by creating a filename the same as the slug. So for example: Page Title: Contact Us Page Slug: contact-us Filename of template ...
0
votes
2answers
284 views

If file exists with page slug name show image else nothing

I need to add a php code in a wordpress widget called PHP Code Widget which only asks for proper enclosing: All PHP code must be enclosed in the standard php opening and closing tags ( <?php and ...
0
votes
0answers
12 views

User only edit CPT with slug that matches username

I'm in a situation that necessitates I complete this project within a week. So any help or specific guidance to my question would greatly appreciated. Is it possible, without creating an incredible ...
1
vote
1answer
56 views

custom slug always ends in “-2”

I have a custom post type called task. I want the slug of each task to be an id, rather than use the entered title. I've modified the code from this SO question "How to customize this automatic slug ...
1
vote
1answer
76 views

Am I using the flush_rewrite_rules function in the right place?

Hello dears I'm writing an admin panel for my new WordPress plugin base on the WordPress Settings APIs. I am defining a field for changing custom post slug from this admin panel. After the custom ...
0
votes
1answer
88 views

WP Database generate content for post_name column

I ran a query that deleted all content in post_name (used for SEO-friendly URLs) column. UPDATE wp_posts SET post_name = '' I thought that WordPress would automatically populate new ones if I ...
0
votes
1answer
75 views

Custom Post Types and Removing Slugs - should we do it?

I've run into issues trying to remove my custom post types slugs and I've read other questions on here from people with the same problem. We don't want that slug in our URL! But the solutions to this ...
1
vote
0answers
110 views

Automatically add date to the auto generation of post slug

I need to customize the slug when you add new post and after you write title it creates automatically slug. I want to add before the auto title of the post the current date on this format d-m-y so the ...
1
vote
2answers
127 views

How to handle broken links created by permalink/slug changes?

If I create a page with the slug "exams" and then need to change the page's slug from "exams" to "tests", any other pages in WordPress that link to the original permalink now have broken links as ...
0
votes
0answers
29 views

“Project” post type to “Page”

I need the user to go to a Page when he clicks on the menu that is managed in "Projects" section (backend). Situation I have a kind of a menu managed in "Projects" section (backend), made with ...
0
votes
1answer
405 views

Get custom category image from menu

I've got myself into a little pickle, and while I'm so close, my understanding of PHP is letting me down. I want to display the image associated with each category in the menu - working from the ...
0
votes
1answer
34 views

Bulk-change Post slugs which have a suffix

I've got a bunch of slugs that look something like this: pageA-2 pageB-2 etc. Fwiw, I think I did an import, then moved those to Trash, then did another import. Because I had Pages with an ...
0
votes
1answer
39 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 ...
0
votes
0answers
65 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
114 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
23 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
106 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
0answers
28 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
36 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
1answer
239 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
2k 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
37 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
91 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
0answers
196 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
2answers
404 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
22 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
187 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 ...
1
vote
2answers
445 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
10 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
0answers
22 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 ...
0
votes
1answer
61 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
0answers
90 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? ...
0
votes
0answers
36 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
71 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. ...