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
2answers
15 views

Difference between a default post type and a custom post type?

I'm a new user of WP, i have create 6 customs post type where i can change parameters of them in the functions.php of my personnal theme. I can change 'supports' and 'slug'. On my url if i put my cpt ...
0
votes
0answers
26 views

How do I use the same Tag slug for different Tags?

I want to use the same Tag slug for different Tags. My URL structure will be unique basing on the category, but post_name and post_tag may happen to be duplicate in some cases. I need this for good ...
0
votes
0answers
15 views

How to use current post ID in pods single value widget?

How can I get the current post slug (or ID) to view a simple pods field in a widget? I really can't find a way to do it. In the single field pods widget there are 4 fields: Title (I can leave it ...
1
vote
1answer
18 views

Need to pull parent category and slug - only pulling daughter category

I am tweaking a theme for my friend, and I am using the following: <?php $category = get_the_category(); ?> <h3 class="omc-blog-two-cat"><a href="<?php echo home_url(); echo ('/...
1
vote
1answer
36 views

Preserve old website URL structure after migrating to Wordpress

Old (non-Wordpress) URL structure: "News" and "Gossip" are categories "Italy" and "Uk" are subcategories https://example.com/news/italy https://example.com/news/uk https://example.com/gossip/italy ...
0
votes
1answer
15 views

Swap out a page that is a parent to a many many pages

I have a specific page on my site and I'm experimenting with some changes that are too complex to have a backup (page template change, custom fields etc). I duplicated the page using a plugin and ...
0
votes
1answer
15 views

my post slug gets really long and I can't change it

my page url works, when I type in a slug, whith my focus keyword (using yoast) it changes it aotumatically when I click out of it to some code (%d7%a7%d7%99%d7%93%d7%95%d7%9d-%d7%9e%d7%a0%d7%a6%d7%97) ...
0
votes
1answer
46 views

Remove custom taxonamy slug with pagination

I have added the custom taxonamy for my faq site. I want to remove the default custom taxonamy showing in url for archive page. I have tried some codes, but it's break my pagination. function ...
0
votes
1answer
42 views

How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?

This is my first post, so maybe I'll miss some informations, sorry :bowing. I have almost the same issue as Paul T did (Permalinks: custom post type -> custom taxonomy -> post), namely : I ...
0
votes
0answers
12 views

How can I use same post slug while posts are in different categories?

Example1: www.site.site/category1/abcd-slug/ Example2: www.site.site/category2/abcd-slug/ Wordpress auto adds same number end of the slug of example2. www.site.site/category1/abcd-slug-2/ But I need ...
0
votes
0answers
18 views

wp_nav_menu slug in before item

how i can place menu item slug on before items like this: wp_nav_menu(array( "theme_location" => "mymenu", "menu_class" => "mymenu", "before_item" => "<span>$item->...
0
votes
0answers
14 views

permalinks / slugs

This is the first site I have had a problem with the page name not showing up in the domain page name. Like https://imaginedesigns.ca/?page_id=11 is the permalink that shows but my slug shows 'about' ...
0
votes
0answers
16 views

Use taxonomy term in custom post url, not the taxonomy slug

I want to use the taxonomy term in my custom post url, but not the taxonomy slug and can't figure it out. Here's what I have so far. I have a custom post type articles and a custom taxonomy sections. ...
0
votes
0answers
53 views

Proper way to dynamically load content based on url slug Wordpress

I am trying to set up a page template that can dynamically load content to the page based on the url slug. For example: https://example.com/cities/indianapolis/ loads data specific to Indianapolis and ...
0
votes
1answer
32 views

How to ignore GET parameter that’s the same as a CPT slug?

I have a custom post type called newsletter. At the same time, an implemented analytics tool (not related to my CPT) uses newsletter as a GET parameter to track some incoming links (and I can’t change ...
1
vote
0answers
13 views

Need to return a list based on Slug

I need a search field to return only a specific slug when the user types it. Basically, I need to create pages for students and each student page will be displayed only when user types the page slug ...
1
vote
0answers
22 views

force permalink slug for page vs post_type slug parent

I have setup permalink for post_type "directory" with this slug domain.com/directory/company-name now when I try create page with domain.com/directory is detect as parent of post_type "directory" ...
0
votes
0answers
13 views

Removed slug from custom post type URLs page template issues

I use this function Remove slug from custom post type post URLs to remove slug from custom post type URLs .. but now I have issues... page.php is not working ... so now my pages with default template ...
0
votes
1answer
41 views

List taxonomy term slugs within shortcode (do_shortcode)

I'd like to list the taxonomy terms within my shortcode. This is how I get the list of terms (separated by commas): <?php $terms = get_the_terms( $post->ID , array( 'shoptype' ) ); ...
2
votes
1answer
180 views

Post slug changed using code doesn't reflect on editor when post is published

I've a CPT (lets say Event) with a custom date field (start_date). I'm trying to generate the post slug (post_name) as start_date + post_title (separated by -). I've tried using the filter ...
1
vote
1answer
47 views

WP_Query tax query part of slug

I have problem with filtering post with tax query. I have a custom taxonomy called 'actors' and example of the slug is 'david-hasselhoff'. The problem is the post is found when I search with 'david ...
1
vote
0answers
18 views

Index page with the same id as the slug

I have wanted to ask this for a long time.. I have never worked out how to do this, is it possible? mywebsite.com/pots - This to be an index page showing posts or custom posts mywebsite....
0
votes
1answer
68 views

Replace image name on upload to the new post name on front-end form

I'm using this form to replace featured images and post title on my frontend form: <form id="featured_upload" name="featured_upload" method="post" action="#" enctype="multipart/form-data"> <...
0
votes
1answer
25 views

Edit the post title from the frontend

I have this form that allows-me to change some things of the current post in my frontend: <form id="featured_upload" name="featured_upload" method="post" action="#" enctype="multipart/form-data"&...
1
vote
2answers
40 views

Wrong generated page_name/slug on first publish of custom post type

I have set up a custom post type (CPT) with the support for editor removed: register_post_type( 'review', array( 'label' => 'Reviews', 'labels' => array( 'name' => 'Reviews', ...
0
votes
0answers
59 views

Two Custom Post Types in Permalink + Duplicate Slugs Issue

I'm having some trouble with WP adding those numbers onto the end of my slugs if it thinks it's a duplicate slug. The issue, though, is that it's not actually a fully duplicate URL, since I include a ...
0
votes
1answer
78 views

How can i edit all posts slug in bulk keeping WP native redirect?

When i edit a single post slug the old url redirects to the new one automatically. I need to do this in bulk. There is a text that appears on thousands of permalinks and i want to remove it from ...
0
votes
0answers
52 views

Include a page's “category” in its URL

My site is for landing pages, not a blog - so it contains pages, not posts. I want URLs like this: https://www.example.com/shoes/nike-sport-super-red https://www.example.com/shoes/adidas-...
0
votes
0answers
16 views

How to quickly fix duplicated term slugs in hierarchical taxonomies?

my problem is that I've imported in wordpress some hundreds of terms of a custom taxonomy, from another system, in 5 languages. I've found out those terms have sometimes duplicated slugs, and they're ...
0
votes
0answers
22 views

Special Characters Url return to 404

I've managed to have permalinks with "@" (at sign) for my page with the help of @Andy's code on How to add dot(“.”) in post slug. But unfortunately, after creating post with @ on the url (example....
0
votes
0answers
17 views

Remove author (user) slug (permalink base) for a Multisite

I have a Multisite Wordpress installation in which I want to change the structure of user permalinks by removing the base "/user/" Current: domain.com/user/unsername I want: domain.com/username I ...
0
votes
1answer
57 views

Keep subcategory grandson in slug

I have the categories and subcategories father, son, grandson: -father --son ---grandson When creating an post and mark it only in the grandson category, the correct slug is generated: www.example....
0
votes
0answers
29 views

Allow duplicate slugs for pages and posts

My use case is: I have a two pages, they each have a meta information "language". Posts and pages having same language cannot have the same slug, but with different slugs it is totally fine. Currently ...
0
votes
0answers
71 views

Yoast SEO breadcrumbs: how to create a filter that uses the url slug for breadcrumb titles

I know we can manually edit the breadcrumb title for a page or post using Yoast SEO's breadcrumb functionality. But with thousands of posts and pages on an existing site this isn't desirable. My ...
1
vote
0answers
53 views

Is there an equivalent of the PHP function sanitize_key in Gutenberg?

In WordPress's PHP library there is a function sanitize_key used to generate database keys and HTML IDs. I'd like to generate a slug from a title that can be used as an HTML ID, from within a ...
0
votes
0answers
27 views

get_queried_object_id combined with wp_redirect gets wrong id

I have the following snippet of code that I am experimenting to restrict access to certain wordpress pages through a plugin. It works... almost. The browser is redirected to the login page, but the ...
0
votes
1answer
18 views

Multiple Custom Taxonomy Rewrite

I have registered two custom taxonomies of 'location' and 'type' registered before my post type of 'chalet' and have the rewrite rules set to 'slug' => 'chalets/%location%' 'slug' => 'chalets/%...
0
votes
0answers
23 views

Important : This theme text domain does not match the theme's slug

My text domain is same as my theme name and theme folder also but still getting this error in theme checker : REQUIRED: This theme text domain does not match the theme's slug. The text domain ...
0
votes
0answers
62 views

How to allow dot(.) in slug for custom pages

For this question, I googled and found 2 results. But what I want to do is allow dots in slugs for some pages only. I found results are showing to add a function to function.php file. But it will ...
0
votes
2answers
146 views

How to define the slug for my custom plugin?

I have created a custom plugin. How do I define its slug? To clarify, if I attach a custom PHP function to the manage_plugins_custom_column hook, and in that function print the value of the $...
0
votes
0answers
24 views

Hide certain product categories from specific pages

I'm trying to hide certain product categories on specific product category pages on my woocommerce shop page. And I found this code to help me: add_filter( 'get_terms', 'get_subcategory_terms', 10, 3 ...
1
vote
0answers
71 views

The default code for “posts_nav_link” on category.php isn't working

I am trying to make my own simple WP theme from scratch and I have run in to some difficulties. Maybe someone can help. I have a category named "News", whose slug is "news". The permalink structure ...
1
vote
1answer
41 views

How can I make the slug of the taxonomy also the slug of the custom post

I have a custom post type and I need to change the slug to match the category. The same as if in the permalink of the blog posts I associated the category with %category%, but in the custom post with ...
0
votes
1answer
20 views

Hide a specific category title from displaying on site

I have a website that uses the theme Bodega and uses portfolio categories. Right now I have a page like this: http://185.56.86.90/~onetoncr/manitoulifeandhome.com/property-services/. And it displays ...
0
votes
0answers
7 views

Auto Slug Generation for Custom Post type based on related post

I have created a custom post type (proof) that don't have any title. But it has a related post (another custom post type => review). Now how to generate slug for "proof" based on related "review"? ...
1
vote
1answer
22 views

How to edit URL Slug?

Some of my blog post slugs show abnormal characters within the edit post screen (ie. 3%e2%80%8b-%e2%80%8bperks%e2%80%8b-%e2%80%8bof%e2%80%8b-%e2%80%8bsmartphone-based%e2%80%8b-%e2%80%8belds) but shows ...
0
votes
0answers
17 views

Custom Post type slug

Is it possible to structure my CPT for using it in the url slug? E.g CPT: menupage CPT2: categorypage I will need something like this www.domain.com/menupage/categorypage
0
votes
1answer
146 views

{Check Theme Plugin} text domain does not match the theme's slug

I have these two issues: 1: WARNING: Your theme appears to be in the wrong directory for the theme name. The directory name must match the slug of the theme. 2: REQUIRED: The  <title> ...
0
votes
0answers
21 views

home page slug editor missing from WordPress

the website that I am working has been developed by a web designing company. i see that they disabled the home page slug editor but the rest of the pages has the edit option. Now I am trying to add a ...
0
votes
1answer
79 views

Rename a slug label

In my custom post type there is a custom taxonomy that has the usual Title, Slug and Description fields. I'm expecting the end user to not understand what the slug is for, and in my case it needs to ...

1
2 3 4 5
13