permalinks

Using Dates in Custom post_type Permalinks in Wordpress 3.0

荒凉一梦 提交于 2019-12-04 05:40:31
I'm adding a custom post_type to Wordpress, and would like the permalink structure to look like this: /%post_type%/%year%/%monthnum%/%postname%/ I can't figure out how to add the date tags. Using this code, gives me /my_type/example-post-slug/ : register_post_type( 'customtype', array( ...other options... 'rewrite' => array('slug' => 'my_type'), )); How do I include the dates? You can achieve this with the plugin Custom Post Type Permalinks . Just install the plugin and change the permalink format in the settings. I have found a partial solution which allows for the permalink to be recognized

How to use PathPattern in order to create DeepLink Apps Android?

本秂侑毒 提交于 2019-12-04 03:58:34
问题 I have read documentation about create an deeplink and use app linking service in android studio 3.0. its pretty simple and easy to understand, but I have little bit problem when my URL has no prefix path. example : https://example.com//amp there is no prefix, its directly url pattern. when i use regex ^[a-z0-9]+(?:-[a-z0-9]+)*$ it doesnt works, error shown as The URL doesnt map to any activity when i use only star, like : https://example.com/*/amp its show seem error. i got stuck in this

Different permalink structure for blog posts than pages in Wordpress?

。_饼干妹妹 提交于 2019-12-04 03:56:47
I'd like to have a different permalink structure for posts than for pages on a Wordpress website. For example, a blog post name "This is a nice blog post" would get the permalink : /blog/this-is-a-nice-blog-post where as a page called "Services Offered" would get the permalink : /services-offered I know I should use the %postname% in the permalink structure, but how to add the prefix /blog/ to only those blog posts ? Thanks in advance! Under the permalink settings, you need to use a custom format. To do this, you'll need to take a look at the structure tags available for use. Those can be

Wordpress: How to redirect old links after changing permalink structure?

给你一囗甜甜゛ 提交于 2019-12-04 01:36:55
问题 I have changed my permalink structure in WordPress. Can a plugin help me redirect old links to the new? Thanks! 回答1: Redirection works for this, however for it to automatically detect the permalink changes, you'll probably have to revert the permalinks, install Redirection, and then change to the desired permalinks again. If this isn't adequate, you can add them manually, and it has tools to help you find 404's that you were not aware of. 来源: https://stackoverflow.com/questions/4960948

.htaccess fix for a pretty permalink in PHP?

匆匆过客 提交于 2019-12-03 23:01:43
问题 Maybe I'm going about this in the wrong way, but I have some pages in our homegrown CMS that I want to convert to using pretty permalinks. Currently, their page URLs look this this: http://ourdomain.com/articles/?permalink=blah-blah-blah I want to convert these to: http://ourdomain.com/articles/blah-blah-blah I have a column in the db for permalinks, that when the article is created, automatically converts the title to a permalink. How would I write the rewrite rule to accomplish this? Is

Wordpress is ignoring Unicode Chars in URL

徘徊边缘 提交于 2019-12-03 22:24:11
I am using wordpress with this type of permalink: /%year%/%monthnum%/%postname%/ if I use this type of url: example.com/2010/03/तकनीक it treats this url like this example.com/2010/03/ (By ignoring unicode chars) and displays March 2010 archive list. if I use english url: example.com/2010/03/technology then it works perfectly. This problem occurs even on tags page: for example example.com/tag/इंटरनेट is treated like example.com/tag/ and displays 404 page. Why wordpress is ignoring unicode chars? If I use default querystring structure then it works perfectly even with unicode characters. Server

WordPress 3.0 & nginx - permalink, 404 problem

人走茶凉 提交于 2019-12-03 17:43:58
问题 I've installed nginx, FastCGI and PHP on my server. WordPress 3.0 installed after a bit of a monster battle, but it's installed and working well. However, when I change the permalink settings to anything other than default, I get 404 errors on every post, article and page. I understand that this is something to do with nginx not supporting .htaccess and WordPress getting confused with where to go when a page is requsted. I've tried a few rewrites in the nginx conf files and even the nginx

Django - how can I get permalink to work with “throwaway” slug

对着背影说爱祢 提交于 2019-12-03 17:10:39
I'm trying to add slugs to the url in my django app, much like SO does. Currently, I have pages that work just fine with a url like this: http://example.com/foo/123/ I'd like to add 'slugified' urls like so: http://example.com/foo/123/foo-name-here I can get it to work just fine, by simply modifying the urlconf and adding a throwaway value to the view function: #urls.py ulpatterns = patterns('project.app.views', url(r'^foo/(?P<foo_id>\d+)/(?P<name_slug>\w+)/$', 'foo_detail', name='foo_detail'), ) #views.py: def foo_detail(request, foo_id, name_slug): # stuff here, name slug is just discarded

WordPress Pagination not working with AJAX

白昼怎懂夜的黑 提交于 2019-12-03 12:37:08
问题 I'm loading some posts though AJAX and my WordPress pagination is using the following function to calculate paging: get_pagenum_link($paged - 1) The issue is that the pagination is getting created through AJAX so it's making this link look like: http://localhost:1234/vendor_new/wp-admin/admin-ajax.php However the actual URL that I'm trying to achieve is for this: http://localhost:1234/vendor_new/display-vendor-results Is there a way to use this function with AJAX and still get the correct URL

How to Set POST permalink/slug in wordpress using wp_insert_post

匆匆过客 提交于 2019-12-03 12:34:23
I m writing simple script using wp_insert_post() to post article in blog. but one problem here, I want to make Title and slug of an URL different. How to achieve this? for example: Title: How to make your diet success Slug: 7-ways-to-make-succes-Diet post_title sets the title, and post_name sets the slug. So: // Create post object $my_post = array( 'post_title' => 'How to make your diet success', 'post_name' => '7-ways-to-make-succes-Diet', 'post_content' => 'my content', 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array(8,39) ); // Insert the post into the database wp