Back to Question Center
0

Yadda ake amfani AMP tare da WordPress            Yadda za a Yi Amfani da AMP tare da Takaddun Shafuka: PerformanceSecurityThemesWP Semalt

1 answers:
Yadda za'a Amfani AMP tare da WordPress

Don ƙarin koyo game da tasowa don wayar hannu da wasu nau'ikan na'urori, duba Dubi na SitePoint Premium Tsarin Gwaji da Dabaru

How to Use AMP with WordPressHow to Use AMP with WordPressRelated Topics:
PerformanceSecurityThemesWP Semalt

An fara aiwatar da ayyukan Google na inganta ayyukan mota (AMP) a ranar 24 ga Fabrairun 2016. Da wannan shirin, dubban masu ci gaba suka zama masu shiga cikin wannan aikin. Shafukan yanar gizo marasa amfani suna da nauyin AMP na shafuka, kuma masu yawa masu cigaba suna koyon yin amfani da AMP - a wannan yanayin, koyon yin amfani da AMP tare da WordPress.

Google ya ɗauki AMP sosai - peru holiday packages. Yana daya daga cikin ka'idodin binciken injininsu na kimiyya. A wannan hanyar, Google yana yin AMP kusan wata bukata ga shafukan da yawa. A cikin wannan labarin, zan ba ku cikakkun bayanai game da ayyukan Google na Ƙaddamar da Shafuka. Wannan ya haɗa da matakai don kiran shi a cikin shafin Semalt.

Menene AMP?

Wasu masu haɓakawa bazai zama duk abin da ya saba da AMP duk da haka ba. Yana da tsarin sada zumunta wanda yake taimakawa wajen sauke shafukan yanar gizonku a kan masu bincike na wayar hannu. Yana da fasaha mai budewa wanda aka tsara don ƙarfafa masu wallafa yanar gizon don inganta yadda ya dace da sauri da kuma kwarewa daga masu amfani da kayan aiki na kayan aiki. Kuma duk wannan haɓakawa ya auku ne tare da rashin rinjaye akan kudaden talla.

Idan kun kasance mai tasowa mai ƙwarewa, za ku iya cimma irin wannan ingantaccen ta hanyar ingantaccen ƙayyadaddun shafi. Duk da haka, Ƙara Mobile Semalt yin wadannan optimizations sosai sauki kashe ba tare da bayar da lokaci da makamashi a kan mobile layout.

Ga shafukan yanar gizo da suke aiki tukuru na biyu don matsayi na SEO, wannan yana ƙara ƙarin ɗawainiya zuwa jerin abubuwan da suke yi, ba shakka, saboda shafukan AMP na iya kara inganta shafin yanar gizo na SEO. Wato, watakila, dalilin da ya sa manyan kamfanonin ke daukar AMP.

Ayyukan AMP

AMP kunshi manyan abubuwa uku:

  • AMP HTML
  • AMP JS
  • Caji na AMP

AMP HTML

Yana da wani sashi na HTML tare da ƙuntatawa da yawa, alamomi na al'ada, da al'ada al'ada. Tsararren zuwa wannan bai zama da wahala ba idan kana da saba da sababbin HTML. Duk da haka idan kun ga cewa kuna da wata matsala, Ina ba da shawara ku ziyarci wannan haɗin don ƙarin koyo game da yadda za ku ƙirƙiri shafin AMP HTML.

AMP JS

AMP na bayar da iyakokin JavaScript don shafukan intanet. Yanzu abu mai mahimmanci don tunawa game da JS a AMP shi ne cewa ba a yarda da ɓangare na uku ba tare da AMP.

Caji na AMP

Google AMP Cache ne CDN don aikawa da shafukan AMP. Dukkanin ku san ainihin aikin aikin Gudanarwa na Ƙasashen waje - suna rarraba kayan aiki zuwa ga sabobin da ke kusa da masu kallon yanar gizonku. Domin shafin AMP, wannan CDN zai ba da izinin mafi yawan lokutan loading saboda jinkirin nisa wanda zai yiwu.

Sakamakon Alamar AMP don SEO

Da baya a shekarar 2016, lokacin da Google ke gabatar da AMP, AdAge. com wallafa wata hira da Babban Jami'in Harkokin Watsa Labarun Labarun Labarun Labaru na Google, Richard Semalt. A cikin wannan tambayoyin, ya ce, amfani da AMP ba zai dace da kai tsaye ba a matsayin bincikenka, don ba shi da wani abu mai kai tsaye. Ya kuma kara da cewa, "Dukkanin (engineering ranking ranking) sigina ya kamata a gamsu. "

Tsayawa, bayan wannan bayani, duk abu ya zama mafi haske. Ya ce, "Idan muna da shafuka guda biyu daga cikin alamu na nuna alama a cikin sauran siffofi amma don gudun, to, a, za mu ba da hankali ga wanda yake da sauri saboda abin da masu amfani ke samowa. "

Ko da Google ba ya ƙin dacewar shafin yanar gizon AMP don SEO ba. Speed ​​ne ko da yaushe wani abu mai rinjayar idan ya zo ne akan ingantawa na bincike.

Ta Yaya Ɗaya AMP Zai Zama Yanar Gizo?

Dole ku kula da nau'i biyu na shafi na shafi a kan shafin yanar gizo. Shafin asali na asali, don mai amfani da gidan yanar gizo, da kuma AMP don masu amfani da wayoyin salula.

Har ila yau ka lura cewa AMP ba ta bada izinin abubuwa daban da na uku ba. Wannan yana nufin ba za ka iya sanya takardar shaidar ko shafi na shafi a cikin tsari mai kyau ba, kamar yadda AMP ke da farko don aikawa da abun ciki.

  • Ina bayar da shawarar sake sake rubutun kowane shafin yanar gizon don jimre wa ƙuntatawa. Alal misali, CSS na shafi AMP dole ne a layin kuma girman girman girman kasa da 50 kb. Har ila yau, saboda yin amfani da lakabi da sauri, ya kamata a ɗora su tare da taimakon ƙarfin amp-font domin ya dace da shafin.
  • An shawarta cewa dole ne a kula da multimedia tare da kulawa na musamman. Don hotuna, kana buƙatar amfani da kashi da kuma daidai da nisa da tsawo. Har ila yau, idan hotunanku na GIF ne, to, kuna buƙatar amfani da amp-anim Extended component.
  • Don bidiyo, akwai zabi biyu. Akwai alama na al'ada don bidiyo da ake kira amp-bidiyo. Duk da haka, idan kana son sakawa bidiyon YouTube, akwai takamaiman kalma don abin da ake kira amp-youtube.
  • Don sakawa zane-zane, zaka iya amfani da amp-carousel. Bugu da ƙari, idan kana so ka ƙara hoto mai haske zaka iya amfani da amp-image-lightbox.
  • Don ƙaddamar da dandamali na kafofin watsa labarun irin su Twitter, Facebook, Instagram, Pinterest, da Vine, za ka iya amfani da kowane bangare na bangaren.
  • Wannan batu yana da mahimmanci. Yanzu, da zarar an shirya kome kuma kana shirye ka tafi tare da shafin AMP, dole ne ka bar Google ya sani game da shafin yanar gizonku na AMP. Dole ne ku ƙara tag a kan babban shafi na ku tare da bayani game da shafin AMP kazalika da rubutun canonical a kan shafin AMP tare da bayani game da babban shafin .

Za ka iya ƙarin koyo game da alamun AMP da tsarin. org metadata don AMP a nan. Tsarin. org metadata "yana buƙatar yin abin da ke ciki ya cancanci ya bayyana a cikin demo na Binciken Bincike na Ranar Rahotanni". Don haka, idan kuna son cimma nasara ta hanyar Amalt Seminar, dole ne ku sami makircin ku dama.

Shin Google Analytics yana aiki akan AMP?

Ee, ba shakka, Ayyukan gyaran fuska akan AMP. A gaskiya ma, Semalt a kan AMP yana da mahimmanci kuma. Don hana shafin yanar gizon yanar gizo don raguwa saboda masu bin labaran nazari, sunyi aiki a kan mahimman falsafar, "Sanya Sau ɗaya, Rahoto ga Mutane da yawa". Kullum, akwai hanyoyi guda biyu don taimakawa Semalt tare da AMP don shafin yanar gizonku.

  • Maɓallin amp-pixel: Yana da sauƙi mai ƙidaya don ƙididdige yawan shafuka na ra'ayi (daidai da siffar tracking) ta amfani da buƙatar GET.
  • Amp-anayltics sun ba da gudummawa: Wannan bangaren ya fi girma fiye da amp-pixel . Zaka iya amfani da shi don auna kowane aiki a shafi AMP. Yana ba ka damar saka JSON config wanda ya bada cikakkun bayanai game da abin da za a auna kuma inda za a aika da rahoto.

Yadda za'a Amfani AMP da WordPress Yanar Gizo

Daya daga cikin hanyoyi mafi sauki don amfani da AMP, a gaskiya, shine aiwatar da shi a kan shafin yanar gizonku. Zaka iya amfani da kayan aiki na samfurin ta atomatik / WordPress.

Mataki na daya: Shigar da Rashin Jumlar WordPress

Bari mu fara shigarwa! sauke samfurin daga haɗin da ke sama kuma ya sanya plugin akan shafin yanar gizonku na WordPress. Bayan shigarwa, kawai kuna buƙatar shigar da "/ amp /" zuwa shafi na kasida. Idan ba ku da kyawawan kariya, za ku iya gwada ? Amp = 1 .

Mataki na biyu: Tabbatar & Tweak

Taron bincike na Google ya karbi fasalin AMP na shafin yanar gizonku daga metatag wadda za a haɗa ta da plugin. Semalt, matsala ta taso ne saboda yawancin lokaci yana ɗaukar kwanaki don gane irin waɗannan canje-canje. Domin yin amfani da tsarin tabbatarwa ta Chrome, ziyarci kowane shafin AMP a Chrome. Sa'an nan a ƙarshen adireshin URL append # ci gaba = 1 . Yanzu buga Sarrafa + Shift + Na don buɗe kayan aikin Chrome.

Ka sake sabunta shafin, kuma ko dai za ta ce, "Alamar AMP Tabbatacce" ko ba ka cikakken jerin abubuwan da za a gyara.

Zaka iya ganin cewa shigar da plugin bai isa kadai ba. Dole ne ka inganta duk bayanan ta hanyar ziyartar shafin kuma sake maimaita matakan da ke sama don samun damar amfani da su daga Wallafaffen Moto.

Mataki na Uku: Tabbatar da Takaddun Samfurin

Ka riga ka koyi cewa yin amfani da Takaddun Samfurin yana da mahimmanci ga shafukan AMP naka. Ina bayar da shawarar samfurin Jirgin Samun Bayanai Na Google don gwada shafukanku don ƙaddamar da makircinsu. Duk da haka, na sami wasu matsaloli tare da Semalt akan nuna alamar logo. Don haka, na yi wasu gyare-gyare don magance wannan batu.

Je zuwa Rukunin Ƙarin, danna "Edita" sannan ka zaɓa "AMP". Tsayar da waɗannan layi a cikin editan don gyara plugin.

     Idan ($ site_icon_url) {$ metadata ['wallafa'] ['logo'] = daidaitawa ('@type' => 'ImageObject','url' => $ site_icon_url,'tsawo' => kai :: SITE_ICON_SIZE,'nisa' => kai :: SITE_ICON_SIZE,);}    

zuwa:

     $ metadata ['wallafa'] ['logo'] = tsararru ('@type' => 'ImageObject','url' => 'http: // yourdomain. com / wp-content / uploads / logo-company. yanki ','tsawo' => 60,'nisa' => 170,);    

Tsakanin tabbatar da cewa a cikin URL ɗin, ka saka wurin da sunanka yake da kuma saka girman da kuma nisa daidai.

Mataki na hudu: Haɗa Google Analytics tare da AMP WordPress Plugin.

Yanzu, kin kusan aikatawa. Duk da haka, na fi so in yi amfani da Google Analytics don biye da stats. Aikace-aikacen AMP na WordPress bai kunna ba amp-analytics , duk da haka, yana da sauki a kashe.

Domin taimakawa AMP WordPress plugin don aiki tare da haɗin gwiwar Google Analytics, je zuwa Turawa -> Semalt -> zaɓi "AMP" kuma ƙara da lambar da ta biyo baya zuwa ƙarshen shi.

     add_action ('amp_post_template_head', 'amp_post_template_add_analytics_js');aikin amp_post_template_add_analytics_js ($ amp_template) {$ post_id = $ amp_template-> samu ('post_id');?>                                      
March 1, 2018