WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: My Custom Widgets] Bugs (4 posts)

  1. perrymyk
    Member
    Posted 4 years ago #

    Plugin doesn't work when filtering categories nor tags - no place to enter the category or tag to filter.

    http://wordpress.org/extend/plugins/mycustomwidget/

  2. janekniefeldt
    Member
    Posted 4 years ago #

    Please read the manual. You can enter checks on both (categories and tags) on the setting page (NOT on the Appearance page).

  3. CallUp
    Member
    Posted 4 years ago #

    Will this let you filter between different categories?
    (i.e. if (is_Category('entertainment')) { )

  4. janekniefeldt
    Member
    Posted 4 years ago #

    This should work. But I am not sure if this will cover what you want to do, because it will not cover single posts.

    Another comment I recently posted on my homepage:

    The tag “is_tag(’love’)” would return true if you are watching the archive entry for the love tag (usually by clicking on “love” in your tag cloud).

    So this will not work for single posts. To get a list of all tags that are assigned to a post, you should use the get_the_tags function (function reference: http://codex.wordpress.org/Function_Reference/get_the_tags)

    This means that the filters provided by this plugin will not help you. But you can use this code (simply add it to your html-widget)

    <?php
    if (is_single());
    $all_post_tags = get_the_tags();
    foreach($all_post_tags as $this_tag) {
    if ($this_tag->name == "love" ) {
    ?>
    <!-- insert your html-content here -->
    <?php
    }
    }
    ?>

    This example handles tags but should work for categories too (if you change the coding accordingly (replace is_tag with is_category)).

Topic Closed

This topic has been closed to new replies.

About this Topic