Title: Custom loading icon
Last modified: September 19, 2020

---

# Custom loading icon

 *  Resolved [George](https://wordpress.org/support/users/quantum_leap/)
 * (@quantum_leap)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-loading-icon/)
 * Is it possible to include a custom loading animated icon and center it on the
   container?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Milan Hirapra](https://wordpress.org/support/users/milanhirapra1/)
 * (@milanhirapra1)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-loading-icon/#post-13433853)
 * 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](https://wordpress.org/support/users/quantum_leap/)
 * (@quantum_leap)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-loading-icon/#post-13434327)
 * 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](https://wordpress.org/support/users/quantum_leap/)
 * (@quantum_leap)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-loading-icon/#post-13503107)
 * 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](https://wordpress.org/support/users/quantum_leap/)
 * (@quantum_leap)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/custom-loading-icon/#post-13505049)
 * 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' );
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom loading icon’ is closed to new replies.

 * ![](https://ps.w.org/simple-ajax-pagination/assets/icon-256x256.png?rev=3316287)
 * [Simple Ajax Pagination](https://wordpress.org/plugins/simple-ajax-pagination/)
 * [Support Threads](https://wordpress.org/support/plugin/simple-ajax-pagination/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-ajax-pagination/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-ajax-pagination/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-ajax-pagination/reviews/)

## Tags

 * [loading icon](https://wordpress.org/support/topic-tag/loading-icon/)

 * 4 replies
 * 2 participants
 * Last reply from: [George](https://wordpress.org/support/users/quantum_leap/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/custom-loading-icon/#post-13505049)
 * Status: resolved