Current position: home page > Website design >Emlog template output shows tag article list php code (tag article list call code)

Emlog template output shows tag article list php code (tag article list call code)

Author: blueleaf Classification: Website design Time: January 8, 2024 Browse: 365

emlog The tag function in the program is very powerful. If you add tags to published articles, you can use tags as keywords of emlog articles, and tags can also be used as categories or albums of emlog. With such a powerful tag function, how can you add tags to Emlog template Output display tag article list? Emlog template What is the tag article list calling code?

 Emlog template output display tag article list php code.png

emlog Template The tag article list calls the code, and copies the following code to the emlog template module php In the file, write the calling code where the emlog template needs to, and then the emlog template can output and display the list of tag articles.

 function lanyeTagArticle($tagname,$num=10,$page=1){ $Tag_Model = new Tag_Model(); $Log_Model = new Log_Model(); $blogIdStr = $Tag_Model->getTagByName($tagname); $sqlSegment = "and gid IN ($blogIdStr) order by date desc"; $list = $Log_Model -> getLogsForHome($sqlSegment, $page, $num); $out = ''; foreach($list as $v){ $out .='< li><a href="'. Url::log($v['gid']).' ">'.$v['title'].'</a></li>'; } return $out; }

Disclaimer:

Website: Click Copy to share with friends!

All content resources shared by this website, if not noted, are original by Blueleaf. If you need to reprint, please indicate the source; Please contact us in case of infringement Contact handling Please understand!

Comment List
 blink the eyes kiss Growl happy think poor It's embarrassing Grievance ha-ha hush Right hum Zuo Hum Hum doubt A bad laugh Make money Sadness Be cool Seduce fierce handshake yeah Hee hee Shyness applause greedy Madness Embrace gather and watch Mighty awesome
Submit comments

Clear information
Close Comment
music appreciation
Back to top