Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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,

    Albert

    #35470

    Hey,

    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.

    James

    #35471

    Hi James

    Thanks so much. It works perfectly!

    Kind regards,

    Albert

    #35472

    Yeah thank you !

    It works :)

    #35473

    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! :)

    #35474

    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

    kriesi_sidebar_news_widget

    with:

    kriesi_sidebar_portfolio_widget

    (ignore lower/uppercase).

    At least replace following code in functions.php:

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

    with:

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

    #35475

    hello, i’m interesting on this too

    but

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

    Tnks in advance

    Ciccio

    #35476

    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.