Duplicate widget and make small changes
-
In this theme I have a sidebarwidget, that shows news from newscategories I can fill in. Now I want the same, but then for portfolio-categories.
I found this permanent solution:
Open up sidebar_news.php and find this line:
$additional_loop = new WP_Query("cat=".$cat."&posts_per_page=".$count);
Change it to:
$additional_loop = new WP_Query("post_type=portfolio&cat=".$cat."&posts_per_page=".$count);
Still I can not get this to work. Unfortunately also this is a permanent solution and I am looking to make both possible.
Also this was said:
If you want to use the Sidebar News widget for the blog entries and for the portfolio entries you need to duplicate the widget or change it’s code (more complex). I would create an extra portfolio news widget based on “Sidebar News” widget. Currently it’s not possible to show both post types.
Now I tried duplicating the widget and change things so I see it in the widget area, but no luck.
Anybody any idea how to get a copy of this news-widget?
- The topic ‘Duplicate widget and make small changes’ is closed to new replies.