Articles of permalinks

Default category link for a custom category is a broken link

I’m developing a Multisute plugin that is supposed to setup sites using a specific template, including setting up several static pages and menu items, as well as a “Blog” category for blog posts. The category is created fine, and has one post in it, and I’ve figured out how to setup the menu link to […]

Can't change permalink url after hitting 'ok' and 'update'

I am trying to change some of the titles of my posts and their respective permalinks. After I edit the title and permalink and click ‘ok’, the permalink appears to have changed temporarily. However, when I click ‘update’, the permalink changes back to what it was originally. Is there anything that may be preventing the […]

Is there a log for the ajax calls made when changing a post's slug?

When changing the slug for a page (clicking OK) an ajax call is made to check if the slug is available and to generate a different one if not. Does anyone know if there is any logging for this, or any way to investigate what’s happening? Even knowing where the source is for this process […]

wp_publish_post breaks permalinks

I’m creating a system, where some custom post drafts are being prepared, and after certain actions taken by moderators it is being automatically published. So, first I create post draft like that: $newpost = array( ‘post_title’ => ‘Raport ‘.date(“Y-m-d”), ‘post_content’ => ‘Add your content here’, ‘post_type’ => ‘raport’, ‘post_status’ => ‘draft’, ‘post_author’ => $userid ); […]

How to enable hierarchical permalinks for hierarchical taxonomies

If you have a category called “term” and a subcategory called “subterm”, your can access subterm posts at /cat/subcat. But this doesn’t work out of the box with custom taxonomies. They are accessible at /taxonomy/subterm, but not /taxonomy/term/subterm. They’ve gone over this in the WordPress Trac (http://core.trac.wordpress.org/ticket/12659), and it kind of looks like they have […]

How to get url of a post from admin panel

I want to get post url from the back end edit post page, the edit post url is : www.ddd.com/wp-admin/post.php?post=1&action=edit the real post is: www.ddd.com/wp/?p=1 since the user can edit permalink, i need some wordpress parametrs so it will be constant. Looking for this answer: global $post; get_permalink($post->ID); thx all

Combine Multiple Categories Into One URL Slug

I have a WordPress website with 20+ categories. To make it easier to navigate I want to decrease the categories, but at the same time keep the original categories. In other words I want to be able to query multiple categories with a category group or a virtual slug. Example categories: /category/apples/ /category/pears/ /category/bananas/ I […]

How to remove /blog/ prefix for custom post types in permalinks?

I have a client that used to have a static website and a blog powered from WordPress under the /blog subdirectory. Now he decided to move everything into WordPress so that he can also create and edit pages easily. However because the website is getting a lot of traffic and he already has likes, tweets […]

Function to get permalink of custom post type archives?

Is there a function that will return the permalink to a custom post types archives that is available to use in WordPress? Something like: get_cpt_permalink(“events”) which will return http://example.com/events/ when has_archive => true on it. If not what would I need to home brew my own? I’m thinking I would need to read $wp_rewrite and […]

WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I’ve encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ealized that WordPress was actually pointing to index.php template file rather than page.php in my theme for generating the page appearance. […]