• Hello to all!

    I apologise if this question has already been asked, I haven’t found it. Feel free to point me to that post.

    I’ve just installed HungryFEED plugin, and it’s working great when I try to rss some feed. But, when I add filter option to URL, all I can see is blank page.

    For example, this works great:

    [hungryfeed url=”http://www.b92.net/info/rss/vesti.xml” max_items=”10″ feed_fields=” ” template=”1″]

    But, if I try to filter its content:

    [hungryfeed url=”http://www.b92.net/info/rss/biz.xml” filter=”kriza|recesija|finansije” max_items=”10″ feed_fields=” ” template=”1″]

    I receive only empty widget block (since I put rss in widget area, as content block).

    Just to mention that I’ve customized template code, in order to hide description/author/date.

    Custom Template 1:
    <div class=”hungryfeed_item”>
    <h5>{{title}}</h5>
    </div>

    Could you please help me with this plugin? Any ideas why filter not working?

    Thanks in advance!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • I see the problem. when using filter and max_items together hungryFEED seems to be applying max_items before filter. so, it only takes the first 10 items from the feed, then filters those. but in your case the items that match your filter appear in items 11-20.

    it looks like for the moment, you can get it working by removing max_items from your shortcode. though you might get too many results, but in your case at the moment it only returns 3 results anyway.

    thanks for letting me know, i’ll have a patch release this weekend.

    ok update 1.5.5 fixes the problem. now filtering and max_items used together works as it should

    Thread Starter salgeras

    (@salgeras)

    @verysimple,

    Thank you very much for your help, really appreciate the speed at which you fixed the problem! Yup, everything is ok now.

    Just one more question: is it possible to combine several words in one filter match? For example, how would you look for “blue car”, “red car”? Could I simply write filter=”blue car|red car” or perhaps I should join those two words with + sign: filter=”blue+car|red+car”?

    And one more πŸ™‚ Does hungryfeed support target=”_blank” option, in order to open link in new tab/window?

    Once again, thank you for your help!!

    Best regards

    If you are still interested, I found a way to insert target=”_blank” for the links of a feed.

    Read the topic “Apply custom classes/attributes to parsed elements” to see the way I did it, and if it suites you, you can do the same. Or even come up with better solution and share it with us.

    Be warned, this does not work with Internet Explorer, but I am sure we can find a way to make MSIE understand what we need …
    I will try and extend my solution as fast as possible.

    cool, nice solution for _blank. since jquery is available on most wordpress themes you could probably do it that way instead and it would work in all browsers.

    @ salgeras if you’re not using a template then you can put link_target=”_blank” in your shortcode. that only affects the link to the full article, though, it doesn’t affect links within the description, in which case you can use @aletsan’s solution.

    @salgeras,

    verysimple quickly provided a better solution using jquery that works on all browsers. I tested it in IE, FF, Opera, Chrome and Safari and it works fine. As he said it is kinda hacky, but it does the job.

    Check the “Apply custom classes/attributes to parsed elements” topic and you can find 2 versions of it for using different versions of jquery.

    Thread Starter salgeras

    (@salgeras)

    Sorry for late response, multitasking these days πŸ™‚

    @aletsan,
    Sorry, could you please share a link to that topic? Did some googling, but with no success.

    @verysimple,
    I’m using Cruz template, so I guess I have to use @aletsan solution, since _blank doesn’t work at this moment (open link in same tab). As I said in first post, I changed your plugin template to only display rss titles and just would like to open thoes links in new tab/window.

    And, any suggestions regarding that “blue car|red car” question? πŸ™‚

    Thank you both!!

    I can’t understand why the _blank doesn’t work for you. I don’t think it has anything to do with templates, its an attribute for the <a> tag and should be working. Of course it depends on what setting the user has for opening new windows, but it should work.
    The link for the post about applying _blank attribute is:

    http://wordpress.org/support/topic/plugin-hungryfeed-apply-custom-classesattributes-to-parsed-elements

    There you can find 2 solutions, depending (I think, but maybe I’m wrong as I’m not an experienced programmer) on version of jquery you use. verysimple suggested loading version 1.7.1 directly, I have version 1.6.1 already loaded, and I found out that I had to use slightly different syntax in the calls. Use whatever works for your case.
    The final code that I inserted in HungryFEED’s Custom CSS Code (for use with jquery 1.6.1) is

    </style>
    <script type="text/javascript">
     jQuery(document).ready(function($) {
      $('.hungryfeed_item a').attr("target", "_blank");
      $('.hungryfeed_item a').addClass("fancybox iframe {width:930,height:680}");
      $('.hungryfeed_item a').fancybox({
        'centerOnScroll' : 'true',
        'content':$(this).attr('src')
      });
     });
    </script>
    <style>

    The reverse <style> declaration is important as HungryFEED wraps the code of custom css in style tags, so we keep them unbroken. I checked it on IE, FF, Opera, Chrome, Safari.

    It applies the _blank attribute to hungyfeed <a> tags.
    Also, if you have Easy Fancybox installed (and configured), it adds the class to open them in iframe, and the parameters for the iframe call. Keep in mind that some sites don’t allow their content to be loaded in frames, so do a check first if you use it. In the case of fancybox you must insert the call to it, as the class addition must come before that, and when we use hungryfeed custom css solution it happens in the reverse order.

    Using this jquery technique you can change the attributes and class of all elements that hungryfeed creates. So, the only limit is our imagination.

    I hope you make it work in the end, if you have any issues post again and I will try to help if I can. Be warned that I don’t check my emails too often these days. As you said, I enabled multitasking mode also this period πŸ™‚

    Thread Starter salgeras

    (@salgeras)

    Well, 14 days later, finally got some free time to check your post πŸ™‚

    @aletsan,
    thank you so much for your help and this code! Yup, _blank now working like a charm! πŸ™‚ So, to repeat for any HungryFEED users out there, just add aletsan’s code to “Custom CSS Code” section. For example, this is mine:

    h3.hungryfeed_feed_title {font-size:10px;}
    p.hungryfeed_feed_description {font-size:10px;}
    div.hungryfeed_items {font-size:10px;}
    div.hungryfeed_item {margin-bottom: 10px;}
    div.hungryfeed_item_title {font-weight: bold; font-size:10px;}
    div.hungryfeed_item_description {}
    div.hungryfeed_item_author {}
    div.hungryfeed_item_date {}
    </style>
    <script type="text/javascript">
     jQuery(document).ready(function($) {
      $('.hungryfeed_item a').attr("target", "_blank");
      $('.hungryfeed_item a').addClass("fancybox iframe {width:930,height:680}");
      $('.hungryfeed_item a').fancybox({
        'centerOnScroll' : 'true',
        'content':$(this).attr('src')
      });
     });
    </script>
    <style>

    Best regards!

    awesome. also new in version 1.5.8 there is a field for custom Javascript code so you don’t need to add it in the CSS field anymore.

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

The topic ‘[Plugin: HungryFEED] Filter doesn't work’ is closed to new replies.