103 reputation
3
bio website
location
age 29
visits member for 2 years, 3 months
seen Jun 29 at 22:58

Don't let your learning lead to knowledge; Let it lead to action!


Sep
12
awarded  Supporter
Apr
13
awarded  Scholar
Apr
13
accepted Get permalink for a post from inside Wordpress and route to a related site
Apr
13
comment Get permalink for a post from inside Wordpress and route to a related site
Thanks Tom. (Actually the main site already existed. We're only building the mobile one). You gave me so many pointers and took valuable time, so I will accept your answer. But now that I have realized I dont need permalinks anyway, what I did was $url = 'http://m.'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; and then I checked if it is mobile, and redirected to that URL if so. Worked fine.
Apr
13
comment Get permalink for a post from inside Wordpress and route to a related site
I placed it in index.php and I'm getting internal error 500 (only on mobile phones). The server encountered an internal error and could not meet your request.
Apr
13
comment Get permalink for a post from inside Wordpress and route to a related site
Corporate bureaucracy. The client did not pay for a responsive design, and wants a standalone mobile site instead. It's quite complicated, thanks to my Team Leader. Sigh. Thanks for the updated code. Can I use this in the index.php page then? Or functions page? Or where? I am not allowed to install plugins (for the same bureaucratic reason).
Apr
13
comment Get permalink for a post from inside Wordpress and route to a related site
Also can get_permalink work for the current page? Cos get_permalink says Note that when used outside The Loop on a posts page (index, archive, etc.) without the ID parameter, it will return the URL of the last post in The Loop, not the permalink for the current page. See: core.trac.wordpress.org/ticket/9963
Apr
13
comment Get permalink for a post from inside Wordpress and route to a related site
(No, I am under instructions not to use a responsive design) Thanks! I'll try this. I already have code to detect mobile, just like your wp_is_mobile above. Can I place the add_action and the mobile_redirect_init() inside the theme functions.php file instead of making it a plugin?
Apr
13
revised Get permalink for a post from inside Wordpress and route to a related site
added 77 characters in body
Apr
13
awarded  Editor
Apr
13
revised Get permalink for a post from inside Wordpress and route to a related site
Changed the title to remove ambiguity / contradiction
Apr
13
comment Get permalink for a post from inside Wordpress and route to a related site
Thanks. Fair enough, I can move my redirection script to the point at which the routing is done, and then redirect from there. At what point is the permalink figured out, and what file should I inspect, please?
Apr
13
asked Get permalink for a post from inside Wordpress and route to a related site