The slug tag has no wiki summary.
0
votes
1answer
137 views
Set a custom post type's title and slug to match the current date
I have seen similar questions asked, but mine is a little different. I want to register a post type called 'minutes' that doesn't allow you to add a title or a slug, but when you publish (or autosave) ...
-1
votes
1answer
332 views
Convert post name into post ID
I am trying to create a function for my functions.php file that will allow me to convert a post name into a post id. I have had a look around online and managed to find this link ...
0
votes
2answers
29 views
how to get page id of a page using page slug
Im pretty new to wordpress and I was wondering if I could get a page id with it's slug. Is it possible please let me know.
3
votes
1answer
52 views
Determining Slug Before and After Edit
If I were to edit a post or a page, how would I determine what the slug was before the edit, and again afterwards to compare them and see if it was changed? Also, would the same method work for any ...
0
votes
1answer
13 views
How to remove certain words from url slug
Trying to create a SEO plugin, that will remove stop words from slugs.
This is how to explode the $slug into a list, and explode the variable containing the stop words :
add_filter ('sanitize ...
1
vote
0answers
79 views
Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
this is my situation:
I have a Custom Post Type named struttura (like accommodation):
function custom_post_struttura() {
$labels = array(
'name' => _x( 'Strutture', ...
0
votes
2answers
178 views
Custom post types archive redirect
I had a custom post type with slug as (sometext) which I changed to (someothertext)
And it works great
So for example :
my posts with urls like
http://localhost/sometext/innerposts
gets ...
1
vote
1answer
249 views
Using Custom Fields in Custom Post Type URL
I'm developing a car site that has showrooms. Each showroom needs it's own custom URL based on it's location. The location (City and County/State) is already inserted as two custom fields. So for ...
0
votes
1answer
30 views
Show page without reference to post (like front-page)
I created a plugin that adds a new post-type awards. Each award has multiple votes attached, which are stored in a custom table, created by the plugin.
Now I need to show two different ...
2
votes
1answer
538 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:
...
0
votes
2answers
121 views
custom page url slug needs illegal ?id=1 for javascript
I have created portfolio page which contains a image-slid-menu for navigation. For an menu item to appear as open, javascript gets instruction like ?id=0 appended to the url. for instance ...
1
vote
1answer
122 views
Rewrite post type slug only for child theme
I'm in multisite where some blogs share the same parent theme for maintenance reasons. All my cpts come from that parent theme, but I would really like that, for one of the blogs, it had an URL mask.
...
0
votes
1answer
118 views
Using Same Slug With Multiple Post Types
My Permalinks are the std %postname%. I have several custom post types, eg. 'docs'.
function docs_init() {
// create a new taxonomy
register_taxonomy(
'docs_tax',
'docs',
array(
'label' => __( ...
0
votes
1answer
333 views
Pagination for category slug returns 404 when page >= 2
I have a custom type and the slug is:
'rewrite' => array('slug' => 'blog/%blogs_tax%'),
And after register_post_type() I have a function to rewrite the slug variable.
I works fine, but I ...
0
votes
1answer
400 views
List child pages by slug not ID?
I am looking to use the wp_list_pages function to show children pages of a specific page ID. I was able to do this easily, but now I found an issue with it. I am running a Wordpress network of sites ...
2
votes
1answer
139 views
Custom Post Type - Same Post Name, Different Post Type
I have 4 Custom Post Types:
Services
FAQs
Prices
Before and After
I want to be able to have the same post names within each of these post types, example:
Services
Skin ...
0
votes
1answer
369 views
How to prevent duplicate slugs for wp_insert_post?
I have a function that creates a page when I create a post (so as to construct parent-child relationship trees).
I'm using the $title of the post to create the page and this also creates a duplicate ...
0
votes
1answer
350 views
Get menu item slug
I use custom menus and I’d like to get the menu item slugs.
Is that possible?
// Get the nav menu based on $menu_name (same as 'theme_location' or 'menu' arg to wp_nav_menu)
// This code based on ...
-1
votes
1answer
23 views
Echo author slug in post edit page
On the Post edit page in the back-end, how do I echo the author's user_nicename? I am referring to the author of the post, not current user.
0
votes
0answers
24 views
Add a prefix term in a custom taxonomy slug
I am looking to rename the slug of a custom taxonomy when inserting a new term, adding to the default slug a prefix.
For example, if the term name is "something" I want the slug is "prefix-something" ...
0
votes
1answer
66 views
How to get or know the slug of home.php
I found this code from Different Main Navigation per category:
<?php
if(is_category('first-category') || in_category('first-category)) {
wp_nav_menu( array('menu' => 'First Category Nav' )); ...
0
votes
1answer
49 views
Changing taxonomy term by slug (wp_update_term)
What I am trying to accomplish is to update a taxonomy term name using its slug rather than the $term_id
Wordpress does this by:
<?php wp_update_term( $term_id, $taxonomy, $args ) ?>
Is it ...
5
votes
2answers
2k views
Wordpress slug issue with non-latin characters
I'm using permalinks in WP as: domain.com/category/post_name
The issue is that post names have non-latin characters such as chinese, hebrew, and arabic. So it encodes them to something like: ...
0
votes
2answers
81 views
How to copy post titles to post slug in phpmyadmin
I just imported 1000 post into a custom post type on a site and the slugs are all blank. There is a problem with the importing plugin i'm using. My SQL is weak :-/ know what i need to do but not sure ...
0
votes
1answer
63 views
Use the category name instead of category slug in permalinks
How to create a permalink structure which finish by:
/category-name/post-name/
Instead of:
/category-slug/post-name/
By default, Wordpress is offering %category% tag strucure as "A sanitized ...
2
votes
1answer
113 views
Using custom post type parent as slug
I'm currently using the plugin 'Types Custom Post Type' to create custom post types (I know it's pretty easily done through functions.php but I was feeling a bit lazy!).
Basically, I'm looking to ...
1
vote
1answer
32 views
Wordpress plugin for nicer looking slugs? Have multiple pages named the same but they get different slugs
This wordpress site I'm touching up has a page hierarchy which is responsible for the urls.
Basically the urls look like page1/subpage/subsubpage etc.
The problem is, this site is for a recurring ...
3
votes
2answers
85 views
How to modify author base slug with groups and slug to use nice_nickname?
After reading the following suggestions from Jan Fabry regarding URL rewrite and the author slug I took the challenge in combining both solution in one.
Change author base slug for different roles
...
2
votes
2answers
734 views
How to check if a slug exists?
I have a arbitrary string and want to check if a post with that slug string exists in the site. I tried to find a way to list all slugs, but can't find such a thing. Thanks
2
votes
3answers
723 views
Taxonomy archive with same slug as custom post type?
My head hurts...
Here is what I have:
Custom post type: Our People, slug => our-peopleTaxonomy: Job Title, slug => job-title
I have an archive page for the Our People CPT at domain.com/our-people.
...
4
votes
1answer
42 views
How to i18n slugs for templates?
some templates are chosen from WordPress based on slugs (e.g. category-{slug}.php).
Problem:
How can I use the same template for an i18n'ed slug?
Example:
I have a category-news.php and an english ...
5
votes
1answer
3k views
Rename files during upload using variables
I'd like to rename files during upload and set their names to the post slug the files are being attached to, plus some random characters (a simple incremental counter will de just fine) to make the ...
0
votes
0answers
43 views
No results for my WP_Query array
I have to get related posts via keywords/tags, and I found a ton of examples elsewhere on how to do it, but the query doesn't seem to produce any results. Can anyone point out how to do this, and is ...
4
votes
1answer
52 views
When creating a WordPress page, a “-2” suffix is added to new pages' permalinks
I have noticed after deleting an original page in WordPress with lets say a permalink of your_domain.com/contact/ and then trying to recreate the same page with the same name/slug, my WP is generating ...
0
votes
0answers
68 views
Filter BuddyPress Member Domain Slug
BuddyPress uses the Username(login name) as the member domain slug. (mysite.com/members/sarah)
I would like to filter the way BuddyPress handles this and set it to use the Nickname(nicename) instead.
...
4
votes
1answer
5k views
How to get a taxonomy term name by the slug?
If I know a taxonomy term slug, how can I get that term's name?
0
votes
1answer
51 views
disable permalink on custom post type
I have created a custom post type, but I do not want it to have a permalink. By default, after entering post title, it creates a perma link. I do not them to be generated.
From my reading, it is said ...
2
votes
4answers
733 views
WordPress 3.1 removing 'category' from the slug
Is there a way to remove 'category' from the slug when viewing posts in a particular category in WordPress 3.1 without it breaking? My client is asking me to remove it, but it seems necessary - I get ...
1
vote
1answer
55 views
How do I attach a php file to an arbitrary slug and still have access to the wp-core functions?
Based on an example found here and several others, I am trying to load a non wordpress page from a specific URL while having access to the wordpress core.
I have the following code (which seems to ...
-1
votes
1answer
43 views
Two Custom Post Types with Identical Articles Competing for the same Slug
I have created two custom post types, each with it's own slug. Each custom post type contains some articles with the same title.
So ideally I would have . .
customposttype1/mainarticle/
...
7
votes
1answer
1k views
Redeclare/Change Slug of a Plugin's Custom Post Type
Is it possible to redeclare/change the slug of a plugin's existing custom post type (without simply editing the plugin)?
That is, if Plugin X creates a custom post type with the slug /uncookedtoast/, ...
1
vote
0answers
143 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 ...
2
votes
2answers
182 views
how to automatically generate random slug
I have tried to create a function that generate a random slug when a post is created. I am a bit worried that the function generates non unique strings as slugs. How can I solve this?
The function ...
0
votes
1answer
104 views
Don't change Custom Post Type slug to unique value
I have a situation where it is needed that if I create two CPT pages wich both have the same name and the same slug.
For example, if I add two CPT pages, wich both called "Post Name":
The first slug ...
0
votes
2answers
96 views
How to get postname in custom page?
I'm adding custom pages in WordPress and trying to handle WordPress with my own CMS.
I'm using all WordPress' hooks to manage all these things. Now, I can make a custom post saying "a new album" but ...
0
votes
1answer
36 views
Ideal top-level slug methods
Right now I have a post type that generates a slug, e.g. http://url.com/l/abcd/ for each entry. I have a query in my 404.php that checks for http://url.com/abcd before output and redirects it if found ...
0
votes
2answers
216 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', ...
-1
votes
1answer
212 views
How to create drop down for child categories of current taxonomy being viewed?
I need to know how can I get the child/grandchild terms of the current taxonomy being viewed, and put it into a drop down so that I can add values to the options.
I am currently using this code to ...
2
votes
0answers
76 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
1answer
315 views
Change slug with custom field
I want to change the slug of a post with a custom field.
In example, if the custom field is "keyword" my post link will become: mysite.com/keyword.
If the custom field is empty, i want to generate a ...



