permalinks

How to create a permalink to display a particular category page

余生颓废 提交于 2020-01-07 02:37:08
问题 In my sidebar I have two categories: 'Product' and 'News'. So I have created two category files category-product.php and category-news.php to display them in a different way. My question is: how can I create permalinks to display these separate category pages? The default permalink always displays the category.php file. Can anybody please provide some ideas? I'm very new to WordPress. 回答1: WordPress selects template based on request parse results, not only on permalink structure. When it

Remove base slug in permalinks of hierarchical custom post type

隐身守侯 提交于 2020-01-05 06:50:14
问题 I have a hierarchical Custom Post Type called project , registered as follows: register_post_type( 'project', array( 'public' => true, 'hierarchical' => true, 'rewrite' => array( 'with_front' => false ) ) ); The URLs currently look like this: https://example.com/project/hello https://example.com/project/hello/world I would like the URLs to look like this: https://example.com/hello https://example.com/hello/world How can I most efficiently accomplish this such that other URLs are not

permalink structure for single-{post-type}.php in wordpress

别等时光非礼了梦想. 提交于 2020-01-05 04:08:10
问题 I have tried many ways to display my custom post type as single-{post-type} and finally it works nicely once i used: 'rewrite'=> false, before that, i used 'rewrite' => array( 'slug' => 'custom-post-type' ) but never works for me. Don't know where i made mistake. Right now i should feel happy cos its working without any error. But have a small confusion for the permalink because its display: localhost/myblog/?news=breaking-news instead of : localhost/myblog/news/breaking-news anyone please

Create SEO permalinks using PHP without .htaccess

我的未来我决定 提交于 2019-12-31 07:07:22
问题 Currently, my 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 How can I accomplish this using PHP but not with .htaccess? 回答1: How can i accomplish this using php but not with .htaccess.. You can't. You will need to tell the web server how to deal with URLs that don't physically exist. In Apache, that is done in the central configuration or in a .htaccess file. If your server already

Create SEO permalinks using PHP without .htaccess

∥☆過路亽.° 提交于 2019-12-31 07:06:51
问题 Currently, my 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 How can I accomplish this using PHP but not with .htaccess? 回答1: How can i accomplish this using php but not with .htaccess.. You can't. You will need to tell the web server how to deal with URLs that don't physically exist. In Apache, that is done in the central configuration or in a .htaccess file. If your server already

How to create permalinks on particular position for web pages?

本秂侑毒 提交于 2019-12-31 05:47:12
问题 I don't know whether I am asking utter foolishness. I have a webpage, say http://www.example.com . One of its page is /test.html . It has the following layout: Title Here First sub heading here lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vestibulum dolor sit amet ultrices rhoncus. Nunc at arcu eget libero auctor sodales. Morbi tristique tincidunt consequat. Donec vitae ipsum ac ligula ornare ornare eu et mi. Morbi iaculis risus ut dolor aliquam sodales. Aliquam tempor elit

Wordpress permalinks do not work. No errors

痴心易碎 提交于 2019-12-25 08:28:46
问题 I'm running a blog on subdomain. "blog.ourcompanyname.com". Wordpress folder is located under "/var/www/wordpress" Apache instance is running on 8081 port (manually configured) and being proxy passed by Nginx (which runs on 80 port). The reason we need NGINX is because we are running a second application on the same server (VPS, Ubuntu 12.04 LTS), and it is not a "PHP" application. Now, everything is working smooth: you can access different pages, static content (pictures, etc) are working.

AJAX navigation in Wordpress - Trouble with Permalinks

折月煮酒 提交于 2019-12-25 04:31:30
问题 So here´s where I am: I programmed a blogtheme which resembles a desk with lots of stuff on it, draggable by the user, moving elements and so on. The main part of the blog is placed within a book which categories you can browse by using pagemarkers as well as turning pages. To give the user the impression he/she is actually using a "book" I used a complex structure in first place (concerns mostly the place of the pagemarkers): Every category uses its own template (category-4.php, category-5

root URL shows "404 - File or directory not found

倾然丶 夕夏残阳落幕 提交于 2019-12-24 20:04:08
问题 The root URL of my blog shows "404 - File or directory not found.". It happened immediately after I changed by permalink settings and applied "day and name". If I change my permalink settings to Default then everything works fine. It works perfectly when I use MyDomain.com/page however when I just try MyDomain.com/page it throws 404 error. Following link tells me a solution but it is not possible for me as I have my site on shared hosting. It is on IIS 7. Any help would be appreciated. Thanks

jekyll pretty permalinks give me WEBrick error

一笑奈何 提交于 2019-12-24 13:42:56
问题 I am developing my blog in Jekyll (3.0.0 beta), currently on localhost, When i am trying to implement the pretty permalink and i try to visit a post it shows a WEBrick error. If i apply the /:year/:month/:day/:title.html it works fine do you have a clue why isn't it working with pretty permalinks? This is the error I get: /2015/08/03/are-permas-working.html' not found. WEBrick/1.3.1 (Ruby/2.1.6/2015-04-13) at localhost:4000 回答1: Once you set Jekyll permalinks to pretty in _config.yml like so: