WordPress rewrite post url to keep page url - wordpress

I was wondering if it's possible to rewrite the url of a post to keep the current url as permalink and add the post name at the end of current url. I ask this because I've created a custom WP_Query and integrated that in a page.
So I want the url to be like http://sitename.me/pagename (here is the custom query) and the post link would look like http://sitename.me/pagename/postname instead of sitename.me/category/postname.
Do you have any suggestions how can this be achieved?
Thanks,
Ciprian

You are asking to fetch someone with out knowing their identity!
You will have to send the postname some way or the other. May be through Input Type=Hidden and fetch it from the query-string.

Related

Add GET Parameters to URL in Wordpress pages

I would like to add GET Parameters to my wordpress pages url like so the page url would be like:
mywebsite.com/parent/mypage?social=facebook
But I cannot manage to do so :(
Any help would be much appreciate.
Thanks
A GET parameter isn't included in quotes in the URL - omit them

WordPress Page URL rewrite Issue

I need to rewrite wordpress URL.
Currently My URL is : http://www.example.com/about/?pagekey=team1
and I need like ; http://www.example.com/about/team1
Here About is one page template and I've setup for wordpress custom parameter so, when you pass pagekey to this page it will take key and based on that display result.
Now, I need to show user friendly, can anybody have idea how to do this.
currently my parmalink is set to "PostName".
Thanks.
You should follow the WordPress codex here and create 2 files:
page-about.php
single-about.php (this one will be for the teams)
you should create CPT (custom post type) with all the custom post type fields you need for this eg.
Name,
Title,
Position,
Image,
Tag,
Taxonomy,
.... etc
then you will pass the custom post type query (the query) before the loop and you will be able to access the single-about.php from page-about.php
that'all.
Cheers and hope this helps

Is there a way to not allow a custom permalink on a certain URL?

Got a question about permalinks, is it possible to add a function or filter to not allow a certain URL to be rewrote when a user has setup custom permalinks. For instance:
This URL can't be allowed:
http://domain.com/page/2/?search-listings=true
It needs to always be:
http://domain.com/?search-listings=true&paged=2
Is this possible?
Yes, WordPress provides some hooks and filters for URL generation,
see http://codex.wordpress.org/Class_Reference/WP_Rewrite#Plugin_Hooks

In WordPress, how can I ReWrite a 'page' URL based on query string parameters?

I have the following page which contains a single post and a number of comments.
http://mysite.com/tips
When a user posts a comment, I add meta-data to it so I can filter comments by using these URLs:
http://mysite.com/tips?id=cat&filter_id=1
http://mysite.com/tips?id=dog&filter_id=2
I want to use the following url's instead:
http://mysite.com/tips/cat
http://mysite.com/tips/dog
I worked through this tutorial, which seemed to be what I needed, but when I type in my url, I get a page not found error. http://thereforei.am/2011/10/28/advanced-taxonomy-queries-with-pretty-urls/
Is this possible?
Go to the admin's dashboard using mysite/wp-admin. Then click on the pages option to view all the pages. Click on the desired page name to edit that page. Just below the name of the page you can see the permalink. Edit this to change your page's URL.

Wordpress Custom URL rewriting

I need little help for url rewriting in wordpress.
basically what i need:
mydomain.com/mysomewordpresspost
mydomain.com/parentpage/subpage
to
mydomain.com/global/mysomewordpresspost.
mydomain.com/global/subpage
Basically want to add "global" in url
and also for subpages, categories, post etc etc.
mean all long url short to "global"
No want to show categorname in url and parent page name in url.
You can do this easily, Just add like this in your Permalink Settings->Custom Structure
/global/%postname%/

Resources