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
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-07-2009, 05:53 AM   #1
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,382
wordpress tip: control when your posts are displayed in your rss feed

The problem. Have you ever published an article and then immediately noticed an error? Sure, you can edit it, but there?s another problem: the article has already been published in your RSS feed. To avoid this kind of problem, use this recipe to create a delay between the publication of a post and its availability in your RSS feed.

The solution. To apply this hack, simply paste the following code into your theme?s function.php file. If your theme doesn?t have this file, just create it.

Code:
function publish_later_on_feed($where) {
	global $wpdb;

	if ( is_feed() ) {
		// timestamp in WP-format
		$now = gmdate('Y-m-d H:i:s');

		// value for wait; + device
		$wait = '5'; // integer

		// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
		$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

		// add SQL-sytax to default $where
		$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
	}
	return $where;
}

add_filter('posts_where', 'publish_later_on_feed');
Code explanation.

The above code will add a 5-minute delay to the time between when your post is published on your blog and when it appears in your RSS feed. To change the length of the delay, change the value of the $wait variable on line 9.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 06:00 AM   #2
StaceyJo
Confirmed User
 
StaceyJo's Avatar
 
Join Date: Mar 2008
Posts: 8,960
Thanks. I bookmark this for future use.
__________________
/_______ WebCashMaker ______\
| _TeenageDecadence - Young Board Naked Teens. |
| ____ NonNudeGirls - Female Puberty Photos. ____ |
| _ HerSelfPics - The ORIGINAL exGF SelfPic site. __ |
\.______ xPosing - Wife Photosharing site. _______./
StaceyJo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 06:01 AM   #3
munki
Do Fun Shit.
 
munki's Avatar
 
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
The wordpress ninja strikes again...
__________________

I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde
munki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 06:37 AM   #4
tranza
ICQ: 197-556-237
 
Join Date: Jun 2003
Location: BRASIL !!!
Posts: 57,559
Nice tip man....thanks!
__________________
I'm just a newbie.
tranza is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 07:53 AM   #5
Ethersync
Confirmed User
 
Ethersync's Avatar
 
Join Date: Mar 2008
Location: London, Saint-Tropez, Bermuda, Moscow
Posts: 5,289
Gracias..
Ethersync is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 08:33 AM   #6
StaceyJo
Confirmed User
 
StaceyJo's Avatar
 
Join Date: Mar 2008
Posts: 8,960
wow...thanks for this tip...
__________________
/_______ WebCashMaker ______\
| _TeenageDecadence - Young Board Naked Teens. |
| ____ NonNudeGirls - Female Puberty Photos. ____ |
| _ HerSelfPics - The ORIGINAL exGF SelfPic site. __ |
\.______ xPosing - Wife Photosharing site. _______./
StaceyJo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 09:35 PM   #7
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
thanks for sharing :D
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-07-2009, 10:42 PM   #8
teg0
Confirmed User
 
teg0's Avatar
 
Join Date: Jan 2006
Location: Gringo in Puerto Rico
Posts: 4,204
nice idea, but Im thinking its not the best implementation since it requires activity on your blog sometime after 5 minutes as past for the update query to run
teg0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2009, 01:38 AM   #9
KillerK
Confirmed User
 
Join Date: May 2008
Posts: 3,406
Are you being helpful cause your brother rips people off?
KillerK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2009, 05:41 AM   #10
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,382
Quote:
Originally Posted by KillerK View Post
Are you being helpful cause your brother rips people off?
Do you ever say anything useful?

And the answer is no.

Go back to being a troll
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2009, 07:56 AM   #11
Tjeezers
Webmaster
 
Tjeezers's Avatar
 
Industry Role:
Join Date: Mar 2007
Location: BP4L - NL/RO
Posts: 16,594
Thanks for sharing
__________________
Enroll in the SWAG Affiliate Asian Live Cam Program and get 9 free quality linkbacks from my network!
Wanna see how old school I am? Look at this! All my Cam Review Sites are here.
Tjeezers 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



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.