WordPress rel = ”prev” da rel = ”na gaba”

google mai kula da gidan yanar gizo s

Da yawa 'yan shekarun da suka gabata, masu goyon baya za su iya daidaita shafukan su ta amfani da dabarar da ake kira balaga. Ainihin, idan kun rubuta rel = ”nofollow” a cikin alamar anga (hanyar haɗi), ka'idar ita ce cewa injin bincike zaiyi watsi da wannan haɗin kuma yayi watsi da shafi na gaba. Shafuka kamar Wikis suna amfani dashi sosai kuma a cikin maganganu saboda kada hanyoyin cin mutuncin mai amfani su zama masu cin zarafi da bi.

Masu ba da shawara game da Injin Bincike sun fahimci da sauri irin waɗannan hanyoyin haɗin yanar gizon, suna yayyafa su cikin duk hanyoyin haɗin yanar gizon don wasu nauyin haɗin sun fi sauran nauyi. An kira aikin zana-shafi kuma daga karshe Google ya raina shi.

Har yanzu ina amfani balaga a kan sakonnin pagination dina (wadanda sune na gaba da wadanda suka gabata) a shafin. Ta wannan hanyar shafuna (2, 3, 4, da sauransu) ba za a saka su a cikin sakamakon bincike ba. Nayi wannan ne ta hanyar sauyi dana samu akansa Katz Yanar gizo page.

Makon da ya gabata, Google ya ba da sabuntawa inda hanyoyin haɗin pagination za a iya yin lamba tare da rel = "na gaba" da rel = "prev" a cikin alamun anga. Abin godiya, ayyuka (waɗanda ya kamata a haɗa su a kan fayil ɗin function.php ɗin taken) suna da sauƙin shiryawa. Anan suna tare da sabuntawa.

Gyare-gyare don hanyoyin Shafi na gaba:

aiki mtb_next_posts_link ($ lakabin = 'Next Shafi', $ max_page = 0) {duniya $ gabatar, $ wp_query; idan (! $ max_page) {$ max_page = $ wp_query-> max_num_pages; } idan (! $ a shafi) $ shafi = 1; $ nextpage = intval ($ shafi) + 1; idan ((! is_single ()) && (fanko ($ shafi) || $ nextpage> = $ max_page)) {echo '> a rel = "na gaba" href = "'; next_posts ($ max_page); echo '" take = "Shafi na gaba - Je zuwa shafi '. $ Nextpage.'"> '. preg_ wuri ('/ & ([^ #]) (?! [az] {1,8};) /', '& $ 1', $ lakabin). '> / a>'; }}

Gyare-gyare don hanyoyin Shafin da Ya gabata:

aiki mtb_previous_posts_link ($ lakabin = 'Shafin da Ya Shafi') {duniya ta shafi $; idan ((! is_single ()) && ($ sakawa> 1)) {$ prevpage = intval ($ shafi) - 1; echo '> a rel = "prev" href = "'; previous_posts (); echo '" title = "Shafin da ya gabata - Je zuwa shafi'. $ prevpage. '">'. preg_ wuri ('/ & ([^ #]) (?! [az] {1,8};) /', '& $ 1', $ lakabin). '> / a>'; }}

Thoseara waɗancan ayyukan a ciki functions.php sannan kayi amfani da aikin a cikin index.php ɗinka da sauran shafuka inda ake amfani da hanyoyin haɗin gwiwa. Wannan shine kawai abin da ake buƙata don aiwatar da wannan sabon fasalin akan shafin yanar gizonku na WordPress ko wani abu - wani abu da zan ba da shawarar sosai! Da fatan, masu haɓaka WordPress zasu aiwatar da wannan canjin cikin ainihin aikace-aikacen. Zuwa yau, ba su mai da hankali sosai ga inganta injin bincike ba, kodayake, don haka ban riƙe numfashi ba.

2 Comments

  1. 1
  2. 2

    Godiya ga babban matsayi. Abun takaici, ban fahimci yadda ake aiwatar da wannan ba… Don haka yanzu zanyi addu'a (kuma nayi dan binciken Google) cewa akwai wani fulogi wanda yake min haka…

Me kuke tunani?

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