Articles of permalinks

Rewrite Page with a slug before page name

I am using $wp_rewrite->non_wp_rules I have the following code that works: ‘name/(.*)’ => ‘index.php?post_type=post’; Im able to use a url like using $wp_rewrite->non_wp_rules, how can I make pages work the same way. This is just an example: ‘anothername/(.*)’ => ‘index.php?post_type=page’; //for all pages ‘anothername/(.*)’ => ‘page/pagename’ //for one specific page Is there a way […]

Permalink settings not saving

I just started a new WP installation and my permalink settings are not saving. I have chosen the ‘Month and name’ option (/2014/06/sample-post/), but when I create a new post, the text shows up as /2014/06/sample-post/, but the link goes to the default ?p=x. When I go to /2014/06/sample-post/ with the correct information for the […]

Remove index.php in permalink structure on IIS server

In permalinks(dashboard) section index.php added. e.g. Current Post Name: Expected Post Name: How can i remove index.php? Note: I am using windows server

WordPress Custom Post Type is Matching on Partial Slug

I’m having a really weird issue. For example, there is a custom post ‘people’. The post title is the name of the person and pretty permalinks are enabled. Say we have a person custom post with the name of ‘John Smith’ with a slug of ‘john-smith’. If I visit the URL, it still redirects […]

How to achieve a clean custom permalink solution?

I am working on the design of a blog with the below(just a sample) category hierarchy. PARENT | |————————————————| Food Fashion | | |———————| |———————| European Asian European Asian | | | | |———| |———–| |——–| |——–| Italian French Chinese Japanese Italian French Chinese Japanese The client will blog on Food and Fashion with posts […]

Custom Post Type relationship with hierarchical parent and child permalinks

Trying to get my permalink and url structures to behave nicely. I have a Custom Post Type called Diseases. This post type is hierarchical with parent and child relationships. I have another CPT called Content, and I’m using ACF relationships to connect these posts with Diseases. Functionally this all works fine, I can even rewrite […]

How is WordPress manipulating the posts like there are folders?

As you know, a WordPress post can usually be seen going to a link similar to this: There is no folder named 2014, 03, 27 or sample-post in the blog. Until now, I used something like this: page.php?post_id=55. How is WordPress and other sites (I think StackExchange sites do this too) doing this?

Add 'articles' prefix before blog posts url without affecting pagination

I tried this solution for adding ‘articles’ prefix before blog posts on URL. function filter_post_link($permalink, $post) { if ($post->post_type != ‘post’) return $permalink; return ‘articles’.$permalink; } add_filter(‘pre_post_link’, ‘filter_post_link’, 10, 2); function add_blog_rewrites( $wp_rewrite ) { $wp_rewrite->rules = array( ‘articles/([^/]+)/?$’ => ‘index.php?name=$matches[1]’, ‘articles/[^/]+/attachment/([^/]+)/?$’ => ‘index.php?attachment=$matches[1]’, ‘articles/[^/]+/attachment/([^/]+)/trackback/?$’ => ‘index.php?attachment=$matches[1]&tb=1’, ‘articles/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$’ => ‘index.php?attachment=$matches[1]&feed=$matches[2]’, ‘articles/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$’ => ‘index.php?attachment=$matches[1]&feed=$matches[2]’, ‘articles/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$’ => […]

generate custom permalink based on a custom field

I’m newbie to the WordPress. So far I have a custom post type called ‘property’. This post type has one custom field called ‘property_city’. In WP-admin – permalink setting, I have selected Post name option. So, posts of this custom post type have URLs like: http://xxx.local/properties/edge-apartments/ http://xxx.local/properties/northgate-point/ What I want to have those URL to […]

How can I make my .htaccess file writeable by wp-admin?

My ISP changed the hosting for my WordPress blog and everything stopped working. There was a DNS issue but they resolved that, but then every page apart from the home page returned a 404 error. When I checked the permalinks page (/wp-admin/options-permalinks.php) in wp-admin I saw the following: If your .htaccess file were writable, we […]