Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:20:41+00:00 2026-06-15T15:20:41+00:00

JetPack by Automatic is a free image editing SaaS tool for WordPress users. One

  • 0

JetPack by Automatic is a free image editing SaaS tool for WordPress users. One of its many features is that you can alter the subdomain of the image url being returned to enhance parallel loading of multiple srcs. The three domain options are: “i0”, “i1” and “i2”.

If each photo appears in a foreach statement how can I rotate between the three subdomains so that img1 & img4 use “io”, img2 & img5 use “i1” and img3 uses “i2”?

foreach ($images as $attachment) {

    // If using Photon select full-size photos
    if ( $use_photon == 'one' )
        print $before_img . '<img src="http://i1.wp.com/'. str_replace('http://', '', $$fullsizeurl ) . $resize_img_to .'">' . $after_img;

    // Else select 'medium' thumbnail
    else
        print $before_img . wp_get_attachment_image( $attachment->ID, 'medium' ) . $after_img;

} // foreach
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:20:42+00:00Added an answer on June 15, 2026 at 3:20 pm

    Use the ‘%’ operator on the index of the image. It is the best way to do it.

    foreach ($images as $i => $attachment) {
    
        $host = 'i' + ($i % 3);
        // If using Photon select full-size photos
        if ( $use_photon == 'one' )
            print $before_img . '<img src="http://'. $host .'.wp.com/'. str_replace('http://', '', $$fullsizeurl ) . $resize_img_to .'">' . $after_img;
    
        // Else select 'medium' thumbnail
        else
            print $before_img . wp_get_attachment_image( $attachment->ID, 'medium' ) . $after_img;
    
    } // foreach
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to convert a FF Jetpack extension to a chrome's one? I've
I currently have a custom themed blog running on wordpress with Jetpack installed. I
I'm making a bookmarks extension for Firefox, I figured out that with Jetpack I
using Mozilla jetpack , when i do the following code .. i get that
i have some problem in firefox add-on/jetpack. There its the event listener: tab.on('deactivate', cleardata);
I'm using the Jetpack theme in an application that some use of Datagrids. When
I'm new to the jetpack world (and firefox extension for that matter) and while
After creating a new Silverlight application from the JetPack theme template that was installed,
In a Firefox extension using jetpack , I have a panel with a contentScript
In git I can git remote add x http://... then git pull x how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.