Irƙiri Gajerun hanyoyi don takenmu na WordPress

Tunda muka fara da wannan aikin, a koyaushe muna son shi ya sami taken namu, kuma wannan shine dalilin da yasa samfuri na biyu da muke amfani dashi DagaLinux, mu muka kirkireshi 100%.

Sannan wasu sifofin sun biyo baya, kuma kodayake zamu iya saye ko yin hayar wasu sabis ɗin yanar gizo don ƙirƙirar ƙirarmu kamar na StudioDWeb.com, ko saya samfura waɗanda aka riga aka ƙirƙira a ciki JJesan.net, koyaushe muna son samun namu, wanda ya dace da bukatunmu kuma ya tsaya WebDevelopment.com na iya zama taimako 😀

Koyaya, Ina da sha'awar Tsarin Yanar Gizo da Ci Gaban, kuma tuni nafara aiki akan sabon batun DagaLinux kuma zan nuna muku wasu Screenshots na yadda yake.

Tunanin ba shine mu fita daga abin da muka riga muka saba dashi ba, don haka abubuwa da yawa suna kasancewa iri ɗaya ko kuma a cikin hanya ɗaya. Na fara da shafin gida

sikirin-dl

Kuma wannan shine abin da labaran zasu yi kama:

sikirin-dl-post

Kamar yadda kuka gani, yana dacewa da ma'auninmu kuma mun haɗa da sababbi Kawait don bayani kan labaran.

Abin da ya sa ya zama a gare ni in raba tare da ku yadda za ku ƙirƙiri ɗayansu (bayanin ɗaya) idan kuna son haɗa su a cikin batutuwanku WordPress. Ina nufin, wani abu kamar haka:

Wannan zai zama misali ShortCode

Ni ba gwani bane a cikin shirye-shirye tare da wannan CMS, don haka ba zan yi kokarin bayyana dalilin da yadda yake aiki ta wannan hanyar ba, zan nuna muku yadda ake yin sa, lokaci.

Saboda wannan muke yin amfani da «wuƙar sojojin Switzerland» na WordPress, Ina nufin fayil din aiki.php cewa yawanci muna samun kusan dukkanin batutuwa.

Brackets_Aiki

Misali na Aiki.php tare da ShortCodes na DesdeLinux

Abin da za mu yi a cikin wannan fayil ɗin shine ƙara tsarin ShortCode ɗinmu kuma ba shakka, lakabin da yake nuna shi. Don haka bari mu je wurin.

A Cikin Ayyuka.php

A cikin fayil ɗin mu na aiki.php abin da za mu saka zai zama tsarin HTML na ShortCode, amma ba kawai sanya alamun HTML kawai haka ba. Muna da wani abu kamar haka:

// Bayanin aiki na Info ($ atts, $ abun ciki = mara kyau, $ lambar = "") {$ dawo = ' '; $ dawowa. = $ abun ciki; $ dawo. = ' '; dawo da $ dawo; } // ShortCode add_shortcode ('info', 'infobox');

Daga nan mun bayyana abubuwa biyu. Na farko, lokacin da muke amfani da sanduna biyu muna yin sharhi game da layin, saboda haka // Bayani tsokaci ne kawai.

Sunan aikin, a wannan yanayin akwatin bayani Ana iya canza shi zuwa duk abin da muke so, amma dole ne ya dace da sunan da muke amfani da shi a layin ƙarshe.

A cikin kowane $ dawowa zamu dawo da alamun HTML, kuma dole ne mu tuna cewa bayan na farkon, dole ne mu ƙara wani lokaci a gaban daidai alama kuma layin ya ƙare da alamar wasan kwaikwayo

Alal misali:

$ dawowa. = $ abun ciki;

M $ abun ciki wanda shine inda abubuwan da muka sanya a cikin ShortCode suka tafi ta tsoho zai dawo da darajar banza idan bamu saka komai ba.

Yanzu sunan ShortCode shine abin da muka saita tare da:

add_shortcode( 'info', 'infobox' );

Inda zaka iya canzawa info ga abin da muke so. Yanzu, don yin kama da misali dole ne mu sanya:

[ info ]Este será el ShortCode de ejemplo[ /info ]

Kodayake tabbas, ba tare da sarari ba, wanda na sanya saboda a fili za'a kunna ShortCode.

Salon ShortCode

Idan ka duba layin da ke sama, ba tare da lambar PHP da masu canji ba, ShortCode a cikin tsarkakakken HTML zai zama kamar haka:

<div class="alert-info"></div>

Don haka dole ne kawai muyi amfani da salon CSS.

.alert.alert-info {background: # d9edf7 url (info.png) ba-maimaita 7px 50%; iyakar-radius: 4px; iyaka: 1px m # bce8f1; launi: # 3a87ad; font-size: 14px; gefe: 15px 15px; padding: 15px 15px 15px 50px rubutu-daidaita: hagu}

Kuma hakane .. Na maimaita, Ni ba mai shirya shirye-shirye bane ko wani abu makamancin haka, kuma bayanin da nayi shine yadda na fahimci cewa ShortCode yana aiki 😛


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

9 comments, bar naka

Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.

  1.   wanda ya rage 72 m

    Ina son yadda yake, ina taya ku murna.

    1.    kari m

      Na gode, kuna da jan aiki amma na gode.

  2.   Rogers m

    Yayi kyau sosai !! Ina son irin wannan taken a cikin WP.
    Ina taya ku murna!

    1.    kari m

      Ban sanya shi ba tukuna, zan iya siyar muku da shi HAHAHAHAHA .. Wasa kawai 🙂

  3.   Manuel E m

    Madalla, godiya ga rabawa.
    Irin wannan albarkatun ana matukar buƙata akan yanar gizo, suna bayyana abubuwa sarai.

    Na gode!

  4.   lokacin3000 m

    Kyakkyawan zane. Bari mu gani idan don rukunin yanar gizo na za ku iya ba ni wannan samfurin don tsara shi.

  5.   hankaka291286 m

    ana iya yin hakan a cikin blogger?

  6.   Javier m

    Da kyau, ba komai, Na sanya shi yadda yake kuma ba ya aiki a gare ni, menene zai iya zama? : /

    Na sanya bayanai [info] [/ info]

    kuma a cikin rubutun kalma na ya bayyana ne kawai: bayani, kwalliya sun ɓace, Ina tsammanin wani abu ba daidai bane: /

    1.    Johnny Silva m

      Wataƙila a cikin samfurinku ba a bayyana ShortCodes a cikin function.php kamar a nawa ba, an ƙara waɗannan ƙimomin a cikin fayil ɗin da ake kira shortcodes.php na jigona