Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1502

    Hi There

    Is it possible to use the Sidebar News widget to display the Portfolio posts. I entered the category id of the portfolio posts but it’s not working. I guess it’s only working for normal post types.

    Is there a way to do this?

    Kind regards,




    You can do this but would need to adapt the widgets code to use the Portfolio Custom Post Type.

    Open up /framework/theme_widgets/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);

    This will now only pull in posts from the Portfolio section.



    Hi James

    Thanks so much. It works perfectly!

    Kind regards,



    Yeah thank you !

    It works :)


    how can i manage it to get the sidebar news widget and the modified sidebar news widget called portfolio widget or something like this?

    When im going to copy the sidebar_news.php and modifiy the code – the widget wont appear.

    i need them both! :)


    First make a copy of sidebar_news.php located under /framework/theme_widgets and name the copy sidebar_portfolio.php

    Then replace all occurrences of




    (ignore lower/uppercase).

    At least replace following code in functions.php:

    $autoload['widgets'] = array('sidebar_news');


    $autoload['widgets'] = array('sidebar_news', 'sidebar_portfolio');


    hello, i’m interesting on this too


    i would like to show just the title of the portfolio categories, how can i do this?

    Tnks in advance



    You’d need to modify the portfolio widget to display the category titles. However I don’t have the time to look into it now.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Sidebar Portfolio instead of Sidebar News’ is closed to new replies.