• Resolved ildomandatore

    (@ildomandatore)


    Having an online gaming site, I could add games that are only available for desktop or mobile, but I’m limited in adding games that run on both devices.

    Unfortunately this situation prevents us from inserting games with high traffic. I had thought about the AMP plugin, but I have 14 incompatible plugins and the performance improvement was either no or very slight.

    So I came here to know if there are any other methods to resolve the situation. A solution similar to tags would be fine, where desktop games are only shown to those who use the desktop and other devices do not see the game. If they copied the URL of the desktop game, they would receive the 404 code. At the moment if I have a 404 code there is a redirect to the homepage, but in this exception it would be better to redirect to the 404 page.

    They suggested your plugin to me. Is it right for me?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @ildomandatore – The problem with any solution like that is its not cacheable, the avg wordpress server would not like that.

    To clarify, in order to filter by device in the query level (pre rendering in template), it would require detecting browser details in PHP. This would mean 0 caching could be used, no page caching, no cloudflare etc.

    The only way to do device checks, and the way we do it with block controls is via CSS media queries or front end JavaScript.

    That means the content is on the page, your just hiding it.

    If that is the way you want to go you probably don’t even need a plugin.

    1. Tag each item with proper device type.
    2. Ensure that each item renders the device type tag as a class on its container element. Likely can filter post classes for this in some way.
    3. Add some CSS that hides mobile tagged posts on screens larger than X.

    If you are looking for actual device rules, like iPhone/iPad vs Desktop vs android phone tc, you would likely need to rely on JS based checks.

    If you are already using our plugin you could render your list of games separately as blocks in gutenberg, then add rules to hide/show each based on device (screensize).

    Hope that helps.

    Plugin Support Kim L

    (@kimmyx)

    Hi there,

    I’m going to mark this as resolved as we haven’t heard from you in a while.

    Feel free to create a new thread if you have other questions. ??

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create posts for some devices?’ is closed to new replies.