0
我希望能夠在論壇帖子上方顯示超級粘滯或粘滯帖子。換一種說法。我將在頁面上發佈帖子,超級/粘性帖子將在那裏。但是,在帖子列表的上方,我想也有超級貼子。有點像「精選討論」類型部分。如何在論壇帖子上方顯示bbpress超級粘滯或粘滯帖子?
我希望能夠在論壇帖子上方顯示超級粘滯或粘滯帖子。換一種說法。我將在頁面上發佈帖子,超級/粘性帖子將在那裏。但是,在帖子列表的上方,我想也有超級貼子。有點像「精選討論」類型部分。如何在論壇帖子上方顯示bbpress超級粘滯或粘滯帖子?
所以我最終這樣做來解決我的問題。我補充說,持有主題表上方一個div然後如下幫了我一些jQuery的:
var rows = $('table.bbp-topics').find('tr.super-sticky');
rows.each(function(index) {
var headhref = $('a.bbp-topic-permalink', this).attr('href');
var headline = $('a.bbp-topic-permalink', this).html();
var excerpt = $('.excerpt', this).text();
var author = $('a.bbp-author-name', this).html();
var photo = $('a.bbp-author-avatar > img', this).attr('src');
var replies = $('.bbp-topic-voice-count', this).text();
var followers = $('.bbp-topic-reply-count', this).text();
var freshness = $('.bbp-topic-freshness > a', this).html();
var meta = $('p.bbp-topic-meta', this).text();
var newrow = '<div class="featured-row"><div class="topic-meta">' +
'<img class="author-photo" src ="' + photo + '">' +
'<div class="author">' + author +'</div> ' +
'<div class="topic-title"><a href="' + headhref + '">' + headline + '<a/></div>' +
'<div class="excerpt">' + excerpt + '</div></div>' +
'<div class="replies"><h3>Replies</h3><hr/><p>' + replies + '</p></div> ' +
'<div class="followers"><h3>Followers</h3><hr/><p>' + followers + '</p></div> ' +
'<div class="freshness"><h3>Updated</h3><hr/><p>' + freshness + '</p></div> ' +
' </div>';
console.log(newrow);
$('#supersticky').fadeIn().append(newrow)
})
希望這可以幫助其他人。