Langsung ke konten utama

How To Set Specific Page from Homepage for Mobile Viewing in WordPress 4.8.1 Site

How To Set Different Page When Viewing Mobile or Smartphones in WordPress?

This is the common things we encounter when we wanted to see different page on our website when we view using our smartphones or mobile devices from our website blog or any other website, this simple solution is very useful to improve user experience and to make your landing page or homepage load faster, this solution is effective for iPhone 4, iPhone 4s, iPhone 5, iPhone 5s, iPhone 6, iPhone 6s, iPhone 6s Plus, iPhone 7 and any other devices, you just only need to set the specific screen sizes from the code we are going to provide below.

//* Redirect homepage on mobile
add_action( 'wp_head', 'wps_params', 10 );
function wps_params() {
    ?>
 <script>
 if (window.location.pathname == '/' && jQuery(window).width() <= 480) {
    window.location = "http://yoursite.com/mobile-page/";
 }
 </script>

    <?php

}

Steps On Placing The Code

  1. You need to login as administrator from your WordPress site.
  2. Go To Appearance>Editor and locate the functions.php
  3. Copy the code provided above and then paste it to the functions.php at the end of the functions.php code.
  4. the 480 numbers if you want to include the iPad or other screensize from this.
  5. Now set the link you wanted when users trying to access the homepage of your website they will redirect to see the mobile page you set from the code.
Hope this simple guide is helpful and also if you wanted to have more interesting video tutorials I suggest you subscribe the "Bryan WordPress Journey" YouTube channel.

Komentar

Postingan populer dari blog ini

The Beautiful Aerial View of Spectacular City of Singapore

Credit Photo Capture from  airvuz.com Singapore is one of the potential places wherein you can put on your travel list, because of its extraordinary engineering buildings which is always complimented to this nature, despite having lots of buildings the people and the government always thinking about how they can improve the place without destroying the environments and this is the reason why Singapore is one of the best places you should go and visit. Singapore also called as  Lion City, the Garden City or the Little Red Dot, is a sovereign city-state in Southeast Asia, despite being a small place we can't deny the fact that this is one of the cleanest and the safest place in Aisa, you can see the screenshot photo provided below that there is a big change of this place, and it even improves more from business, nature, clean park, and friendly people. As you can see the place are very beautiful, notice that the place is green indicated that they value the importance of having ...

Senior Project Management Supervisor - Full Time Job Hiring

Senior Project Management Supervisor Anflo Realty Development & Allied Services Corporation is looking for a dedicated and professional Senior project management supervisor, if you feel you are fit to this job then we encourage you to apply this job, just follow the steps provided here. Job Type:  Part-Time Job Location:  Davao City Job Description: Educational Attainment : Bachelor’s Degree in Civil Engineering or Architecture  Gender/Age : Male or Female  Experience : At least 5-10 years of supervisory work Company Information Anflo Realty Development & Allied Services Corporation Anflocor Corporate Center  Damosa Complex Lanang  Davao City, Davao City  8000  Website: http://www.anflocor.com

Trending PHD Dancers Perform at Unang Hirit Must See

PHD Dancers Credit Video: Unang Hirit The PHD Dancers is performing their trending dance steps at Unang Hirit, the Philippine GMA Network Morning News Show, must see their moves which the reason also why they are getting trend and viral. They are just one of the popular dancers perform of the said TV shows in the Philippines, and if you like there moves then please share this post. What is your Opinion about their dance Moves?