Tagged Questions

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

-2
votes
1answer
63 views

Plugin remove-slug-from-custom-post-type very slow

I have installed the remove-slug-from-custom-post-type plugin but the whole website is very slow. Does someone has also this experience and the solution? Thanks! Not a good question?!
1
vote
2answers
589 views

Prevent page slug from interfering with custom post type archive permalink?

In my plugin, I'm creating a custom post type that has an archive and uses the rewrite parameter to choose a slug: $args = array ( 'public' => true, 'has_archive' => true, 'rewrite' ...
0
votes
1answer
286 views

Echo custom taxonomy slug

I feel like I'm this close but can't figure out if it's a synax or variable thing. I'm tring to echo the slug to auto-populate the corresponding image. <?php $terms = get_the_terms( ...
0
votes
0answers
91 views

Remove blog slug from WPMU?

i have wordpress MU, everything is fine in child sites , but in the main site in the permalink structure have been changed itself , mean that after the site url it have like http://example.com/blog , ...
0
votes
1answer
71 views

Display Taxonomy Terms in an option tag with value being the slug

I have a custom taxonomy filled with terms that I wish to display in a fashion such as below. <option value="[SLUG]">[TERM]</option> <option value="[SLUG]">[TERM]</option> ...
2
votes
1answer
104 views

Put a link to a category round a hard coded A HREF

In my footer I have hard coded the links and would like to link some to there category, I could just copy the full URL to it and paste in the href="" but I would rather call it using php. My ...
0
votes
1answer
143 views

get_category only returning details for 'uncategorized'

I'm using the ACF Taxonomy field add-on to select a category and (hopefully) return details for that category, e.g. slug, title etc. The custom field get_field('category_test') returns the category ...
0
votes
1answer
196 views

Return category slug / title from category ID

I have a custom field set up that returns the category ID of a chosen category, I'm looking to use this category ID to show, in one instance: category slug, and another instance: category title. The ...
1
vote
1answer
733 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. ...
0
votes
1answer
88 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 ...
0
votes
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
80 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
139 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 ...
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
vote
0answers
900 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', ...
-1
votes
1answer
52 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.
1
vote
1answer
418 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
409 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
2answers
234 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 ...
3
votes
2answers
217 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 ...
1
vote
1answer
148 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 ...
4
votes
1answer
94 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 ...
0
votes
1answer
185 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' )); ...
4
votes
1answer
152 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 ...
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 ...
1
vote
1answer
96 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
290 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 ...
0
votes
1answer
346 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
275 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
2answers
186 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 ...
0
votes
3answers
2k 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', ...
3
votes
1answer
316 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 ...
0
votes
2answers
927 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
0answers
323 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 ...
0
votes
2answers
2k 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 ...
0
votes
2answers
170 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 ...
0
votes
1answer
81 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( ...
0
votes
1answer
623 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
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
1answer
304 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
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.
3
votes
2answers
901 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 ...
3
votes
1answer
422 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 ...
1
vote
1answer
1k 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' ...
4
votes
1answer
399 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 ...
0
votes
2answers
105 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
380 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 ...
1
vote
1answer
390 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' => __( ...