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
1
vote
1answer
33 views

Why does wordpress keep adding postname to my CPT's permalink in the end?

Alternate Question: How to change Permalink structure for CPT so that post name comes in the middle of URL instead of in the end eg. /a/%postname%/b/c Any suggestions while changing the permalink ...
1
vote
0answers
27 views

Share same Slug for a Custom Post Type and 2 Taxonomies

I'm trying to achieve an URL structure that implies sharing the same slug ("videos") for a Custom Post Type (video), and two Taxonomies (video_category, video_tag), in order to have: Page: /...
0
votes
0answers
20 views

If Term Name Exists, Append a Unique ID to Slug

How would I go about adding a unique ID to a custom taxonomies slug? We have multiple users who can create their own taxonomies. The problem occurs when two users wish to create a taxonomy of the same ...
0
votes
0answers
20 views

YOAST SEO breadcrumbs URL wrong in post page

I use YOAST SEO for Breadcrumbs in my custom theme. I have the following structure: Home > Category > Subcategory > Single Post. When I am in a Subcategory, breadcrumbs show Home > ...
0
votes
1answer
11 views

Changing search slug from + to - (hyphen)

I've been fiddling with this all day, where I'm trying to change my search function from website.com/s?this%20is%20an%20example to website.com/tag/this-is-an-example to no avail. I have this code in ...
0
votes
0answers
25 views

Check if a page or post url is public or exits

I am new to wordpress and I wanted to know if there is a way to check if a post or page URL in wordpress is public or the url exists. I came across wp_remote_head(url) and to check for the response ...
0
votes
1answer
20 views

How to add a shortcode function that returns the taxonomy slug of the actual post within the loop

Circumstances: I have a CPT called "designs" and a taxonomy related to it, called "project_category" so that I can assign a category to each design. I'm building the template for ...
0
votes
1answer
18 views

Check if parent page has child page of certain slug

I currently have a function that checks to see if the page is a parent, and if so, do stuff. But I also want to check to see if the parent has a child page that has a certain slug. Basically, how ...
2
votes
1answer
46 views

What is the wordpress way of displaying local external content?

I have a somewhat tricky situation. A company's internal server, running some unknown software (means I have no access whatsoever), exports data to my http server via a custom API. This data gets ...
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
33 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
50 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
20 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
37 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
25 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
20 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
20 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
14 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
23 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
11 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
15 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
32 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
18 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
24 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
45 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
42 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
38 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
22 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
16 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
41 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
36 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
28 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
34 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
9 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
28 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
20 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 ...

1
2 3 4 5
15