Tag: wp plugin tweak

wp: load posts in wp_list_categories

I believe a sitemap should show posts under categories, and maintain the category hierarchy.

wp_list_categories cannot be asked to include posts.
And if you follow this suggestion and try and use get_posts, you will get a nasty surprise; it will get all posts in all sub categories of the one you want. and this WILL NOT DO!

I found that you need this query and that you can inherit the category walker and pass that to the wp_list_categories method. Am impressed! Read more »

wp: back to toc

PS

I found a nice plugin for adding a table of contents to a post (like the wiki pages have)

However it had one limitation, there is no back to top link. Since we want to go back to the toc (which can be at the top / bottom), Ive called it the back_to_toc feature.

It has 3 options – not to show / show text / show image.

See snippets overleaf or explore the  code (line 559 of toc.php is where the real changes start). Or view it in action.
Read more »