Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1219862

    I would like my website to change from the ipad quer (1024px) to the mobile version

    #1220119

    Hey Markus,

    I don’t understand your question, could you try to explain a bit further please?

    Best regards,
    Rikard

    #1220168

    Hi,
    I made two versions of my website, one optimized for the desktop from 1025px wide and larger and one optimized for mobile from 1024px and smaller.
    When I look at my website across the iPad (1024px), the desktop version of the page is viewed. I would like the mobile page (1024px and smaller) to be displayed there.

    #1222422

    Hi,
    Sorry for the late reply, I assume that you have a one-page website but have created two pages optimized for two screen sizes.
    To load a certain page depending on device and screen size is actually complex for it to work correctly and dependable, I would recommend using a plugin to achieve this. This one might work well.
    But if you simply want to load a certain page depending on if it is 1024px or smaller, Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_script(){
    	if ( is_page('home') ) { ?>
    	<script>
    	if(window.innerWidth < 1024) {
    		window.location.replace("http://test.test/shop/");
    	} else {
    	 
    	}
    	</script>
    	<?php }
    	}
    add_action('wp_head', 'custom_script');

    This script first checks if the page loading is the “home” page, you can use the “home” slug or the page ID to decide which page is replaced.
    Then the script checks the inner width of the device screen and if it is less than 1025px then it loads the URL given, please adjust to your URL you want to load for mobile.
    For desktop just set your desktop “home” page as the real “home page” in WordPress.
    If you test on your desktop by changing the window size you will have to reload the page after each adjustment because the script loads on page load, not on window resize.

    Best regards,
    Mike

    #1222533

    I set the custom CSS “only_desktop” for individual elements and then made the following entry in the Quick CSS:

    @media only screen and (max-width: 1366px) {
    .only_desktop { display: none !important; }}

    It works for the iPad Mini (1024px x 768px) as well as for the iPad (1024px x 768px) and the elements are not displayed.
    But the iPad Pro 10.5-inch (1112px x 834px) and the iPad Pro 12.9-inch (1366px x 1024px) do not work and the elements are still displayed.
    Where is the mistake?

    #1222535

    Hi,
    For targeting IOS devices try to take advantage of the IOS media queries such as (-webkit-min-device-pixel-ratio: 2) and specific sizes and orientation. Please see: CSS Media Queries for iPads & iPhones
    You may have to mix and match the media queries to cover all of your devices, but this site has them laid out nice.

    Best regards,
    Mike

    #1222583

    Hi Mike,
    that’s exactly what I meant. The site now works perfectly on all devices. Thank you very much for your help.

    #1222654

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change my Website from 1024px (ipad) to the Mobile Version’ is closed to new replies.