WordPress: Buga Labaran Gaba kamar abubuwan da ke zuwa

WordPress

Mun gina micro-site na WordPress don Blogging na Kamfani don Dummies kuma muna so mu sami wani ɓangare inda muka nuna abubuwan da ke zuwa a cikin ƙananan labarun gefe. Maganin yin wannan hakika yana da sauki kuma an gina shi kai tsaye cikin WordPress. A cikin jigogin ku, zaku iya ƙara madauki wanda kawai tambaya ne da kuma nuna sakonnin gaba don takamaiman rukunin da kawai ake amfani dashi don Abubuwan da zasu Faru na Nan gaba:

<?php query_posts('order=ASC&cat = 3 & post_status = nan gaba, buga '); idan (da_ posts ()): yayin ((da_ posts ()): the_post (); idan (strtotime (samu_the_time ("F jS Y"))> lokaci ()): ci gaba; wani: amsa kuwwa $ post-> id; ?>

An sanya hanyar tambaya_posts gab da madaidaicin WordPress don iyakance sakonnin da aka buga zuwa tambayar da aka yi amfani da ita. Tunda waɗannan su ne abubuwan da aka tsara na gidan yanar gizo na gaba (a ranar taron), ba lallai bane ku damu da yadda ake nuna su akan babban shafin yanar gizan ku a cikin samfurin ku. Kuna so ku ɓoye nau'ikan daga jerin rukuninku, kodayake. Ana iya kammala wannan ta hanyar gyara jerin rukunoninku a cikin samfurin WordPress ɗinku ta amfani da zaɓi ban da:


Mun kuma ƙara metadata don gidan don nuna wuri don taron. Ana kammala wannan ta amfani da sashin WordPress 'Custom Fields section. Kawai a buga wuri don sunan filin da kuma wurin da kuke don ƙimar… sannan ku dawo da wurin don nunawa ta amfani da umarnin get_post_meta da ke sama.

Sakamakon shafin yana da kyau sosai, tare da tsari na musamman da shimfidawa wanda ke da dukkanin abubuwan da ake buƙata don inganta littafin:
Nasihu game da Blogging na Kamfanin.png

3 Comments

  1. 1

    Hakanan mun gina kayan abinci na al'ada tare da abubuwan da zasu faru nan gaba da aka sanya da kuma sabunta tsarawar taswirar XML don buga abubuwan da za su zo nan gaba. Idan kuna amfani da Generator na XML na Generator na Arne Brachenwald, layi na 1747 na sitemap-core.php za a iya sabunta shi zuwa $where.=” (post_status IN ('publish','future') AND (post_type = 'post' OR post_type = ”)) “;

  2. 2

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.