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.
Related
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/
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
I have looked all over the place and can't figure out how to get this to work.
I want my urls for blog posts to look like this: "www.website.com/my-page/category-name/blog-post-title"
The issue I am having is that I have a page called "my-page".
So I have a page "www.website.com/my-page/" which is just a standard wordpress page, but I want the url for the blog post to look like it is under that page.
Here is what I have for the permalink so far:
/my-page/%category%/%postname%/
But this doesn't work and gets a 404 error when opening a blog post.
At this point I don't believe it can be fixed through the wordpress gui, so if anyone has any recommendations, it would be appreciated.
Thanks!
Edit: I wanted to add that the permalink works fine if I remove "/my-page" or if I simply modify it so it does not match the page.
First of all you should not use the category in front of your permalinks as it leads to bad performance (and some posts may have multiple categories): http://ottopress.com/2010/category-in-permalinks-considered-harmful/
The second thing is - it should work. I tried with a fresh installation on WordPress and I get the correct results.
Did you flush rewrite rules / save the new permalink structure?
Did you publish a post?
Is your server correctly configured to use permalinks?
Third possibility - if your permalink structure does not work for some reason you can define a custom permalink structure:
https://codex.wordpress.org/Rewrite_API
I have a WordPress blog. All the post are currently in this convention:
http://www.myblog.com/blog/?p=1442
Now I'd like to change the URL of all posts like this one:
http://www.gomidjets.com/blog/this-is-my-post
While it's quite easy to apply it by changing the blog settings, the big problem is about the links I've placed
in many external website. I can't change them, and I'd like to map the old links to the new links somehow.
Do you know how to do it - if that's possible at all?
Do you have a better solution?
Thank you very much
Wordpress will map all old URL to new one, in case if you provided all URL in their original shape, such as http://example.com/?page_id=80
The answer is: you don't need to do anything.
I believe what you're looking for can be found in the admin panel.
In the admin panel (http://www.your-wordpress-site.com/wp-admin), go to Settings > Permalinks
Login to the admin panel first,
go for the settings->Permalink Settings
Select the format you want.
If you want change the base url for only some posts then you can edit from database.
Try this Redirection wordpress plugin to redirect your old url to your new url.
The URL's should resolve fine because the original URL you're using is the permalink one to my knowledge. If you're wanting end users to be redirected to this url, that's a bit harder.
That aside, I couldn't find any plugins that already did this. What you want to do is check the current URL against the wordpress function get_permalink() and if it doesn't match, redirect to the current permalink URL.
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.