2019-09-24_141559

The BunnyCDN plugin (WordPress.org) is a great tool for replacing static resource URLs with CDN links, improving website speed and performance. It works seamlessly for most WordPress sites, but if you’re using the “Paged Style” reading mode in WP Manga Chapter Reading, you might notice an issue: the next/previous image links may not function correctly. This happens because the BunnyCDN plugin does not replace image URLs properly in this specific mode.

How to Fix the BunnyCDN URL Issue in Paged Style Reading Mode

To ensure that BunnyCDN correctly replaces the chapter image URLs, you need to add a simple code snippet to your functions.php file. For best practice, add it to the functions.php file in your child theme to prevent losing changes after theme updates.

Here’s the code snippet to fix the URL replacement issue:

php
add_filter('wp_manga_chapter_image_url', 'my_wp_manga_chapter_image_url', 100, 5);
function my_wp_manga_chapter_image_url($url, $host, $link, $post_id, $name){
$your_domain = 'yourdomain.com';
$your_bunny_cdn = 'xxx.b-cdn.net';
$url = str_replace($your_domain, $your_bunny_cdn, $url);
return $url;
}

Steps to Implement:

  1. Copy the above code snippet.
  2. Open your functions.php file in your child theme.
  3. Paste the code and replace 'yourdomain.com' with your actual domain.
  4. Replace 'xxx.b-cdn.net' with your actual BunnyCDN URL.
  5. Save the changes and clear your cache.

Additional Notes on Using BunnyCDN Plugin

  • The BunnyCDN plugin only replaces URLs, but your images remain stored on your original server.
  • If you want to completely offload images to BunnyCDN (to save storage space), consider using the WP Manga FTP Storage Add-on: Get it here.
  • Ensure that your CDN is properly configured to deliver optimized performance.

By following this guide, you can seamlessly integrate BunnyCDN with WP Manga and prevent any issues with chapter images in Paged Style Reading Mode.

SHARE THIS POST

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

9 − one =