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

learn more… | top users | synonyms

0
votes
2answers
965 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
2answers
402 views

Is using %postname% for permalinks really that bad for performance?

I've seen in various places, including the Wordpress admin and on this page, that using string based identifiers is "strongly not recommended for performance reasons". I understand that looking up a ...
1
vote
1answer
777 views

Change the Slug of Post Type post to baseurl/post/%postname%

I have been searching around but i cant anywhere find the answer to my question: How to change the post slug for all posts (and the categories etc.). Without affecting other pages/ custom post urls. ...
1
vote
1answer
211 views

How to create a custom CSS class for a specific page template?

I created a page in called "mypage". Then I created a custom template page called "page_mypage.php". Now, I just wanted to create some custom CSS classes in style.css. I tried with: ...
0
votes
1answer
90 views

Pagination posts. Url format

i'm using pagination for very long posts. So i have a problem here. I'm not happy with standard utl structure (where is couple personal reasons for that in my project). For example, i have post ...
1
vote
2answers
8k 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
82 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
145 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
909 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
1answer
46 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 ...
-1
votes
1answer
54 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
1answer
188 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' )); ...
1
vote
1answer
451 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 ...
0
votes
2answers
446 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 ...
2
votes
1answer
146 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
156 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
226 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
3answers
1k 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
98 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
4k 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 ...
4
votes
1answer
158 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 ...
4
votes
1answer
12k 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?
1
vote
1answer
2k 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
1k 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
97 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 ...
0
votes
1answer
89 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/ ...
1
vote
0answers
299 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 ...
3
votes
2answers
970 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
357 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
280 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
50 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
1answer
632 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 ...
1
vote
1answer
884 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 ...
1
vote
0answers
332 views

Custom Post Type - Duplicate Page Slugs

I have 2 custom post type registered in my functions file, sectors and projects. There are pages with the same name and hence URL in both post type. My problem is that WordPress wont allow the same ...
1
vote
2answers
1k views

Custom Permalink with Dynamic Taxonomy for Custom Post Type - Works, but breaks other permalinks

My custom permalink with dynamic taxonomy is working for my custom post type. However, it breaks all my other permalinks. They display a 404 error in the content area (header and sidebar still ...
2
votes
3answers
2k views

How to create non-unique sub-category slugs?

What’s the best way to make Wordpress accept non-unique sub-category slugs? By default, Wordpress ensures that every ‘slug’ portion of permalink URLs is unique, and is very savvy about using this to ...
0
votes
2answers
172 views

Wordpress custom post type with folder structure in slug

I have setup a custom post type with the slug "interview" and it is working fine. I am trying to change the slug to "magazine/interview" but I keep getting 404 errors when I try to access the posts ...
3
votes
1answer
915 views

Is It A Good Idea To Change Author Slug (user_nicename field) Directly In MySQL DB?

Searching for a how-to on changing author slug, I found two methods: Change the user_nicename field in the MySQL database of your WordPress site to whatever you want the slug to be. Changing the ...
0
votes
1answer
82 views

How to include stylesheet in custom admin using parent_slug

Using this code from codex: function my_enqueue($hook) { if( 'edit.php' != $hook ) return; wp_enqueue_script( 'my_custom_script', plugins_url('/myscript.js', __FILE__) ); } add_action( ...
-1
votes
1answer
403 views

WordPress v3.1 Has Character Encoding Issue With Title/Permalink?

I was on the latest v3.0.x series and had no issues. Once I upgraded to WP v3.1, I am having a strange issue with character encoding in permalinks. If my title was "I have $50 today" in WP 3.0.x, the ...
1
vote
2answers
38 views

How do I link to a blog not set as the homepage?

I have a blog here /www.mysite.com/section/news/ that only shows news in a specific category. When I use wp_get_recent_posts() and get_permalink($recent["ID"]) the link goes here ...
0
votes
2answers
276 views

Select query with two and two related taxonomies

is this possible for 2 taxonomy and 2 terms $querystr = " SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) ...
1
vote
2answers
3k views

How does WordPress generate URL slugs?

Is there a page somewhere that details exactly how WordPress generates slugs for URLs? I'm writing a script that needs to generate URL slugs identical to the ones WordPress generates.
2
votes
2answers
3k views

Removing the number in a category slug

I have a category that ends with -2, and there's no way I can change it back to the plain word. I know there are problems with numeric slugs, but this is just a word. I also know that a common answer ...
4
votes
1answer
414 views

Display posts with author in the url with custom post types

I'm having a really difficult time with this. I have a multi-user gallery site. Each author has his own page that lists the author's posts (this is a custom post type). I have made it so that the ...
1
vote
1answer
2k views

WP query by custom post type slug/name

I am running a simple wp query to retrieve just one post. But the post is a custom post-type post, not a normal post $ajaxBike = $_GET['varbike']; $bikeProfile = new WP_Query(array( 'name' ...
5
votes
4answers
136 views

Post type child of another post type

This may be a stupid question but is it possible to have a post type child of another post type? Let me explain with an example: I created 2 post types, "Actors" and "Galleries". What i want is to ...
0
votes
2answers
108 views

list child pages as slug

I have a section on my site that needs a list of pages that are descendents of a particular ID. I need them listed on the child and grandchildren pages. But the page titles are too long, so I need to ...
1
vote
1answer
394 views

Force unique page slugs across all post types

I have a site with many custom post types and I need a unique slug for each page. What I'm seeing is that wordpress only checks for slug conflicts within a post type before appending "-2", "-3". So ...
4
votes
1answer
281 views

Dynamic taxonomy in permalink made all other posts NOT FOUND?

I added my taxonomies in the permalink instead of the Custom Post Type's slug, and it works fine. I'd even say everything was working fine but changing the WP installation to Multisite broke all other ...