Here is an example, a page with a product, under the product there is a tab FABRIC FABRIC. http://mebelcheap.ru/product/evroknizhka-transformer

It has 500+ pictures. And they are loaded together with the site, and not when the tab is opened (there are also sub-tabs in it).

This vlkadka made through custom fields. How can you make these pictures loaded when you click on the link?

    1 answer 1

    Through ajax , by itself. You have a long html code in the tab "Select fabric". It is necessary to leave only the button "0 category" ... "Bitel". When you click on a button, a function in javascript should be triggered, which calls the php function on the server via ajax . This function on the server should generate an html code for the tissues of the requested category and return it to javascript , where it will be inserted into the site, on the tab "Select fabric", after all buttons.

    There is no other way.

    Read about ajax on WordPress here .

    • Thank. Is PHP necessarily to be known in this case, to fix it or can it be done via Javascript / jquery? - The Os
    • 2
      No, you can not only via javascript. The whole idea is not to load 500 images when loading the page, and then do it in the necessary parts. And where to get these pictures in javascript and browser, if they are not loaded? They should be requested from the server. - KAGG Design
    • If the answer is useful, you can mark it as accepted - KAGG Design