Wordpress custom permalinks - wordpress

I've been working on my wordpress permalinks for a couple of days and can't seem to figure out how to get them to work properly.
Here is the simple version of what i have and what i'm trying to achieve
I have 5 different categories (home, sports, beauty, arts, food)
I have 3 types of posts (post, pages, events(custom))
Each post_type can and will be associated to only 1 category
Here is what I would like to get in terms of permalinks
site.com/%category% = a different page for each caetgory (not an archieve)
site.com/%category%/%post_type% = archive listing of post_type
site.com/%category%/%post_type%/%post% = single of post
site.com/%category%/%page_slug% = the contents of a page
When i look at the rewriterules that are being applied i get close but it doens't include my category in the rewrite part
%category%/event//?$ index.php?post_type=event
Any help to get this working would be greatly appreciated.
Thanks

I manage to solve my issue and create the permalinks the way I wanted.
I created my post types like I wanted but I had to put a lot of if/else statement in my header to properly manage my pages and post type to ensure that the right page was being displayed.
It was quite the headache to finally find a structure that worked but in the end I managed. If I ever have to build a similar structure I hope I can think of a better solution.

Related

WordPress posts can't be linked to a specific category

One of our website has a problem with linking normal posts to a specific category. When we try to link a post to the category named "nieuws" (news), the archive of this category remains empty. Also WordPress shows zero on the categories (taxonomy) page. When I create a new category, for example "nieuws2" everything works as it should be. I've never seen this issue before and it seems to be a bug in the WordPress core. Any idea what this problem could be?
We figured it out! One of the database rows was crashed. Everything is working as it should be.

Excluding a single category from Wordpress all posts results

I'm looking for a bit of help as I struggle to create a page that has a list of all of my clients' products. Currently I'm using this URL, which works great (with a caveat): http://tayloryourevent.com/?p=*
(note: on her site, both products and blogs are created as posts, but in separate categories)
As you can see, all the products show up nicely, but also included in the mix are blog posts, which I need to hide from that page.
My real problem is that I'm confused by the /?p=* and what that's doing. Since it's a page being created on the fly, I don't know where to look to get a glimpse behind the scenes.
2 questions:
Where is the /?p=* getting its theme from? Could I copy that theme and edit it to exclude the blog category?
-or-
Could I exclude the blog category with some kind of fancy URL work?
This plugin should be able to exclude blog categories: Simply Exclude

Wordpress: how to limit post-nav to specific category?

I'm setting up my first Wordpress site. I have limited knowledge and understanding of its inner working. (Bear that in mind, please)
I setup 3 different pages that show posts based on their categories.
Though, once your reading one post, from either pages, the Next Post/Previous Post navigation still cycle thru all the posts regardless of their categorie.
I would like to limit this navigation to posts within the category of the page the reader is reading from.
Is that at all feasable and if so, can you help me out understanding how to do it?
Or if there is a plugin that does that?
Thanks
That's covered in the WP docs. Set in_same_cat to true.
https://developer.wordpress.org/reference/functions/next_post_link/
If the links are already in your theme, you'll need to edit them.

Custom post-type child category archive

Having a bit of a headache with WordPress at the moment after days of searching for an answer. I have a custom post-type on a new site called videos, and I want series of videos on the site. I decided to use standard categories for organising these videos into the series.
So, my structure goes:
Videos (post-type) -> Series (Category) -> The Making Of (child-category).
In terms of the hierarchy I have no idea which template would allow me to show all the posts from the child category? I've tried so many variations and none seem to work. And yes, I've been looking at the template hierarchy.
Maybe I'm just missing the obvious, but does anyone know what template is needed to show this child-category? I'd hate to have to make a page each time there's a new series to show.
[UPDATE]
So, I've changed over to a custom taxonomy as suggested in the comment below. And I've managed to get the list of posts from my making-of category showing up in a list. This uses the taxonomy-$term.php template.
This shows in the url mysite.com/series/making-of/.
But, I'm struggling to find a way to display all of the different categories from the post-type on a single page. I thought it would use just the taxonomy.php file but that doesn't seem to work.
I thought the url would have been mysite.com/series/

How can I update my permalink structure in wordpress?

This is the old url of my blog (wp 2.2)
http://myblog.com/category-name/post-name
ex.
http://myblog.com/shoes/i-like-shoes
and Im trying to change it to
http://myblog.com/post-id/post-name.html
ex.
http://myblog.com/717/this-is-my-first-post.html
Im moving my content from wp2.2 to wp2.8 and i want to change all the categories for the current content from whatever it is now to "classic"
The problem of course is that some of my pages have a high page rank and I need to maintain this...
this is becoming a headache for me to figure out.
your help is appreciated!
Go to: http://myblog.com/wp-admin/options-permalink.php. Or, if you want to navigate manually :), go to your wordpress dashboard. In the Settings menu go to "Permalinks".
Also see http://codex.wordpress.org/Using_Permalinks for more detail, especially the fields for making custom permalinks.
Edit
To quote the above,
Using %category% with multiple categories on a post, or %tag%
When you assign multiple categories to a post, only one can show up in the permalink. This will be the lowest numbered category (see Manage Categories). The post will still be accessible through all the categories as normal.
The same thing applies to using the %tag% field in your permalink structure.
So... As long as "classic" is the lowest numbered category you use, that will work as the category name in the permalink.
Your change in structure however will break any external links pointing to your posts so your page rank is going to change as well. Unfortunately you need to choose which is more important: changing to permalinks without category names, or maintaining the pagerank of old posts.
If you just changed category names, you can do a redirect in htaccess for just the category name, IF the rest of your URL structure remains the same, i.e. date and post name.
If you changed more than just a cateory name, or don't want to mess around with htaccess, then use something like the Redirection plugin to easily handle redirects.

Resources