Hi,
This may not be possible but I figured it's worth asking.
I only have the sidebar enabled when looking at single articles. Is it possible to modify the "Category Posts Widget" to display articles of the current category only?
Thanks!
Hi,
This may not be possible but I figured it's worth asking.
I only have the sidebar enabled when looking at single articles. Is it possible to modify the "Category Posts Widget" to display articles of the current category only?
Thanks!
link to your site?
hack to 'category posts widget' plugin; to show posts of the categories of the single post.
restricted so widget will only show on single post pages.
new top option 'use post categories' in dropdown; other functionality (hopefully) left intact.
cat-posts.php:
http://pastebin.com/PEJ1bwTy
(no guarantee for function; not widely tested; tested only with post titles, locally xampp wp3.1.1)
Very well done, alchymyth. Works a treat on my site.
thanks - nice to get feedback ;-)
hi friend i copy this code and paste into my widget.php
this error showing
Fatal error: Cannot redeclare class CategoryPosts
the code is for a particular 'Category Posts Widget' plugin, to replace the main plugin file, and not intended to be inserted into widget.php -
check, if you have this plugin already activated (?)
can you link that plugin please & please guide me what to do
http://wordpress.org/extend/plugins/category-posts/
in the plugin folder, replace the content of the file cat-posts.php with the content of the pastebin http://pastebin.com/PEJ1bwTy
as is said before, the error message 'Fatal error: Cannot redeclare class CategoryPosts' seems to indicate that you possibly use this plugin already;
in which case go to dashboard -> plugins -> editor; then select the plugin from the list 'Select Pugin to Edit'; and replace the code with the code from the pastebin http://pastebin.com/PEJ1bwTy
hi friend great work !
but it's working only on single post pages
not on home page what to do ?
@alchymyth any feedback ?
This topic has been closed to new replies.