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
1answer
64 views

Show post by slug sanitize_title

They help me as is the right way to do this. $query = new WP_Query( array( 'post_type' => 'spa', 'name' => 'echo sanitize_title(news_get_meta('gamers'));' ) );
1
vote
1answer
649 views

Append date to custom post type url slug

I have a sports website that will have very similar slugs: http://example.com/match/teamA-vs-teamB Sooner than later, teams A and B will play again, and the slugs will repeat themselves: http://...
0
votes
1answer
643 views

Get term slug by term id and then explode it

I have two product categories for my woocommerce product: "grade-11" "grade-12" I'm trying to extract the numbers alone and output them in a div. So I only need "11" or "12". Here's part of the ...
1
vote
0answers
109 views

Mod_Rewrite to show only last subcategory in URL

I have a website with a three-tier hierarchy of categories: Main category> Subcategory> Second Level Subcategory. In the URL I would like to get only the currently selected category displayed. ...
1
vote
0answers
240 views

WordPress Menu Walker: add #hashes to child page links (only)

A WordPress project consists of normal first-level pages and some pages that have children. Instead of having single child pages, there is a template for any page that has children that pulls the ...
1
vote
1answer
481 views

Load a template page based on part of slug in wordpress

How can I load a particular template based on part of a slug ? Say I have 3 urls that I want to load the same template for so I want to match based on the 'advice-on' Please note I don't want a ...
0
votes
1answer
98 views

Cannot use old slug - it just 301s to site home page

Thanks in advance for any help guys, For some reason my three pages stopped working, they just 301 to the home page. I think it may of been due to installing a plugin but I am not entirely sure. I ...
0
votes
1answer
292 views

Auto Slug Generation for Custom Post type

Is there any way to generate slug for custom post type in alphabetical order or use first few words from the content of the post? This is because I have created a custom post type that does not have ...
0
votes
0answers
23 views

Plugins and how to assign urls to content

I'm Building a plugin for wordpress. It has a few custom tables for the content. A displays table contains the main content with title, description and a few other fields for content related to the ...
0
votes
1answer
86 views

Possible to create a new post and have the Title and Slug automatically use the post's ID?

For a given Custom Post Type, I'd like that every time I create a new post (by using the Dashboard, clicking the button "Add new"), that the slug and Title assume this post's ID. I belive that the ID ...
3
votes
2answers
3k views

How to Remove Slug From Database?

For example: mydomain.com/embed automatically redirecting to homepage although I haven't set redirection. I want to add a page in my website name embed and for this page URL automatically becoming ...
0
votes
1answer
1k views

Custom Taxonomy leads to 404 page

Followings are the codes I added in my theme function.php file // Taxonomy Resource $labels = array( 'name' => 'Resources', 'singular_name' => 'Resource', '...
3
votes
1answer
246 views

Add warning to edit slug/permalink button on editor screen.

I want users to get a warning popup when they click the button to change the permalink. They will give confirmation if they want to continue. Here is what I've come up with: //Setting a variable for ...
1
vote
2answers
81 views

Categories vs. Page Site Organization

I need to organize the pages on my website so that they appear with the proper hierarchy. The problem is that the category-derived page is appearing outside my hierarchy. This is the current ...
0
votes
0answers
15 views

If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?

My company is restructuring our sitemap and one of the changes was moving the posts page. Original Slug: .com/about/news-articles/ New Slug: .com/news-articles/ I did that in our staging ...
0
votes
1answer
727 views

How can I get the page url slug when 'post_name' returns an id?

I have the following code: $menu = get_term( $locations[$theme_location], 'nav_menu' ); $menu_items = wp_get_nav_menu_items($menu->term_id); foreach( $menu_items as $menu_item ) { $link = $...
1
vote
1answer
5k views

Rewrite rules for custom post type slug

I am lost with rewrite rules and need help please. I created a custom post type "products" with a custom meta "brand". The URL for a product called milk will be mysite.com/products/milk, I need the ...
0
votes
1answer
3k views

Is it possible to create slug on homepage and how?

I'm wondering how can I create a slug on homepage for better SEO. I now have site translated in three different languages but my landing pages are like: mydomain.com mydomain.com/gr/ mydomain.com/bz/ ...
0
votes
1answer
513 views

Changing CPT slug and taxonomy already registered in parent theme

I'm using Read WP (premium) with childthime. This theme have Portfolio CPT (slug: potfolio) declared in functions.php. Each project can be nested in a Department (slug: department). If i want to see ...
0
votes
5answers
1k views

Custom Post Type to replace Woocommerce products - page not found error

I have created a custom post type for "Solutions" which will eventually replace all products that have been added in Woocommerce as I no longer have the need for a shopping cart. So I need to copy ...
0
votes
1answer
1k views

How to change custom post type slug

I'm trying to change the portfolio slug of my site's URL (www.website/portfolio/neleman-cava/) to something else, i.e work I know I can do this through some plugins, but I honestly don't want to ...
0
votes
1answer
178 views

Display a Custom Post Type within another with hierarchically slug

I'm working on a study site in WordPress and I'm using custom post types. The Custom Post Type Course is responsible for creating the courses, displayed in single-courses.php, where the basic ...
-1
votes
1answer
42 views

How to put title slug into content when create a new post?

After finish type the title post from the title field, i want to put the slug automatically inside the content .. can i do this ? ex Title : This is just an example Permalink : example.com/this-is-...
0
votes
1answer
34 views

Is it possible to change slugs' default behaviour?

Say I have a page Foo and I then create another page with the same name. By default, WP will change it's slung to Foo-2. My question then is, would it be possible to change this behaviour so the slug ...
0
votes
3answers
493 views

what to do when a Theme uses a custom post type slug that conflicts with a plugin?

I'm a designer not a developer. A client is using a free 3rd party Wordpress theme, and when The Events Calendar is installed, the default events calendar does not load @ /events. The body tag looks ...
0
votes
1answer
1k views

Why is there /index.php/ in all my links? How do I remove it?

I recently realized that my rss feed is not working, because a plugin was assuming it's under mydomain.com/feed But it isn't. I get an 404 error. I figured out that instead my feed is under ...
1
vote
0answers
30 views

Multiple (two) category postings on the same page.

I want two different post categories to display on one page, different divs. I have a page called list.php which posts all the content from a category using $this->getPostListHtml() I added ...
0
votes
1answer
547 views

How to change parent permalink?

I have a theme with hardcoded permalink structure for some posts. Those posts open with site.com/parent/page structure. I created a filter that replaces the link from "site.com/parent/page" to "...
0
votes
0answers
124 views

how to search wordpress database for slug names [duplicate]

I'm trying to rename one of my pages to 2017 and the slug to 2017 as well. When i click save the slug is renamed to 2017-2. To me this means something else is using this slug, but i'm not sure how ...
1
vote
1answer
207 views

How to have posts have a parent in permalink like site.com/blog/postname

I have a site that I'm working on and I want to have a custom blog page. Unfortunately if I use Settings>Reading to set the blog page it clears out my custom blog page. Since I can't set the blog ...
0
votes
1answer
154 views

Problem to get the link of the default 'post' post type like the orther custom types

I am trying to create a paged mosaic list of posts for each post type (post, custom post types), but I'm having trouble to get the default 'post' post type to work. So in the frontpage, I'm using ...
2
votes
1answer
147 views

how to flush custom author rewrite rule

So, I've created custom AUTHOR url like domain.tld/user-nicename, and i have now links like domain.tld/john-doe. My functions.php is // AUTHOR add_filter('author_rewrite_rules', '...
1
vote
2answers
785 views

Remove slugs of old and unused custom post type

I'm running into an issue that must have something to do with an old custom post type which isn't used anymore in our new custom theme. I can't recall what the old CPT was called but it causes an ...
0
votes
1answer
286 views

How to regenerate slugs for categories and tag converting non-Latin characters?

I imported my Blogger to Wordpress, but all the categories and tags urls are missing letters when there is an accented character. For example, the tag with the name Beyoncé is mysite.com/tags/beyonc ...
0
votes
1answer
671 views

Identical custom taxonomy slugs for same hierarchical children

I have a custom taxonomy (editions) and would like to have a year / month hierarchy in the taxonomy reflected in the URL structure. /editions/2016/december /editions/2017/december /editions/2018/...
2
votes
1answer
109 views

Add Slug Metabox to posts for contributors

I am trying to enable slug Metabox for contributors. Find a code to remove slug Metabox try to change it in way to work around my problem but nothing happens. function add_contributor_post_meta_box() ...
1
vote
1answer
98 views

Changing page URL and connect newsletter to MailChip

I have a page on WordPress (example: abc.wpengine.com/abc) and I want to change it to abc.wpengine.com/xyz. I tried to fix the page inside Pages and Posts, but it was not there. I also went into my ...
0
votes
1answer
305 views

How to display page ids as page slug names?

REF: how to get page id of a page using page slug I checked out the above answers but when I pasted any of the code into my child theme's function php file it didn't change anything. Here is the code ...
0
votes
0answers
343 views

.htaccess not working after page slug change

I used to have a page called /page-title I then changed the page slug to /page-new-title I was under the impression that WordPress automatically set up a 301 re-direct when changing a page slug, but ...
0
votes
2answers
296 views

Different slug taxonomy for two different CPT

I want to use a one taxonomy of two CPT. But I want to have different URL. Like this: city - taxonomy (taxonomy data is used in two CPT) people - CPT car - CPT I want: site.com/people/born/LA ...
0
votes
2answers
651 views

Change slug of Standard wp Post category

I know how to handle it with custom post Types but how can I change my standard wp Post category archiv to move from Domain.com/cat-archive to Domain.com/something/cat-archive inside the function.php?
1
vote
1answer
124 views

Permalink help with default Posts and custom Taxonomy

currently building a custom magazine site and running into some rewrite issues. I'm using the default Posts post type, and have added in a custom Taxonomy for Issues (issue_cats). Everything works ...
0
votes
2answers
266 views

How to add 2 variable rewrite rule?

I want to end up with url structure for galleries like the one below ; http://myurl.com/gallery-name/gallery-item-name as you see there will be two variables. I separated templates like content-...
0
votes
1answer
320 views

Category Name and Slug field need to be the same otherwise it breaks category pages

On our WP install we have Topics pages which pull together any content which has been tagged with that topic. Standard. When we visit the topic admin page and edit the Name field (so it's different ...
0
votes
1answer
284 views

Filtering elements by taxonomy slug

In my theme's article page (single.php) I have the following code filtering a div to be shown only on certain category: <?php $categoria_post = the_category_id($categoria_post); if ($...
2
votes
1answer
3k views

How to add dot(“.”) in post slug

How to add dot(.) in post slugs? In our blog, we are writing about websites and would like to use their exact address as slug like this: ourdomain.com/example1.com But dots are either removed when ...
0
votes
1answer
20 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 ...
1
vote
0answers
673 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/">foo&...
6
votes
3answers
930 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 ...
1
vote
1answer
460 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('wyde_portfolio',...

1 3 4 5 6 7 13