Ungeza Kanjani Izixhumanisi Zokusebenzisana Emakhasini Angaphakathi ku-WordPress? Izinyathelo Ezi-3 Zokwakha Izixhumanisi Zekhasi Langaphakathi

WordPressIzixhumanisi zingangezwa futhi ziphathwe ngemuva, kodwa azinawo umsebenzi wezixhumanisi ekhasini elingaphakathi.

Ungeza Kanjani Izixhumanisi Zokusebenzisana Emakhasini Angaphakathi ku-WordPress? Izinyathelo Ezi-3 Zokwakha Izixhumanisi Zekhasi Langaphakathi

kucatshangelwaIwebhusayithi ye-WordPressUkuze kube lula ukusetshenziswa nokunemba, nginqume ukusebenzisa umsebenzi wesixhumanisi we-wp_list_bookmarks ukuze ngishayele, futhi ngisebenzise ithempulethi yekhasi elingaphakathi elihlukile ukuze ngifinyelele.

Izibonelo ezithile zingabhekisela kuzoU-Chen WeiliangIkhasi lesixhumanisi langaphakathi lebhulogi ▼

Uzakha kanjani izixhumanisi ezinobungane emakhasini angaphakathi

Isinyathelo sesi-1:Dala ikhasi elisha

Isinyathelo sesi-2:Kopisha ifayela le-page.php

  • Kopisha ifayela le-page.php kumkhombandlela wempande yetimu futhi uliqambe kabusha libe ikhasi-links.php
  • Eqinisweni, ungachaza igama ngemva kwekhasi- laleli fayela ngendlela othanda ngayo.
  • Lapho udala ikhasi, udinga ukufanisa ikheli lekhasi naleli gama.

Isinyathelo sesi-3:Thola umsebenzi wokubonisa okuqukethwe kwe-athikili

Efayeleni le-page-links.php, thola umsebenzi wokubonisa okuqukethwe kwe-athikili ▼

<?php the_content(); ?>

Ngezansi kwayo, engeza ikhodi elandelayo▼

<div class="page-links">
    <h3>内页链接</h3>
    <ul>
        <?php
        $default_ico = home_url().'/links_default.ico'; //默认 ico 图片位置
        $bookmarks = get_bookmarks('title_li=&categorize=0&category=64,383&orderby=rand'); 

                    //如果你要输出某个链接分类的链接,更改一下get_bookmarks参数即可
                    /*如要输出链接分类ID为5的链接title_li=&categorize=0&category=5&orderby=rand */
                    
                    /*全部链接随机输出 title_li=&orderby=rand */
        if ( !empty($bookmarks) ) {
            foreach ($bookmarks as $bookmark) {
            echo '<li><img src="', $bookmark->link_url , '/favicon.ico" onerror="javascript:this.src=\'' , $default_ico , '\'" /><a href="' , $bookmark->link_url , '" title="' , $bookmark->link_description , '" target="_blank" >' , $bookmark->link_name , '</a></li>';
            }
        }
        ?>
    </ul>
</div>
  • Qaphela imibono yekhodi.

Engeza izitayela ze-CSS kuzixhumanisi zekhasi

Ukuze uyenze ibe yinhle kakhulu, ungachaza isitayela sekilasi sezixhumanisi zekhasi.

OkulandelayoU-Chen WeiliangIzitayela ze-CSS zetimu esetshenzisiwe ▼

/*内页链接*/
.page-links{overflow:hidden;margin:0 0 24px;padding:0;}
.page-links h3{border-bottom:1px solid #bfbebe;text-align:center;margin:0;}
.page-links ul{margin:0;padding:5px 0 0 0;}
.page-links ul li{float:left;width:150px;line-height:16px;height:16px;margin:5px 5px 0;padding:0;list-style-type:none;}
.page-links ul li:hover{background:#f2f2f2;}
.page-links ul li img{width:16px;height:16px;margin:0 5px -2px 0;padding:0;border:none;}

Uqedile!

I-Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) kwabiwe "Ungazifaka Kanjani Izixhumanisi Emakhasini Angaphakathi ku-WordPress? Izinyathelo Ezi-3 Zokwakha Izixhumanisi Zekhasi Langaphakathi" zizokusiza.

Siyakwamukela ukwabelana ngesixhumanisi salesi sihloko:https://www.chenweiliang.com/cwl-1623.html

Uyemukelwa esiteshini seTelegram sebhulogi ka-Chen Weiliang ukuze uthole izibuyekezo zakamuva!

🔔 Iba ngowokuqala ukuthola "I-ChatGPT Content Marketing AI Tool Usage Guide" ohlwini lwemibhalo ephezulu yesiteshi! 🌟
📚 Lo mhlahlandlela uqukethe inani elikhulu, 🌟Leli ithuba eliyivelakancane, ungaphuthelwa! ⏰⌛💨
Yabelana futhi uthanda uma uthanda!
Ukwabelana kwakho nokuthanda kwakho kuyisisusa sethu esiqhubekayo!

 

发表 评论

Ikheli lakho le-imeyili ngeke lishicilelwe. 必填 项 已 用 * Ilebula

pheqela phezulu