Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #20269

    Hi,

    I would like to change the combo widget of CORONA, this is how it looks normally like:

    1. where can I change this order: first the recent, then the popular posts (“recent” should be the first tab and should be the first open tab)?
    2. how can I add there a fourth tab to this combo widget with the categories instead of a separate widget?

    Thanks a lot!

    #106964

    Hi,

    Open framework > php folder then edit class-framework-widgets.php, find this code

    echo '<div class="tab first_tab widget_tab_popular"><span>'.__('Popular', 'avia_framework').'</span></div>';
    echo "<div class='tab_content'>";
    avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    echo "</div>";

    echo '<div class="tab widget_tab_recent"><span>'.__('Recent', 'avia_framework').'</span></div>';
    echo "<div class='tab_content'>";
    avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc');
    echo "</div>";

    Replace it with this code

    echo '<div class="tab first_tab widget_tab_recent"><span>'.__('Recent', 'avia_framework').'</span></div>';
    echo "<div class='tab_content'>";
    avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc');
    echo "</div>";

    echo '<div class="tab widget_tab_popular"><span>'.__('Popular', 'avia_framework').'</span></div>';
    echo "<div class='tab_content'>";
    avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts);
    echo "</div>";

    Regards,

    Ismael

    #106965

    Thanks, that’s the solution for 1., and what about question 2.? How can I add as a fourth tab the “categories” in this combo widget?

    Thanks.

    #106966

    Hi,

    Please try this:

    In class-framework-widgets.php find the block below , for me its on lines 869-872 and overwrite it with code below

    echo '<div class="tab last_tab widget_tab_tags"><span>'.__('Tags', 'avia_framework').'</span></div>';
    echo "<div class='tab_content tagcloud'>";
    wp_tag_cloud('smallest=12&largest=12&unit=px');
    echo "</div>";

    and *overwrite* the code you found above with the code below

    echo '<div class="tab widget_tab_tags"><span>'.__('Tags', 'avia_framework').'</span></div>';
    echo "<div class='tab_content tagcloud'>";
    wp_tag_cloud('smallest=12&largest=12&unit=px');
    echo "</div>";

    echo '<div class="tab last_tab widget_tab_categories"><span>'.__('Categories', 'avia_framework').'</span></div>';
    echo "<div class='tab_content'>";
    wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li=');
    echo "</div>";

    There is likely a second part to this, but please try this anyhow

    Thanks,

    Nick

    #106967

    thanks for this code, unfortunately now 4 tabs are too much for the widget width and don’t look good.

    Is it easily done, to change this combo widget in that way, that it does not use “tabs” but “toggles” (like the toggles here: http://www.kriesi.at/themes/corona/templates/shortcodes/)?

    Would it be easier to change the class-framework-widgets.php file from a “tabbed combo widget” to a “combo widget with toggles” – or to use a text (?) widget with such a code:

    [toggle_container keep_open="true" initial_open="1"]
    [toggle title="Recent Posts"] here should be the 3 recent posts [/toggle]
    [toggle title="Popular Posts"] here should be the 3 popular posts [/toggle]
    [toggle title="Tags"] here should be the tag cloud[/toggle]
    [toggle title="Categories"] here should be the categories with counter of the posts in each category [/toggle]
    [/toggle_container]

    But how can I output in this widget the recent, popular posts, the used tags and the categories (with post counter)?

    Thanks!!

    #106968

    Hi,

    Please get the enhanced text widget which allow you to run code http://wordpress.org/extend/plugins/enhanced-text-widget/ and give it a try. Rebuilding the entire widget to use toggles over tabs would be a tad more difficult than pasting the shortcode into the enhanced text widget, I recon. :) See if it works out first.

    Thanks,

    Nick

    #106969

    Thanks, I have installed now this plugin, but unfortunately I don’t know what code to put into it, so that it outputs the

    - 3 popular posts

    - 3 recent posts

    - tag cloud

    - categories incl. counter of posts in each

    I have looked at the class-framework-widgets.php mentioned above, but this is far beyond my PHP know-how with this “avia-framework” etc.

    Could you please help me, what to put into it?

    I have tried it with this – not working:

    [toggle_container keep_open="true" initial_open="1"]

    [toggle title="Recent Posts"]

    avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc'); [/toggle]

    [toggle title="Popular Posts"] avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts); [/toggle]

    [toggle title="Tags"] wp_tag_cloud('smallest=12&largest=12&unit=px'); [/toggle]

    [toggle title="Categories"] wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li='); [/toggle]

    [/toggle_container]

    looks like

    The output of the popular, recent, tags, categories should look like the demo:

    http://www.kriesi.at/themes/corona/blog/

    but as mentioned above as toggles.

    Thanks a lot in advance!

    #106970

    Hi colorit2,

    That is a bit beyond what we can really help you do. At this point you are building an almost entirely new widget.

    You would be much better off just trying to find a widget that supports multiple queries and can output them into a visual format you like.

    If you want to use the toggles for the combo widget then yes, you would need to re-do the coding for it. Again however, that is beyond what we could help with via support.

    I’m sure it isn’t ideal after getting so close but the steps to go through to get it to a bug free deployment is fairly involved.

    Regards,

    Devin

    #106971

    Thanks, Devin, I understand … I try to find another solution for me.

    #106972

    Hi colorit2,

    Try changing your toggle code inside enhanced text widget with this code:

    [toggle_container keep_open="true" initial_open="1"]
    [toggle title="Recent Posts"] <?php avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc'); ?> [/toggle]
    [toggle title="Popular Posts"] <?php avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts); ?> [/toggle]
    [toggle title="Tags"] <?php wp_tag_cloud('smallest=12&largest=12&unit=px'); ?> [/toggle]
    [toggle title="Categories"] <?php wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li='); ?> [/toggle]
    [/toggle_container]

    Hope this helps. :)

    Regards,

    Ismael

    #106973

    Ismael, you are the best … thanks so much; it works fine with your code and the enhanced text widget.

    Just one question: how can I limit this output of the recent and of the popular post within this widget to 3 – currently 10 are showing with your code?

    Thanks.

    #106974

    found it here http://codex.wordpress.org/Template_Tags/get_posts

    [toggle_container keep_open="false" initial_open="1"]

    [toggle title="Recent Posts"] <?php avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc&posts_per_page=3'); ?> [/toggle]

    [toggle title="Popular Posts"] <?php avia_get_post_list('cat=&orderby=comment_count&posts_per_page=3'.$posts); ?> [/toggle]

    [toggle title="Tags"] <?php wp_tag_cloud('smallest=12&largest=12&unit=px'); ?> [/toggle]

    [toggle title="Categories"] <?php wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li=&show_count=1'); ?> [/toggle]

    [/toggle_container]

    Thanks a lot! It’s now exact how I like it, just need to adjust my CSS styling:

    #106975

    Could you please give me a hint, how I can avoid that the tags are being “divided”, like “key-words” (not in separate lines)?

    Thanks.

    E D I T:

    found this at Google and added it to my tagcloud-CSS:

    white-space: nowrap;

    So everything is fine for me! Thank you all for your help!

    #106976

    ok, now I got it all finished. If someone needs this, too … here is the

    COMBO WIDGET as a version with toggles instead of tabs

    1. Install the plugin http://wordpress.org/extend/plugins/enhanced-text-widget/ and use this now instead of CORONA’s standard combo-widget. Drag this new widget in your desired sidebar or footer.

    2. Add the following code to this new widget:

    [toggle_container keep_open="false" initial_open="1"]

    [toggle title="Recent Posts"] <div class="myrecentposts"><?php avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc&posts_per_page=3'); ?></div> [/toggle]

    [toggle title="Popular Posts"] <div class="mypopularposts"><?php avia_get_post_list('cat=&orderby=comment_count&posts_per_page=3'.$posts); ?></div> [/toggle]

    [toggle title="Tags"] <div class="mytagcloud"><?php wp_tag_cloud('smallest=12&largest=12&number=&smallest=8&largest=24&orderby=count&unit=px'); ?></div> [/toggle]

    [toggle title="Categories"] <div class="mycategorylist"><?php wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li=&style=none&show_count=1'); ?></div> [/toggle]

    [/toggle_container]

    3. We need to adjust a bit the CSS to delete the big margin left in each toggle part and we need to add some new CSS styles for it, so you don’t need to overwrite the CSS for CORONA’s standard widget. Add the following CSS code to your custom.css:

    /* my own Toggle-Combo-Widget */

    .mytagcloud {

    margin: 4px 6px 4px -22px;

    }

    .mytagcloud a {

    background: none repeat scroll 0 0 #CABEC8;

    border: 1px solid #EEEEEE;

    color: #ffffff;

    font-size: 11px !important;

    margin: 0 1px 1px 0;

    padding: 2px 8px;

    white-space: nowrap;

    line-height: 28px !important;

    }

    .mytagcloud a:hover {

    text-decoration: none;

    text-shadow: none;

    }

    .mycategorylist {

    margin-bottom: 4px;

    margin-left: -22px;

    margin-top: 6px;

    margin-right: 6px;

    }

    .mypopularposts {

    margin-left: -22px;

    margin-right: 6px;

    }

    .myrecentposts {

    margin-left: -22px;

    margin-right: 6px;

    }

    This looks now like this:

    http://tinyurl.com/b96torh

    Thank you all for your help! It’s perfect for me now! Thanks to Ismael, that you have found yet another perfect solution to solve this!!!

    #106977

    Hi ,

    Thanks! Glad you are able to put all the pieces of the puzzle together.

    Thanks,

    Nick

    #106978

    Could you please tell me, how to add the “latest (3) comments” to this “enhanced text widget” (plugin)?

    Currently the code in this widget is that:

    [toggle_container keep_open="false" initial_open="1"]

    [toggle title="Recent Posts"] <div class="myrecentposts"><?php avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc&posts_per_page=3'); ?></div> [/toggle]

    [toggle title="Popular Posts"] <div class="mypopularposts"><?php avia_get_post_list('cat=&orderby=comment_count&posts_per_page=3'.$posts); ?></div> [/toggle]

    [toggle title="Tags"] <div class="mytagcloud"><?php wp_tag_cloud('smallest=12&largest=12&number=&smallest=8&largest=24&orderby=count&unit=px'); ?></div> [/toggle]

    [toggle title="Categories"] <div class="mycategorylist"><?php wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li=&style=none&show_count=1'); ?></div> [/toggle]

    [/toggle_container]

    Thanks.

    #106979

    sorry, I got it with some try&error ;-)

    I’ve added just this line:

    [toggle title="Last Comments"] <div class="mycategorylist"><?php avia_get_comment_list('sort_column=name&optioncount=0&hierarchical=0&number=3&title_li=&style=none&show_count=1'); ?></div> [/toggle]

    -solved-

    #106980

    Hi colorit2,

    Glad that you fixed it. :)

    Cheers,

    Ismael

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

The topic ‘CORONA's combo widget – where to change?’ is closed to new replies.