Dynamic Routing in WordPress
-
Based on the path, I’m able to write custom routes to get the correct page, and set some custom variables… for example:
If the route takes a URL in this format:
http://example.com/products/:product_nameAnd we hit this URL:
http://example.com/products/baseball-gloveAnd we’re able to retrieve the page by doing:
get_page_by_path('products/product');Right now, the original query initially searches for
products/baseball-glovewhich returns theWP_Postobject for404 / Page Not Found, even though my subsequent query withget_page_by_pathgets me the correctWP_Postobject. How can I reset the global$postobject to overwrite the currentWP_Postand so that other plugins are able to use functions like thethe_title()? -
What is the URL of the site your refer to?
We require the exact URL of the site you are referring to so we can verify where it is hosted.
We provide support only for wordpress.COM hosted blogs here. We do not provide support for wordpress.ORG software installs.
WordPress.COM and WordPress.ORG are completely separate and have different username accounts, logins, features, run different versions of some themes with the same names, and have separate support documentation and separate support forums. Read the differences here http://en.support.wordpress.com/com-vs-org/
If you are referring to a wordpress.ORG software install on paid hosting, and if you don’t have a username account at WordPress.ORG account, then click http://wordpress.org/support/ and register one on the top right-hand corner of the page that opens, https://wordpress.org/support/register.php so you can post to the support forums there.
Resetting your WordPress.ORG password http://codex.wordpress.org/Resetting_Your_Password
WordPress.org support docs are at https://codex.wordpress.org/Main_Page
See also https://apps.wordpress.org/support/
- The topic ‘Dynamic Routing in WordPress’ is closed to new replies.