I have WordPress installed in a subfolder of my domain. I want to keep it there, so that it is accessible only through http://www.example.com/mywordpress.
I have an issue with permalinks. If I use postname permalinks, all my pages (with different templates applied) redirect to the homepage, while my archives (including custom post type archives and singles) are displaying correctly. If I use custom structure permalinks and I prepend anything to the postname – for example /test/%postname%/ – all pages display correctly while custom post type archives and singles display a 404 error.
This happens whenever I refresh permalinks and also after replacing .htaccess with one from a brand new WP install.
The odd thing is also how the permalinks are displaying in the browser url field:
if I use /%postname%/
pages (not working) display as
http://www.example.com/mywordpress/postname – they all display the
homepage contents
CPT archives+singles (working) display as
http://www.example.com/mywordpress/postname
if I use /test/%postname%/
pages (working) display as
http://www.example.com/mywordpress/postname – so without the
prepended text!
CPT archives+singles (not working) display as
http://www.example.com/mywordpress/test/postname – displaying a 404
error
My custom post types have slugs translated to different languages with WPML. I thought that might cause the issue, however I tried to deactivate all plugins included WPML and still no luck.
Does anyone know what might cause that?
I figured it out. I was using reserved terms as custom taxonomy slugs (https://codex.wordpress.org/Reserved_Terms). By changing them to something else everything started working normally again!
Related
I have this weird problem in wordpress, where i changed the permalink Settings for a second and changed it back to post_name later. Now the Sites, that show the Query of my custom post types, are leading me to the index.php
When i change the permalink of the site by hand(so instead of .../blog/ to ../blogs/), everything works fine.
I have a hunch what it could be: I named the Site, where i query and display the Custom Post Types the same name as the Custom Post Type itself.
My current set-up results in posts being created under the webroot:
www.domain.com/my-post
www.domain.com/my-other-post
How can I make it so posts are created "under" /blog/:
www.domain.com/blog/my-post
www.domain.com/blog/my-other/post
Editing the permalink results in the / needed being turned into a -.
Is there a setting the force posts under a parent?
Use https://wordpress.org/plugins/custom-permalinks/ plugin and just add blog in url before post name,it will work
As at WordPress 5.2.2, in Settings > Permalinks, in the Common Settings section, the option to set a custom structure for permalinks exists for posts.
The default is set to Plain, which results in /?p=123 style posts. Switching to Custom Structure allows the switch from the default of /%postname% to /blog/%postname%.
My existing posts now live under /blog/ along with newly created ones.
As a side note, if the site is already live then redirects might be needed if you have post links out in the wild.
I have a WordPress site where my front page is showing the latest posts.
If I have my permalinks set as plain showing...
https://example.com/paged?=2
The page loads. However, If I change the permalinks to Post name, giving me...
https://example.com/page/2/
That results in a 404.
.htaccess seems to be set up correctly. The first page has posts and the links are being generated in the pagination controls. Using Post name as the permalink setting my posts are properly linked...
https://example.com/my-wordpress-post
But https://example.com/page/2/ does not work.
Any ideas? I really need to set the permalinks to Post name. Could it be a server issue?
First thing I would recommend is to confirm your .htaccess file is set up correctly to process permalinks. If you create a new page, can you access that page with his human-friendly permalink, for example? If not, you may need to fix your .htaccess file to handle those rewrites properly.
Otherwise, can you provide more context for this issue? Is it safe to assume you have your homepage set up with a list of paginated posts?
I figured this out. Instead of selecting Post Name, I select the Custom Structure radio button instead and manually added /%postname%/ and then clicked saved.
Then it worked. :)
We have a custom WordPress theme running on WordPress 3.4.2 and are running into some problems with our Permalink settings and a particular calendar plugin we're using on our website. Our website is somewhat non-traditional in the sense that all of our Posts are located within a section of the website called /news-events/ (e.g. www.domain.com/news-events/).
Currently, we are using the following custom permalink structure: /news-events/%year%/%monthnum%/%postname%/ to match the location of our Posts. We have created about 30 websites from this template using this permalink format without any issues.
However, the calendar plugin (The Events Calendar Pro 2.0.10) we're using on this particular site requires the Permalink structure to be /%postname%/. When the permalink structure is set to anything other than /%postname%/, any calendar events pages return 404 pages. Unfortunately, setting our Permalink structure to /%postname%/ is not a viable option for us as it's imperative for us to keep the /news-events/%year%/%monthnum%/%postname%/.
The Question:
Is it possible to set the overall WordPress Permalinks to /%postname%/ while customizing the Permalink structure for Posts, Archives, and Categories to /news-events/%year%/%monthnum%/%postname%/? Put another way: how can we change the Permalink structure to /news-events/%year%/%monthnum%/%postname%/ ONLY when a Post, Category, or Archive is being viewed?
The following pages provided some useful information, however, it seems we'd need to do the opposite of what's described:
http://shibashake.com/wordpress-theme/custom-post-type-permalinks
http://shibashake.com/wordpress-theme/custom-post-type-permalinks-part-2
Any and all help is greatly appreciated.
Can you set the permalink structure to %postname%/news-events/%year%/%monthnum% ?
It may possible allow the plugin to grab the first part of the request (Being postname)
I have a wordpress multi-site:
site1.local.loc [with subdomains on my local] and I would like to have three pages on this.
site1.local.loc/works - (posts page, but I want 'Works' as my title)
site1.local.loc/about - (static page)
site1.local.loc/contact - (static page)
Since 'Works' is my posts page where I keep putting in content, I changed my permalinks for this site to:
/works/%postname%/
However, when clicking on 'view post' at the end of posting anything, it leads me to a '404' page which means there is a disconnect. This is also the case for viewing any page. Is my .htaccess file faulty?
How do I solve this? Also how do I make all my posts appear in my 'Works' page (as in, how to make that page the posts page?)
Thanks!
Updated: I've found out that I get a 404 for any page that I create for a site in a wordpress network.
You do not have to touch .htaccess file.
Make a custom post type that is called works. All those posts made in that custom post type will have that url that you desire. There is no other way to do it. (even if there is, it must be dirty) That is celanest way, and since wp does it by itself you can expect that nothing will go wrong wnen you update, install plugins, etc.
Create a category called "Works" that would then show all posts added to that category by simply going to /works/ all posts would then be shown as /works/post-name/.
You will need to change the permalink structure to /%category%/%postname%/
Check this in administration
Settings > Permalinks > Post name