How to do alternate code for browser with no flash support (eg phones)
-
I would like to have some alternate text displayed on a browser with no flash support. This is commonly a mobile phone browser. I use “issue pdf sync” in my posts content. My wordpress postings just use code that “issue pdf sync” inserts. For example:
[pdf issuu_pdf_id=”xx” allow_full_screen_=”0″ show_flip_buttons=”1″ layout=”browsing” autoFlip=”true” width=”400″ height=”350″ ]
Here is pseudo code for what I want to do:
If browser-supports-flash then // typical desktop browser [pdf issuu_pdf_id= ... ] else // html code of text I will add to each post equivalent to PDF documents content // I just need some info on how to do the if-then-else code. // More advanced alternatives ... // // or insert html code to open using HTML 5 issuu reader (Issuu Mobile phone app) // I do not know how to code this or if it possible to open an app from browser // ref: https://bit.ly/12aflBG // or in future insert html 5 embed code (still in development - I think) // ref: https://bit.ly/13OkG2N // or open using https://issuu.com/smartlook ( I do not know how to code this) // or fallback jpeg (this one is beyond my skill set and I think would be hard to do in a wordpress based site) endif
Can I code something when I am editing the post that will do the if-then-else logic?
I tried this solution (not for all browsers) https://bit.ly/11hoIg4 and I suspect cannot use this in the posting content editor:
<? // Search through the HTTP_ACCEPT header for the Flash Player MIME type. if (strstr($_SERVER['HTTP_ACCEPT'], 'application/x-shockwave-flash')) { $hasFlash = true; } if ($hasFlash) { // flash code } else { // non flash code }; ?>
Can php be put in a post?
I have a tech background but not a php coder, but if I know what files to edit I can cut and paste into my post, or template files to fix problems. I have read and searched on the problem but most of is over my head or does not relate to wordpress enough.
- The topic ‘How to do alternate code for browser with no flash support (eg phones)’ is closed to new replies.