WordPress Eğitimi: Ahoana no Mamorona Torohevitra Mahaliana Flash Flip

Fanamarihana: Tsy manohana ity WP eklentisi ity intsony isika raha tsy manoratra ho antsika ny mpanoratra amin’izao fotoana izao.

Manomboka androany, isan-kerinandro isika dia hanolotra lesona mahatalanjona kodlama, mampianatra anao ny fomba fanaovana zavatra manokana amin’ny fampiasana WordPress, avy amin’ny fototra mankany amin’ny fandrosoana. Androany Dia hamorona plugin izahay (mba hahalalanareo ny dingana fototra amin’izany) mba hamoronana galerie "sayfa çevirme", mampiasa JS.

Azoko an-tsaina fa nahita iray tamin’ireo tao amin’ny tranonkalanao ianao tamin’ny voalohany, saingy nampiasana flash izy ireny, izy tsy misy intsony izany (mbola manan-danja ihany izy io, fa tsy ny safidy tsara indrindra an ‘ ity karazana zavatra ity intsony).

Ny fanalahidy fototra dia hamorona vaovao karazana galeria mifototra amin’ny sary vitsivitsy sy ny habeny, amin’ny alalan’ny kod kodu.

Andao atomboka dieny izao!

Zip & Fametrahana

Ny fomba tsara indrindra hijerena azy amin’ny asa dia mametraka azy manokana. Ianao dia afaka buradan indirebilirsiniz. Mametraka sy manantona ny eklentisi, amin’izay ny zavatra tokony hataonao dia ny manampy ny kod kodu amin’ny pejy, oyuncak ity:

[flip_book kimlikleri = "78 79 78 79 79 78 78 79 79" genişlik = "78" yükseklik = "300" display = "çift"]

Hızlı Önizleme

Ary izao no vokatra mety ho azonao:

Hareketli Fotoğraf Efekti

Fa inona kosa ny majika mainty tonga ao? Eny ary, tena tsotra tsotra izao. Andao hianatra ny fomba hamoronana zavatra oyuncak izany.

Başlık

Voalohany indrindra ianao dia mila mamorona tranokala vaovao sy vaovao iray vaovao. Amin’ity fotoğraf merhamet dia hahagaga raha manana tontolo iainana fitsapana ianao, noho dia afaka mamotika sy mamandrika zavatra ianao.

Ny rakitra sy ny lahatahiry dia tokony hanana anarana tsotra sy miavaka, ka tsy hifanohitra amin’ny eklentileri efa misy. Avy eo ny votoatin’ny fotodrafitrasa misy anay dia oyuncak izao:

/ * Eklenti Adı: FlipBook Galeri Açıklama: Mamorona kaody fohy ho an’ny flipbook galerileri. Sürüm: 1.0 Mpanoratra: Web Revenue Blog Lisansa: GPL2 * /

Tena tsotra, ha? Raha vao mamorona ity rakitra ity ianao dia hahita ny eklentisi anao ao amin’ny lisitry ny WP admin> Eklentiler, ary afaka manaisotra azy ianao (saingy raha manana izany votoaty ao amin’ny rakitrao ianao dia tsy hanova betsaka ny tranonkalanao).

Arama komut dosyaları

Amin’izao fotoana izao isika dia mila ampidirina zava-dehibe sasany herhangi bir ivelany. Ireo antontan-taratasy ilaina ho an’ny fandefasana fotoğrafları:

  • jQuery (1.9 +)
  • Turn.js komut dosyası
  • Hanova fomba fanao fototra

Raha ampidirinao fotsiny ny script sy ny stil etiketler dia misy olana sasany. Ohatra, ny fiantsoana jQuery indroa dia mety hamaky ny tranonkalanao. WordPress Iman Koa Dia Tsy "hahalala" fa efa namorona ireo zavatra ireo, ka raha misy eklentisi hafa miantso turn.js indray na fomba hafa dia handrava ny tranokalanao.

Izany hayır antony tokony hampiasantsika mandrakariva ny wp_enqueue_script sy ny wp_enqueue_style asa. Ity ny fototra ampiasaina:

işlev plugin_scripts () {wp_enqueue_script (‘jquery’); wp_enqueue_script (‘miova’, plugins_url (‘js / turn.js’, __FILE__), dizi (‘jquery’), ‘1.3’, diso); wp_enqueue_style (‘turnCSS’, plugins_url (‘css / style.css’, __FILE__), diso, ‘1.3’, ‘tümü’); }

Miantso ireo zavatra hafahafa amin’ny 3 izahay, dia ireto:

  • Daha fazla bilgi jQuery – Tsy mila mametraka safidy marobe isika raha fantatsika fa ny Kelime "Züppe, ity script ity dia tokony eto raha tsy ny code hayır tsy asa "
  • Mamorona sora-tanana vaovao – ianao dia tokony handalo toetra sasantsasany oyuncak ny anarana, ny toerana misy ny rakitra, ny zavatra ilaina (amin’ity raharaha ity dia mandefa jQuery), sürüm, ary raha ampidirina ao amin’ny altbilgi na header (yanlış = üstbilgi, true = altbilgi)
  • Mamorona fomba vaovao – Mafy oyuncak ny teo aloha, ary misy fahasamihafana kely amin’ny toetra farany, izay milaza fa ny medya dia manondro ity tarzı ity raha toa ka

Ny iray amin’ireo zava-dehibe tokony hoeritreretinao rehefa miantso scriptler eksterna ianao dia misy kodu hafa izay miankina amin’io eklentisi io. Izany indrindra hayır hamaritana raha ny lohateninao dia hantsoina amin’ny lohateny na footer.

Amin’ny tranga misy antsika, misy sora-tanana maro hafa hananganana galeria raha vao noforonina ny HTML, ary ampiana ao amin’ny vatany izany. Izany no mahatonga antsika mametraka ity script ity eo amin’ny loha, raha tsy çapa mbola misy ny fehezan-dalàna antsoina çapa "çevirmek".

Aorian’ity code-tsara ity dia ilaintsika ny miteny WordPress mba hamenoana azy ireo amin’ny sora-baventy, ny hetsika "wp_enqueue_scripts" dia hanao izany:

add_action (‘wp_enqueue_scripts’, ‘plugin_scripts’);

Ny Kısa Kodu

Andeha isika hanomboka amin’ny hetsika mba hamoronana ny kod kodu. Tsotra tsotra izao, mila ampidirinao fotsiny ny fandefasam-peo fohy, ary ny asa izay hovonoina:

kısa kod ekle "flip_book", "create_flip_book");

Ankehitriny dia mila mamorona ny asantsika isika ary mahazo ny toetrantsika. Fa ny sasantsasany amin’ireo toetra ireo dia mety ho azo atao, izay midika fa mila mamorona fitsipika fototra ho azy ireo isika. Afaka mamorona betsaka isika raha toa ka misy ny fitsapana raha tsy misy ny toetra, fa iray amin’ireo tranga izay mety tsara kokoa noho ny mahazatra raha antsoina.

Ny hetsika Ternergy dia tsara raha toa ny fanambarana mivantana amin’ny sandan’ny fari-dalany. Raha Manaraka ity rafitra ity:

$ değişkenler = (CONDITION)? "MAHALALA NY FAHAMARINANA ISIKA": "MAHALALA FA TSY MANAIKY NY FITIAVANA";

Azonao atao ny mahita azy ireo eo amin’ny sehatra voalohany amin’ny asantsika:

fonksiyon create_flip_book ($ attr) {// Manomana ireo IDs mba handraisana dizisi $ ” ” = patlayabilir ("", $ attr [‘ids’]); // görüntü modu $ dizi [‘display’] = foana ($ attr [‘display’])? "tokara": $ attr [‘display’]; // marim-pejy // malalaka $ dizi [‘width’] = foana ($ attr [‘width’])? 400: $ attr [‘genişlik’]; // height $ dizi [‘haavo’] = foana ($ attr [‘height’])? 300: $ attr [‘haavo’]; // HTML sy ny sisa amin’ny kod dia mandeha eto}

HTML boyutunda HTML boyutlarında, daha fazla bilgi için tıklayın. Ny hevi-dehibe iray lehibe eto dia ny fanitsiana ny habeny raha mampiasa ny dergisi (tokony ho 2x ny sakany satria manana sary 2 fa tsy iray):

<? php if ($ dizi [‘display’] == "çift") {$ dizi [‘genişlik’] = $ dizi [‘genişlik’] * 2; } // HTML, JS sy Kara Büyü?> <? Php için ($ i = 0; $ i < div> <? php echo wp_get_attachment_image ($ dizi [‘ids’] [$ i], ‘feno’); Raha ($ dizi [‘display’] == "tokara") {?> <? = "". ($ i + 1)? / /? aho, + 1)?> / <? Eko "" .sizeof ($ array [‘ids’]); jQuery ("# Flipbook"). , autoCenter: true, görüntüleme: ‘<? php echo $ dizi [‘ekran’]; php echo $ dizi [‘genişlik’]; ?> ‘, // pejy tokana na pejy fanaparitahana: marina, degradeler :! jQuery.isTouch,});

Inona ny hevitrao?

Azonao atao ny mamaky sy manova izany araka izay irinao, manampy ireo safidy maromaro (jereo ny ohatra tsara azon’izy ireo hahazoana fitaomam-panahy bebe kokoa), manitsy izay tsy miasa ho anao, na mampifandray izany amin’ny eklentileri hafa.

Manana hevitra WordPress ve ianao mba te hianatra bebe kokoa? Angamba zavatra tianao hianaranao hatao? Ampahafantaro anay amin’ny alalan’ny fanehoan-kevitra ary ho faly izahay hampiditra izany ao amin’ny lahatsoratra manaraka!

Jeffrey Wilson Administrator
Sorry! The Author has not filled his profile.
follow me