Specifically I am talking about the custom structure of Permalinks:
Well I noticed the list of categories names that are different when posts are made, the URL is different than the /%catagory%/ variable (or placeholder).
Simple fix, goto the Categories list under Posts and change the Slug. This is what the URL will show, not the name category.
Related
I need to make it easy for Wordpress blog posts to be assigned to specific locations of a business so they can be grouped into their own collections for display on blog article archive landing pages for each location. Some articles my be relevant to multiple locations as well.
I cannot use categories for this. Ideally I want something similar to categories, but we're already using 70 other categories on this site for actual post categories. Category blog post archive landing pages will have a wildly different look and feel than the location based landing pages, so categories will not work for this.
I need an alternate approach flexible enough to where it's as easy to assign posts to locations as it is to click a check box for assigning categories to a post, and robust enough that I can indeed create those location-based landing pages that can filter out entries from all other locations.
I'll also need to filter posts by category within a location's entries, if possible.
How can I pull this off successfully?
My initial thought on this would be to use a custom Taxonomy for your blog posts. They function just like Categories (can have archive pages, posts can have multiple taxonomies assigned, etc). We generally use the plugin, Types - Complete Solution for Custom Fields and Types, to manage our Taxonomies. (wordpress.org/plugins/types) If you are already familiar with working with Categories and their archive pages, it's not much different to work with Taxonomies.
The interface works with a checkbox list just like Categories. You set a name, slug, and optional description in the admin side of things. You then assign any number of Taxonomy terms to an individual post. Taxonomies, just like Categories, are just alternate ways to categorize posts. You can use the built-in archive file formats (taxonomy-{taxonomy_name}.php or taxonomy-{taxonomy_name}-{taxonomy_term_slug}.php) to built your template files. So if you had a taxonomy with the slug "locations" and your looking at posts with the term "nort_pole" you could make taxonomy-locations.php or taxonomy-locations-north_pole.php to serve as your templates for the archive pages. You can also use custom wp_queries to sort/filter your posts based on what taxonomy terms are applied to the posts you're looking for.
Here is a good article in the Wordpress Codex that talks about Taxonomies. http://codex.wordpress.org/Taxonomies
I'm having some trouble with Wordpress category/subcategory archive URLs.
For example, I want to be able to display this archive: http://faroutmagazine.co.uk/wp/track-of-the-day while keeping its parent category in the URL, making it http://faroutmagazine.co.uk/wp/music/track-of-the-day
Previously, I was just getting a "This is embarrassing..." 404 message when accessing the /music/track-of-the-day URL (even though that's the one that was appearing in the View option under categories in the admin section of WP).
Now the View link in the admin area only shows me the /track-of-the-day URL, and this DOES display the category posts which is great, but I want it to include the parent category in the URL.
Is there anything I can do to the functions.php file or any plugins I can add to make this happen? Please bear in mind that there are multiple subcategory archives on this site, and they should all contain the parent category in the URL.
***UPDATE:
I actually have just set everything up a different way now using Pages and showing category archives on pages as it's taking up too much time. Thanks for your answer though. People telling me to use %category%/%postname% as the permalink structure are incorrect - yes, this works for the POST urls but not for the archive category of the subcategory which is the problem I was actually looking for help with. If anyone can provide an answer, it would be appreciated, but I am using this workaround now as this was taking up way too much time trying to figure out.
This happens because you chose category and subcategory from the right options tick boxes when editing the entry. Choose only the subcategory box in every entry and it will show the nested URL.
To make this happen you need to make some change in permalinks
go to Settings->Permalinks then select custom structure and use this syntax " /%category%/%postname%/ "in the field
Now save the settings and you can see the post url's using its category name in the permalink
Hope it helps :)
You should set hierarchical value to true when you are defining your taxonomy.
'rewrite' => array('slug' => 'mySlug', 'hierarchical' => true),
Then if you have a subcategory the url will be shown like this:
http://example.com/taxonomy/parentCategory/subCategory/
I found this sloution here:
https://wordpress.stackexchange.com/questions/155319/how-to-include-parent-terms-in-hierarchical-taxonomy-urls
Actually hierarchical subcategory archive permalinks are default in wordpress.
If you have a "pretty permalinks" structure selected in settings > permalinks, like /%postname% for example, then category and subcategory archive urls should default to something like:
yourdomain.com/category-base/category/sub-category/sub-sub-category
I had encountered a similar issue with a recent WP project, BUT I was using a plugin called WP No Base Permalink in order to get rid of my category and tag base slugs in my archive permalinks. When I deactivated the plugin, category hierarchy suddenly returned to my archive permalinks (luckily this project was still in development, otherwise, I would have had some major 404 problems).
I have not yet found/tested another plugin for eliminating category/tag base slugs that will also preserve hierarchy in sub/category archive urls, but it turns out that I do not need that functionality for my current project.
Instead I am using the base slugs blog-articles and blog-tags for the standard categories and tags in order to set the blog taxonomies apart from other taxonomies. Then I am using the plugin Types to create a custom post type and custom taxonomies for that post type. The Types plugin has an option in the advanced settings to set hierarchical taxonomy urls to true or false when creating a custom taxonomy.
Finally, I found a plugin called Remove Taxonomy Base Slug that effectively eliminates the default taxonomy term from the base slug of the taxonomy archive urls. And this, thankfully, does not interfere with the hierarchical sub/category urls, OR the base slugs for standard tags and categories.
So now, my blog categories/tags look like this:
yourdomain.com/blog-articles/category/sub-category/
or yourdomain.com/blog-tags/tag/
And my custom post type categories/tags look like this:
yourdomain.com/category/sub-category/ or yourdomain.com/tag/
Phew!
I hope this helps!
Setting Settings->Permalinks->Category base to '%category%' should give you what you want. According to WP doc:
Nested sub-categories appear as nested directories in the URI
See http://codex.wordpress.org/Using_Permalinks.
The Permalinks settings should be like /%category%/%postname%/ ..
If use custom permalinks settings as %postname% only, it will make your url in the form of .../category/subcategory.
You can use WordPress plugin to remove 'category' from url
http://wordpress.org/plugins/wp-no-category-base/
and then follow the instruction given by Maruti
I wanted to create a new page similar to author.php in wordpress, but that lists only a specific Custom Post Type. It is important to have both pages: author.php for regular posts, and this new author-custom-post.php only for the Custom Post Type.
The usage is that the first one will list the blog posts, and the other one will list the author's cientific publications, each one in its own page.
And, of course, it should have a link to this author-custom-post.php that I can use in the author bio.
I could only manage to find pages listing both things together, but nothing about listing in different pages.
Thanks in advance!
I'm currently trying to build a wordpress product catalog with a custom taxonomy.
I'd like to have browseable multi-level category system, so if I click the Catalog menu, it would show all the top parent categories, and if I click on one of these categories, instead of showing me the posts in that particular category, I want it to list all it's subcategories.
For this I'm using two slightly modified plugins currently:
Multi column taxonomy list, and taxonomy images.
My approach would be to have the taxonomy lister display custom links linke www.xyz.com/wp/product?cat=doors
and the product page would process the $_GET data cat and forward it to the shortcode somehow so it would be [mctl taxonomy='productcategories' parent='$_GET['parentid']']
.
So for the TLDR: How can I pass variables from the URL to the shortcode, or to the plugin.
Thanks for any help.
Nevermind, I figured it out. I just had to edit the plugins php and use the $_GET[''] stuff there.
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.