How to limit the number of wordpress posts just for mobile ?
I am using WPscript and I want to limit the number of posts for the mobile version of the website.
So far I found this code and placed it in the functions.php file. It doesn't do anything, I think it should be placed elsewhere. Any ideas? Code:
|
Bump for you.
|
change 10 to 5 and see what happens?
|
Quote:
|
you are planing to change it for archive / category listing? well can be done by custom coding (not a big) with good mobile detection plugin.
for example https://wordpress.org/plugins/custom-content-shortcode/ this plugin can do this. |
PHP Code:
Have you tried search => https://stackoverflow.com/questions/...ust-for-mobile he says this worked ;) |
Quote:
Quote:
|
Quote:
tnx. |
For my logo I use CSS to display a different one according to the width size of the screen.
.logo1 {display:block;} .logo2 {display:none;} @media (min-width: 1150px) { .logo1 {display:none;} .logo2 {display:block;} } Then in the header I put both logo <div class="logo1"><img src="logo1.png" width="118px" height="50px" /></div> <div class="logo2"><img src="logo2.png" width="500px" height="80px" /></div> If you do something similar for your blog content you should be able to get what you want using a different WP_Query in the two loops https://codex.wordpress.org/Class_Reference/WP_Query |
All times are GMT -7. The time now is 11:40 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc