Custom category URL wordpress - php

Can you help me with one issue? I want to understand how I can make WordPress URL like this structure. Examples:
http://sitename/category-1/subcat/article1
http://sitename/category-2/subcat/article2
http://sitename/category-3/subcat/article3
Searched all google but nothing found :(
General conditions is don't use any plugins or modify functions.php, only admin manipulations. Can anyone explain me how I can do this?
Thanks!

you can do it simply by adding the custom permalink as /%category%/%postname%/
Source: https://www.wpbeginner.com/wp-tutorials/how-to-include-category-and-subcategory-in-wordpress-urls/

Related

How to index a site like mysitr.com/courses?id= in wordpress

I wanted to index this url in the google search mysite.com/courses?id=123. The problem is that I have wordpress installed and I cannot find a solution to this. Any kind help is thankful :)
You can change your permalink structure by going to Settings->permalinks and select a pretty url like the last one. https://codex.wordpress.org/Using_Permalinks

Url Redirection Help Required

I am using Wordpress and Woocommerce. It is generating these ridiculously long URLs:
http://digital-dev.co.uk/a3m/shop/products/portable-stands/portable-counters/
I would like to alter it so that it reads like this:
http://digital-dev.co.uk/a3m/portable-stands/portable-counters/
I cannot seem to get a redirection working correctly for this. Can anyone help? Thanks in advance.
This is a great question. Have you edited the permalink structure in WordPress settings?
Here's a guide that contains information on how to edit the permalink structure: http://edenfried.com/things-you-should-do-after-installing-wordpress/#tab-con-4

Wordpress Url Rewrite and replace

i am trying to change the wordpress url with htaccess, i have the following scenario
My url will look like this, this will be visible to users.
http://www.example.com/custom-field-name1/custom-field2/post-name
While the actual url is this one
http://www.example.com/post-type-name/post-name.
Please help me how this will be possible with htaccess
I guess you require custom permalinks.
Using which you can change your permalink structure as you require with custom fields.
Kindly go through the following to know in depth
http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-permalinks-in-wordpress/
Hope this helps you mate
Edit :
As per my suggestion htaccess is not necessary for this.

Default permalink structure with pagination on Wordpress

My goal is to set my pagination permalink structure from /page/#/ to ?page=#, while using /%postname%/ as my permalink structure. I have changed the link structure with the get_pagenum_link filter, but it still redirects me to the standard /page/#/ instead of the ?page=# I want.
Any suggestions on how to achieve this?
I finally figured it out. I added a filter to redirect_canonical and returned false. I don't know much about that so hopefully that doesn't cause problems down the road on my site.

How can I edit the way links show in wordpress, not the permalinks?

Hey guys, I'm trying to use my wordpress categories as subdomains without using a plugin because the only working plugin doesn't seem to work with the new wordpress.
So I created the subdomains and I'm searching for a way to let this category1.mysite.com to show the content of www.mysite.com/category/category1 without redirecting.
but my question is how to edit the links manually for www.mysite.com/category/category1
when someone goes to my site the theme shows links this way www.mysite.com/category/category1
instead of showing the subdomain, so what files or database table should I edit to change the way my theme shows the links of categories and subcategories ?
and also if you have a way to to the first step in the .htaccess file please tell me about it.
and thank you very much :D
Look into get_categories() function - this will return an array so you can do the following
foreach(get_categories() as $category) {
$url = $category->category_nicename.'.mydomain.com';
}
from this you should be able to build your own UL with the information.
It seems like you will need to use Apache's Mod_Rewrite feature in a way that is not standard with WordPress permalink features.

Categories