Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4617

    Is it possible to create a new set of dummy sidebar widgets for POST pages only? Looking at the sidebar.php file, I see where they call those out. I’d like to have a dummy sidebar widget, like dummy_widget(4), the news widget for certain categories that appears on all POST pages. I know I can create custom widgets by category, but since I am using this as a CMS, I already have quite a few on the PAGES. Adding them for each category would add an enormous amount of clutter to my backend.

    #46959

    This ones seems to be scaring folks off :)

    I had another thought but couldn’t find any reference on how to execute it. Maybe I can get some help on that.

    The idea is to add another option to the admin area in the sidebar_footer.php file. Adding a new array for “Extra Widget Areas for specific Tag.” Why a tag? Isn’t displayed anywhere on my site, so it would only serve to add the custom widget to ALL post with the tag (insert tag here). I can manage this much.

    Now to edit the sidebar.php with the new “unique Tag sidebar.” The thought below, not sure if this is right:

    //unique Tag sidebars:

    if (function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘Tag: ‘.$custom_widget_area) ) : $default_sidebar = false; endif;

    Now for what I ASSUME is the last file to edit, “widget.php.” It stands to reason that I need to create another “$dynamic_widgets” box. I’m just not sure how to call out the tags like you can with the categories.

    Now this could all be totally wrong, but if not…any ideas.

    #46960

    Hey,

    you can add a dummy widget to posts by replacing following code in sidebar.php:

    dummy_widget(1);
    dummy_widget(2);
    dummy_widget(3);

    with:

    dummy_widget(1);
    dummy_widget(2);
    dummy_widget(3);
    dummy_widget(6);

    Afterwards replace following code in widgets.php:

    case 5:
    echo "<h3 class='widgettitle'>Latest News</h3>";
    $sbNews = new Kriesi_sidebar_news_Widget();
    $sbNews->widget(array(),'');
    break;

    with:

    case 5:
    echo "<h3 class='widgettitle'>Latest News</h3>";
    $sbNews = new Kriesi_sidebar_news_Widget();
    $sbNews->widget(array(),'');
    break;

    case 6:
    echo "<h3 class='widgettitle'>Custom Dummy Code</h3>";
    echo "My widget code";
    break;

    and adjust the “case 6″ widget code.

    #46961

    Dude-

    Worked like a charm, but I have a follow-up if I could continue to pester you. I’ve plugged in the news_ widget and would like to know how to adjust the widget for a certain category and number of post. Thanks for all your help.

    #46962

    Hey,

    you can select the categories in the widget option fields. Go to Appearance > Widgets and open up the widget settings for the news widget. In the option field with the caption “Enter the ids of the categories you want to display, separate them by comma” enter the category ids of your choice.

    #46963

    But since this is one of the dummy widgets and it hasn’t had a box registered to it in the appearance/widget area, how can I enter that into the News Widget. Other than the standard boxes that come with the theme and those generated by the sidebar/footer menu with pages and categories, I don’t know where I could define the parameters in the dummy widgets.

    #46964

    Anyone have a chance to take a look at this one?

    #46965

    Hey,

    the only chance I see is to adjust the default settings in frameworktheme_widgetssidebar_news.php

    #46966

    Seemed to be too many variables to make it work with the widget. Coded what I needed into the widget file with some conditionals in the sidebar file. Works like a charm. Thanks, as always for your help.

    #46967

    Glad that you found a solution :)

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

The topic ‘New 'Dummy' Sidebar Widgets’ is closed to new replies.