Hello George,
This has an option to change the custom loader.
Here is filter to change icon pages wise :
apply_filters( "sap/loader_text", String $loader_text, Intiger $page_id )
Thread Starter
George
(@quantum_leap)
Hi, can you please give me a bit more guidance? I am still not clear on how to load a custom animated icon. Let’s say I have a gif named “loader.gif” inside a folder in my child theme named “images”. How should I use the filter to display that gif instead of the default text “Loading…”?
Thank you.
Thread Starter
George
(@quantum_leap)
I managed to use a filter to change the loading text:
function loading_text() {
return 'Loading posts...';
}
add_filter( "sap/loader_text", 'loading_text' );
But how can I change the text to an image?
Can you please help?
Thread Starter
George
(@quantum_leap)
Got it sorted, here is the code if anyone is interested:
function loading_text() {
$loading_img_url = get_stylesheet_directory_uri() . "/img/loader.gif";
$loading_img = '<img src="' . $loading_img_url . '" alt="loader">' ;
return $loading_img;
}
add_filter( "sap/loader_text", 'loading_text' );