Title: aletsan's Replies | WordPress.org

---

# aletsan

  [  ](https://wordpress.org/support/users/aletsan/)

 *   [Profile](https://wordpress.org/support/users/aletsan/)
 *   [Topics Started](https://wordpress.org/support/users/aletsan/topics/)
 *   [Replies Created](https://wordpress.org/support/users/aletsan/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/aletsan/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/aletsan/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/aletsan/engagements/)
 *   [Favorites](https://wordpress.org/support/users/aletsan/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: HungryFEED] Filter doesn't work](https://wordpress.org/support/topic/plugin-hungryfeed-filter-doesnt-work/)
 *  [aletsan](https://wordpress.org/support/users/aletsan/)
 * (@aletsan)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-hungryfeed-filter-doesnt-work/#post-2415627)
 * 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](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 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Firelight Lightbox] [Plugin: Easy FancyBox] Applying Fancybox class to elements using jquery](https://wordpress.org/support/topic/plugin-easy-fancybox-applying-fancybox-class-to-elements-using-jquery/)
 *  Thread Starter [aletsan](https://wordpress.org/support/users/aletsan/)
 * (@aletsan)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-easy-fancybox-applying-fancybox-class-to-elements-using-jquery/#post-2425834)
 * The solution for using fancybox iframe on feed links turned out to be twofold:
 *     ```
       <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>
       ```
   
 * 1. Add the fancybox class I needed for the link (with parameters for the iframe
   case)
    2. Actually “perform the action” when the link is clicked
 * Problem solved.
 * HungryFEED and fancybox combination makes a really nice effect …
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[HungryFEED] [Plugin: HungryFEED] Apply custom classes/attributes to parsed elements](https://wordpress.org/support/topic/plugin-hungryfeed-apply-custom-classesattributes-to-parsed-elements/)
 *  Thread Starter [aletsan](https://wordpress.org/support/users/aletsan/)
 * (@aletsan)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-hungryfeed-apply-custom-classesattributes-to-parsed-elements/#post-2425833)
 * I can’t thank you enough for pushing me in the right direction.
    The solution
   for using fancybox iframe on feed links turned out to be twofold:
 *     ```
       <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>
       ```
   
 * 1. Add the fancybox class I needed for the link (with parameters for the iframe
   case)
    2. Actually “perform the action” when the link is clicked
 * I had to make some experiments to find out where to put the width and height 
   parameters, but that took no time to solve it.
    HungryFEED and fancybox combination
   makes a really nice effect …
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: HungryFEED] Filter doesn't work](https://wordpress.org/support/topic/plugin-hungryfeed-filter-doesnt-work/)
 *  [aletsan](https://wordpress.org/support/users/aletsan/)
 * (@aletsan)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-hungryfeed-filter-doesnt-work/#post-2415613)
 * [@salgeras](https://wordpress.org/support/users/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.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[HungryFEED] [Plugin: HungryFEED] Apply custom classes/attributes to parsed elements](https://wordpress.org/support/topic/plugin-hungryfeed-apply-custom-classesattributes-to-parsed-elements/)
 *  Thread Starter [aletsan](https://wordpress.org/support/users/aletsan/)
 * (@aletsan)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-hungryfeed-apply-custom-classesattributes-to-parsed-elements/#post-2425793)
 * Lol, I knew I have missed the obvious.
    I really should stop working after midnight…
 * To the point:
    Thanks for giving me the answer, it works on all browsers (IE,
   FF, Opera, Chrome, Safari). As I already have jquery loaded (version 1.6.1), 
   I used a slightly modified version:
 *     ```
       <script type="text/javascript">
        jQuery(document).ready(function($) {
         $('.hungryfeed_item a').attr("target", "_blank");
         $('.hungryfeed_item a').addClass("fancybox iframe {width:930,height:680}");
        });
       </script>
       ```
   
 * The change for target worked, but still nothing happens when I apply the fancybox
   class.
    Any thoughts about why? I suspect that the link must be created with 
   fancybox class and not modified as I am trying to do. That’s why I asked if HungryFEED
   can have an option to apply these changes when it creates the modified feed.
 * Even if we can’t find an answer for fancybox, applying target is good enough 
   to do the job.
    Thanks again for the quick fix on the issue.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: HungryFEED] Filter doesn't work](https://wordpress.org/support/topic/plugin-hungryfeed-filter-doesnt-work/)
 *  [aletsan](https://wordpress.org/support/users/aletsan/)
 * (@aletsan)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-hungryfeed-filter-doesnt-work/#post-2415609)
 * 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.

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