« first day (2594 days earlier)      last day (2346 days later) » 

7:11 AM
Hello
 
 
2 hours later…
9:07 AM
Good morning good people :)
 
9:47 AM
Any of you guys have experience with wp-cron.php (Cron jobs in wordpress)
 
10:13 AM
@R1ddler what's up mate
 
Hey @JackJohansson. Working with cron jobs
 
any problems?
 
Do you have any experience with setting up cron jobs on wordpress?
I've have used cron jobs before with php
 
yes a dozen of times
 
but not with wordpress
I only need it executed once a day
I'm using the accuweather api that retrieves the temp for the past 24hrs given a city/location
 
10:16 AM
add_action( 'init', 'my_function' );
function my_function() {
	if ( ! wp_next_scheduled( 'your-action-hook' ) ) {
		wp_schedule_event( strtotime( '00:00:00' ), 'daily', 'your-action-hook' );
	}
}

add_action( 'your-action-hook', 'your_callback_function' );
all you need
and your_callback_function will run every day on 00:00
 
10:27 AM
@R1ddler Is the code clear? Or does it need any explanation?
 
sry a colleague needed assistance
 
what is 'your-action-hook'?
is it the function that uses the api?
that i will schedule
 
it's the custom action hook that will be enqueued every 24 hours
and when it's run, it will run the your_callback_function
which is where you need to process the weather data.
 
so your_callback_function is where i put my code that uses the API
 
10:37 AM
Yes
 
Thanks
I'll give it a spin
 
no problem
 
where's your avatar from? looks familiar
 
I have it on a hundred of more accounts everywhere
 
 
2 hours later…
12:53 PM
sockpuppets?
 
 
5 hours later…
6:01 PM
Is there a way to control the rendering order of HTML elements on a page? For example: Load <header>, then load <main>, then load <footer>...
I have HTTP2 enabled, but there are other elements further down on the page which are stealing load times from more important elements earlier on at the top of the page, which is what the first user sees when clicking to a new page.
 
 
3 hours later…
9:32 PM
@MichaelEcklund Have you looked into any HTML pre-processor like pug?
This article might be useful.
 

« first day (2594 days earlier)      last day (2346 days later) »