Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 09-29-2017, 08:41 AM   #1
maidenphoenix
Registered User
 
maidenphoenix's Avatar
 
Industry Role:
Join Date: Sep 2017
Posts: 46
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:
add_action('pre_get_posts','change_limit_mobile');

function change_limit_mobile($query){

    $new_limit = 10;

    $iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
    $android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
    $ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
    $berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
    $ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");

    if (( $iphone || $android || $ipad || $ipod || $berry ) && $query->is_main_query()){
        set_query_var('posts_per_page',$new_limit);
    }
}
__________________
Is your step-mom hot? Watch this with her...
Buy and Sell adult traffic with Plugrush | Popcash | Trafficjunky |
Earn $$$ with the best adult CPA network
Crackrevenue
maidenphoenix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 12:13 AM   #2
Denny
Too lazy to set a custom title
 
Denny's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 14,629
Bump for you.
__________________
My TOP money making webcam program (Earn up to $130 Per order / 35% revshare)


Denny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 07:32 AM   #3
Barry-xlovecam
It's 42
 
Barry-xlovecam's Avatar
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 17,493
change 10 to 5 and see what happens?
__________________
Vive la résistance -- Carpe diem

"If you only knew the power of the dark side." ...Darth Vader
Sk.why.pe: barry_555_5 -- ICQ: three1896three617
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 08:25 AM   #4
maidenphoenix
Registered User
 
maidenphoenix's Avatar
 
Industry Role:
Join Date: Sep 2017
Posts: 46
Quote:
Originally Posted by Barry-xlovecam View Post
change 10 to 5 and see what happens?
Changed it, nothing happened.
__________________
Is your step-mom hot? Watch this with her...
Buy and Sell adult traffic with Plugrush | Popcash | Trafficjunky |
Earn $$$ with the best adult CPA network
Crackrevenue
maidenphoenix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 08:36 AM   #5
magneto664
Confirmed User
 
Industry Role:
Join Date: Aug 2014
Location: Glasgow
Posts: 278
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.
__________________
magneto664 [x] gmail.com
CAMS.IS - Buy Premium Cam Domain!
GET FREE ADULT BACKLINKS - My Fav: chaturbate - dateprofits - datetronix
magneto664 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 10:20 AM   #6
Barry-xlovecam
It's 42
 
Barry-xlovecam's Avatar
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 17,493
PHP Code:
set_query_var('posts_per_page',$new_limit); 
.

Have you tried

search => https://stackoverflow.com/questions/...ust-for-mobile he says this worked ;)
__________________
Vive la résistance -- Carpe diem

"If you only knew the power of the dark side." ...Darth Vader
Sk.why.pe: barry_555_5 -- ICQ: three1896three617
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 11:07 AM   #7
maidenphoenix
Registered User
 
maidenphoenix's Avatar
 
Industry Role:
Join Date: Sep 2017
Posts: 46
Quote:
Originally Posted by magneto664 View Post
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.
Thanks, I will check this. I am considering a global solution that would change both categories and archives to a predefined number of posts. I want to increase the advertising potential for mobile and displaying over 20 posts reduces earnings.

Quote:
Originally Posted by Barry-xlovecam View Post
PHP Code:
set_query_var('posts_per_page',$new_limit); 
.

Have you tried

search => https://stackoverflow.com/questions/...ust-for-mobile he says this worked ;)
This is exactly where I got the code and it's not working for me. As I aforementioned I am using the WPscript theme.
__________________
Is your step-mom hot? Watch this with her...
Buy and Sell adult traffic with Plugrush | Popcash | Trafficjunky |
Earn $$$ with the best adult CPA network
Crackrevenue
maidenphoenix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-03-2017, 12:14 PM   #8
magneto664
Confirmed User
 
Industry Role:
Join Date: Aug 2014
Location: Glasgow
Posts: 278
Quote:
Originally Posted by maidenphoenix View Post
I want to increase the advertising potential for mobile and displaying over 20 posts reduces earnings.
So then use mobile detection plugin and inject on the top of the category or under the title or on the bottom a mobile / pc version of the ads. I do always it for mobile version i put widget area with 300x250 advert just under the category title.

tnx.
__________________
magneto664 [x] gmail.com
CAMS.IS - Buy Premium Cam Domain!
GET FREE ADULT BACKLINKS - My Fav: chaturbate - dateprofits - datetronix
magneto664 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-07-2017, 10:07 AM   #9
Smart Fred
Confirmed User
 
Smart Fred's Avatar
 
Industry Role:
Join Date: Mar 2008
Location: France
Posts: 270
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
__________________
Stop doing what you like and start doing what brings you money!
Smart Fred is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
$android, $berry, $ipod, posts, mobile, wordpress, limit
Thread Tools




©2000-, AVN Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.