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
13 views

mysterious issue with stop words in urls not working - how can I restore multiple url access?

I have a site that until recently, you could access a url of a post on the site with or without certain "stop words". Now though for some mysterious reason that doesn't work. So to clarify, the ...
0
votes
1answer
536 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 ...
3
votes
2answers
663 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 ...
1
vote
0answers
21 views

Edit page slug after save, cause 404 by linked pages

I have two page bar page at url: http://www.example.com/bar/ foo page at url: http://www.example.com/foo/ bar page link to foo page in content, eg.: <a href="http://www.example.com/foo/">...
1
vote
3answers
592 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
2answers
536 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 ...
-1
votes
2answers
917 views

Later change of taxonomy slug base not changing permalink

When defining a taxonomy I successfully set the slug base for it as well, all via functions.php. However, any change on the slug’s base (via editing functions.php again) is being recognised, i.e. it ...
6
votes
3answers
475 views

How does wordpress keep track of post id when post id is not used in permalinks?

There are few sites i have seen which does not use post id in their permalink structure. becuase of this their url becomes., http://example.com/example-content/ so what happens when user adds new ...
6
votes
3answers
5k views

How does WordPress generate URL slugs?

Is there a page somewhere that details exactly how WordPress generates slugs for URLs? I'm writing a script that needs to generate URL slugs identical to the ones WordPress generates.
2
votes
2answers
509 views

How to generate random numeric slugs for a custom post type?

I have this PHP code to generate a random numeric string: function generateRandomString($length = 12) { global $generatedStrings; $characters = '0123456789'; $randomString = ''; for ($...
0
votes
0answers
11 views

Facebook-like user profile urls

I have already implemented custom user profile pages accessible by http://example.com/profile/user-defined-slug This is relatively simple by wp url rewritting filters. Now I need to implement the ...
1
vote
1answer
36 views

Change settings of get_post_type_object

I've a theme with a plugin provided by theme developer for manage portfolios section. This plugin create a custom post type with this code: // Portfolio post type register_post_type('...
1
vote
1answer
47 views

How to get posts by multiple post slugs? [duplicate]

i am trying to get posts by multiple posts slugs, i can do this by passing post ids but I do not want to pass post ids i am looking for posts slug Here is my code $option = array( 'posts_per_page' =...
1
vote
1answer
513 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
1answer
285 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 ...
0
votes
1answer
44 views

How to get a post's content? [closed]

I'd like to known what is the best solution for getting a sepecific post's content. By slug, tag, id or category ? Or template assigned to this post ? I don't like the way to find this post by its id ...
0
votes
0answers
22 views

Wordpress using get_term to retreive slug not working as expected

Im using the below code to try and get the slug for the current category and the parent category. Ive managed to get as far as getting the currently cat slug but the parent displays in readable text ...
3
votes
1answer
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: www.blog.com/products/...
2
votes
1answer
16 views

What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?

I have a plugin where I need to reserve some slugs so I am using the filters wp_unique_post_slug_is_bad_flat_slug and wp_unique_post_slug_is_bad_hierarchical_slug. I apply them like this on my plugin ...
0
votes
2answers
504 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. 'http://downloads.wordpress.org/...
0
votes
0answers
41 views

Issues with custom taxonomy

Having issue with url structure and pagination for custom post type and custom taxonomies. We have the category page of custom taxonomy working on first page but on others it gives error. Example of ...
11
votes
4answers
5k 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 ...
2
votes
0answers
63 views

Can we have same term slug in different taxonomies?

I am having problem when creating term with same slug in different taxonomies. I researched that Unique key is removed from slug in wp_terms table, so i am getting problem to figure out that why i am ...
0
votes
1answer
16 views

Creating plugin for changing slug

I need help about creating plugin for rewriting slug. When you enter you post name or page name wordpress is creating slug. So I want to make some modification. I don't know how to make changes in DB ...
0
votes
0answers
31 views

Remove CPT slug in multisite installation

I would like to remove the custom post type slug from the site url. Searched hours for a solution. Didn't find a working one and can't resolve it on my own. It is a domain-based multisite installation....
0
votes
0answers
11 views

How to occupy Wordpress slug [duplicate]

I'm wondering how to occupy a certain slug to prevent it from being used by my users. I want to make a custom redirect to redirect the users to my login page. So the url could be subdomain.mysite....
0
votes
1answer
31 views

Force/Limit the post/page slug to accept only url friendly characters

Is there a way to overwrite WP slug validation function to only accept basic characters ([A-Z0-9-]) as I want to avoid the long encoded permlink. Thanks.
0
votes
1answer
36 views

How to add an attribute data-slug = “$specfic_page_slug” in WordPress menu item?

I want to add custom attribute in WordPress menu item which has specific page slug. like this - <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-101" id="menu-item-...
0
votes
1answer
30 views

Change user slug in Buddypress

I am creating a site with Buddypress. Everything is going good so far but default member slug for buddypress is domain.com/members/abc. I want that it as domain.com/abc like facebook and twitter. Any ...
26
votes
7answers
90k 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 href="/slug-of-current-...
4
votes
1answer
46 views

Replace Wordpress %postname% suffix with %postid%?

I run a news site and there's a Wordpress permalink issue that I have been wondering. Now, Wordpress will add an incremental numeric suffix to duplicate %postname% regardless of the directory ...
0
votes
1answer
382 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 ...
0
votes
1answer
31 views

Getting a 404 on single custom post type page when using rewrite on a custom taxonomy

I am getting a 404 on my single custom post types whilst using the 'rewrite' option in the custom taxonomy. If I take the rewrite out the single page works but the custom taxonomy archive then 404's ...
0
votes
1answer
29 views

Custom Post Type for Shortcode Use - Prevent it display as a post (with slug)

I've developed a series of plugins which can display categorised custom post types via shortcodes, along the lines of: [myshortcode myshortcodegroup="groupname"] This works just fine, however, I ...
0
votes
1answer
51 views

How to auto update post title and slug with category name when post status is updated

I need to auto update post title and slug with category name every time when post status is updated. Some function like this but with the correct code.... add_filter('wp_insert_post_data','...
0
votes
0answers
24 views

Custom post template for custom post type

I created a custom type post: add_action('init', 'crea_prodotti'); function crea_prodotti() { $labels = array( 'name' => __('Prodotti'), 'singular_name' =&...
0
votes
2answers
73 views

Auto update post title and slug when post status is changed

I need help. Thanks in advance. I need a function that update post title and slug with some default title + current date when post status is updated from draft to published. I use this one to update ...
0
votes
1answer
30 views

Wordpress CPT slug and page slug conflicts

I have one page slug "new-site" also i have another custom post type with same slug "new-site" while i browse site http://example.com/new-site then it directally goes to archive page and show all the ...
1
vote
1answer
96 views

How do I get the category URL from get_the_category?

My loop below shows the latest 4 posts from the same category as the post currently being viewed. Its located within single.php. I'm trying to get the URL of that same category so I can link back to ...
0
votes
0answers
16 views

Wordpress Site Architecture Question

I have a multi site called 'quotes' the url of which looks like example.com/quotes/. I have some quotes under them like example.com/quotes/this-is-a-quote.html. I have some authors like example.com/...
1
vote
1answer
63 views

pass user id in slug and get user information

I have user id and I am getting all information using user id on page with slug. When I pass the user id in slug then I am not getting user information on page. For example I have www.mysite.com/...
0
votes
0answers
45 views

After I changed the slug of a custom post type, the single page returns 404

I created a custom post type using types plugin the post type has ad as slug, but now need to change it to card, and I edited the slug field in the types panel. the thing is that new urls return 404.....
2
votes
5answers
5k views

Add menu and submenu in admin with a URL instead of slug?

I use this function and hook: function mysite_admin_menu() { add_menu_page( 'Categories', 'Catégories', 'administrator', 'categories', 'a_function' ); add_submenu_page( 'categories', 'Manage', '...
3
votes
1answer
1k 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
72 views

How to generate slugs?

I have the following situation. I accidentally updated post_name column in wp_posts tables for all rows. Now I need to update those back somehow. I have researched that WP uses this function to ...
1
vote
1answer
75 views

How to make draft posts or posts in review accessible via full url / slug?

I am running a website with WordPress 4.2 and have changed the way draft posts or posts in review status are displayed to non logged in users (these posts are, too, visible to anyone who visits the ...
0
votes
1answer
340 views

Woocommerce get the Archive/Category slug of the current category page

I want to get the slug of the current archive page. I have a slider where I want to echo the products that are in this category. After hours this is all I have and it doesn't work... <?php if ( ...
0
votes
0answers
42 views

Can I override the permalink/slug on creation

I have a plugin that imports data from an external API, creates a 'Product' Custom Post type ( or updates an existing one ) and then adds all the meta data. Every time we update the product from the ...
5
votes
4answers
6k views

Force post slug to be auto generated from title on save

I'm running a property site where many properties are sold in apartment blocks. Because of this what the content editors do is create a post/property with all the details and then use a duplicate ...
6
votes
1answer
146 views

What is wp_insert_term “alias_of” arg for?

I currently put my hands into WP taxonomy and terms to find solutions for my project. I knew that it's not possible to have same terms slug when creating a term with wp_insert_term in one Custom ...