Questions tagged [slug]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

Custom post type on two pages with different taxonomies but not use the CPT slug

Looking for some advice... I want to have two pages that list posts based around one custom post type (archive-false). For this example I’ve called the CPT: trains. The two pages are called electric ...
1
vote
1answer
31 views

wordpress sub-category ( lowercase letters + non-latin characters ) = 404

If the sub-category's slug is a combination of lowercase letters and Korean, page 404 appears. 1 : NGINX settings location / { try_files $uri $uri/ /index.php?$args; } 2 : Wordpress - Permerlink ...
0
votes
0answers
33 views

For Chinese language how to make WordPress post slug and permalink as like as the post title?

For the Chinese language, WordPress permalink and slug are not readable. It converted to ASCII. Is there a way to make permalink and slug as like as the post title?
0
votes
1answer
18 views

Wordpress Custom Post Type - Rewrite Query

So I have a project I am currently working on, where I have a Wordpress set to a permalink structure of /blog/%postname% for blog posts and pages are domain.com/page-slug/ I have created a custom post ...
0
votes
1answer
14 views

What is an equivalent of single_cat_title for getting the slug of the category?

I searched for something like single_cat_slug but I did not find something relevant. All I don't know how to do it is to find the slug, not the name, of the currently opened category page. I do not ...
0
votes
0answers
21 views

Load Dynamic Template Page by Metabox

Does anyone know how I can implement Wordpress as shown in the image below? I would like to have a unique url passing the company_name metabox as a parameter and from business_type create a function ...
1
vote
0answers
16 views

Allow Chinese character on post URL slug

When I create a post I can't set the permalink with custom non Latin character, when I insert Chinese character on url slug it will automatically disappear after onblur the input text. Is there any ...
0
votes
0answers
19 views

Wordpress URL auto correct returns pages from a different category. Can this be changed?

I have categories set to be part of the url and there are pages that start with the same slug but in different categories. /category-A/123-hello-world /category-B/123-some-longer-slug-here If a url is ...
1
vote
1answer
17 views

Access files at new location using old file paths

I have a bunch of posts that contain images with urls that follow this pattern: https://example.com/example_directory/files/2019/04/file.png I've imported the posts into a new install of wordpress on ...
0
votes
1answer
18 views

Wordpress pagination URL

How to get a similar kind of pagination URL in Wordpress? In both the URL you can see 'Faculty' which you cannot achieve in default Wordpress I guess. Listing page: https://engineering.jhu.edu/...
0
votes
2answers
19 views

Custom PHP form needs refresh to load page correctly

I have a single page site with all content on it. The only other page I have is a "thanks for submitting the contact form" page. In this "thankssubmit.php" page I have my PHP form ...
0
votes
0answers
13 views

Multiple permalinks for a single custom post with post ID in permalink and post title

I'd like to be able to have multiple permalinks for the same underlying post (so if the post title is modified, the people still will find the page) - So, One URL will work with 3 different options. ...
1
vote
1answer
21 views

How can I increase the length for the taxonomy term slug?

I am trying to create a new term in topic taxonomy. Since I am writing in Bangla Unicode instead of English, the slug is created with lesser/broken text. Is there any hook to update the length for the ...
0
votes
0answers
10 views

Output Term List and Respective Term Slug from Multiple Taxonomies

Complete original code renders 'category' terms with link. My modifications to the original renders 'category' terms with link but does not link out parent nor children of 'genre' (they render okay). ...
0
votes
0answers
14 views

How can I rename a custom field group?

I want to rename the "password managers".
0
votes
0answers
6 views

Rewrite post URL based on query vars

The idea is this Let say I have this URL: https://example.com/page-generator And depending on the query_var I attach to it I could show one page or another For example lets say we have created already ...
0
votes
0answers
8 views

Corrections for url rewrite

function wp_change_link( $permalink, $post ) { if( $post->post_type == 'post_type' ) { $resource_terms = get_the_terms( $post, 'custom_tax' ); $term_slug = ''; if( ! ...
0
votes
0answers
34 views

Check for the existence of term slug

I need to check term slug, if slug do not have, not display: if(is_tax()){ $permalink = get_home_url() ."/category" . '/' .$term_slug . '/' .$post->post_name; }else{ $permalink = ...
1
vote
1answer
23 views

Custom permalinks in Wordpress

I have a question about permalinks that has me crazy because I have not found a solution for a long time 🙁 So I turn to the wisdom of the hive mind to see if it sheds some light on me. I have my ...
1
vote
1answer
24 views

is_account_page() change to page slug

i'm really new to wordpress php. which function should i use to replace is_account_page() in a code. here's what I'm trying to achieve before if (is_account_page()){ do some code here } after if (...
0
votes
1answer
15 views

Get post slug and match with menu item slug to change css

I have a custom vertical menu based on posts of a specific category. I want to match the slug of the menu item with the slug of the current post to apply css. Specifically, I want to change the ...
0
votes
1answer
23 views

WordPress different templates for same type custom post (but different slug)

I have created one custom post type lets say movie, now I have created 4 posts under movie type. Slugs are movie/parasite/director and movie/parasite/actor. Similarly movie/joker/director and movie/...
0
votes
2answers
16 views

Wordpress slug confusion

How can I make my page url to be like this in wordpress? Normal link: www.google.com/about What I want: www.google.com/any-slug/about How can I do that?
0
votes
1answer
20 views

Can anybody provide me with a function to generate slugs?

The functions Wordpress uses to generate slugs are scattered in several functions and filters. I cannot find them all. Can anybody provide me a single php function to generate slugs? I do not need all ...
0
votes
0answers
37 views

Can non-latin characters appear in slugs?

For a non-latin category name such as "我的种类", the slug generated is "%e6%88%91%e7%9a%84%e7%a7%8d%e7%b1%bb". What function does Wordpress use to generate this slug? Can I directly ...
0
votes
0answers
30 views

Wordpress, result array of 'post_name'

when I try to run this array it doesn't give me the exact results of the 4 slugs I want to get, but many more results come out. $slugArray = array( 'post_type' => 'post', 'post_status' ...
0
votes
0answers
15 views

Default Post post type and custom post type rewrite slugs

So, currently, my blog page is at /blog/ and I also have 2 custom post types. What I'm trying to get is to have all the posts/archives of the Post post type show under /blog/, and for one of the ...
0
votes
0answers
15 views

get_query_var to get second slash parameters

how i get second parameters affter slash Example function.php function custom_rewrite_tag() { add_rewrite_tag('%page_name%', '([^&]+)'); } add_action('init', 'custom_rewrite_tag', 10, 0); ...
1
vote
0answers
34 views

Adding Post id to the end of slug in a Custom Post Type

I have created a Custom Post Type (jobs) - Functions fine. But due to the possibility of duplicate page titles by admin, I need the permalink/slug to include the Post_ID to the end of the Post title, ...
0
votes
0answers
33 views

change permalink number

these days I wonder how I can change the final permalink number of my posts by +1, i found this code on the net, but it needs to be changed someone help me? // Get all posts $query = new WP_Query(...
1
vote
0answers
24 views

php script to change slug in post automatically

I would like a script that changes the final number I have in my slug by +1, for example if my link is https://site. com/permalink-1 number 1 must become 2, so I would like to insert a list of posts ...
0
votes
1answer
17 views

Show code dependant on CPT & category

I'm currently using the following plugin on my WordPress website to show our up coming events: https://wordpress.org/plugins/import-eventbrite-events/ I need to write an IF statement that will check ...
1
vote
0answers
30 views

Remove the parent slug in a CPT URL

Here is the code that I insert in my functions.php to remove the slug of a CPT present in the URL : /** * Remove the custom post type slug from URL */ function wpc_remove_cpt_slug($...
0
votes
0answers
8 views

Post slug cannot be edited after add add_rewrite_rule

Because I wanted to add a blog reference to the slug of each post, I add a add_rewrite_rule. But now the slug can not be edited on the dashboard. How can I make the slug editable? my dashbord: my ...
0
votes
1answer
18 views

How to delete a post and keep its slug to refer to another post

I've 2 almost identical posts: https://webscraping.pro/reliable-open-proxies-for-business-directories-scrape/ https://webscraping.pro/reliable-rotating-proxies-for-business-directories-scrape/ I ...
0
votes
0answers
27 views

Custom Slug in Custom Post Types and Custom Taxonomies

We never ever get into this situation because I will never use custom post types in a blog article website. But, because SEO and Analytics we need to change this. this my example: $postTypeName = '...
0
votes
0answers
11 views

How to create such URL structure for CPT with custom taxonomy

I have a CPT - Market (eg Footlocker) And I have a taxonomy - Countries But countries are divided into regions, so they look like a subcategory ( Europe - France, Germany, etc) I want to get a URL ...
0
votes
0answers
9 views

Slug duplicates once clicking on link

I'm using polylang plugin. I have the current URL http://localhost/wordpress/en/ in my browser, I have another URL that suppose to change language to Hebrew http://localhost/wordpress/he/. <a href=...
0
votes
1answer
14 views

Attachment pages stealing page slugs

I'm working on remaking a big website with its upload folder already full of many gigabits of images. I just noticed a problem I never noticed with WordPress before: it seems to create attachment ...
0
votes
0answers
16 views

Does single webpage do not need navigation to create a slug in permalink?

I have concern about the permalink in my working project do i need to create a slug for the permalink in navigation. Your answer will highly appreciated. Someone help me stock in
1
vote
0answers
28 views

Permalink for a custom post type isn't working and I don't know why

I think this question was answered a lot, but despite all threads I couldn't find a valid answer: I'm working on a website with Wordpress (and without any plugin). Here the creation of my custom post ...
0
votes
0answers
28 views

When I modify the product's permalink, the pages stop working

I'm trying to modify the Woocommerce slugs with the object $wp_rewrite. When I modify it, everything works as I put it, but the rest as the pages stop working. Here the code: public function rewrite():...
1
vote
1answer
48 views

Change default search URL slug in wordpress with Custop Post Type as Search target

I want to change default search page URL from: http://example.com/?s=background&post_type=download to: http://example.com/photos/background/ I tried to change the below function for the default ...
0
votes
0answers
13 views

Page Titles and Slugs get deleted

I have a strange issue with my wordpress website. It doesn't save post/page titles. Has anyone faced a similar issue before? Each time when I create a new post or a page and put a title - it gets ...
0
votes
1answer
26 views

Adding a custom field to a slug

I'm using the WP Job Manager plugin, and want to add the company name field to the slug automatically when I save a post. I've got it working using the code below, but once I save and then edit the ...
0
votes
0answers
14 views

How might I disable the slug edit button for any post that has ever been published?

I want to disable the slug-edit (my permalinks) button on post.php for any post that has ever been published, which includes posts that were once published and then unpublished. However, after having ...
0
votes
1answer
69 views

Disable WordPress from changing URL slug when post is published

We have post titles that contain emojis. While creating a post and saving it as a draft, the URL slug generated by WordPress doesn't add the [emoji] from the title. However, when the post is published,...
0
votes
1answer
26 views

How to prevent WordPress from redirecting single page to prefixed category archive with same name?

I have been trying to solve this problem for hours. I would like to have a page with a simple slug (/blog) and a category term with the same name (/category/blog) exist on my site together at the same ...
0
votes
0answers
12 views

Creating sub-slugs without actual parent page

I would like to create individual pages for each member within a team: http://www.example.com/team/person-a http://www.example.com/team/person-b In the navigation menu I provide a parent entry ...
0
votes
0answers
47 views

Multiple slugs for one taxonomy?

I currently have a taxonomy registered with slug moods. So I access the terms with mydomain.com/moods/happy. I also want to access this with mydomain.com/tags/happy. I don't want to redirect. I want ...

1
2 3 4 5
14