Añadir rel=»lightbox» a nuestras imágenes en WordPress

Muchas veces queremos agregar un rel=»lightbox» a todas nuestras imagenes en WordPress, para ello nos llega con el siguiente código situado en nuestro functions.php

add_filter('the_content', 'my_addlightboxrel');
function my_addlightboxrel($content) {
       global $post;
       $pattern ="/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
       $replacement = '<a$1href=$2$3.$4$5 rel="lightbox" title="'.$post->post_title.'"$6>';
       $content = preg_replace($pattern, $replacement, $content);
       return $content;
}

 

129 responses to “Añadir rel=»lightbox» a nuestras imágenes en WordPress

  1. bay way

    It’s actually a cool and helpful piece of information. I’m glad that you just shared this useful info with us. Please stay us informed like this. Thank you for sharing.

  2. hopa store

    When I initially commented I clicked the -Notify me when new feedback are added- checkbox and now each time a remark is added I get 4 emails with the identical comment. Is there any approach you can remove me from that service? Thanks!

  3. sezam.fun

    Nice read, I just passed this onto a friend who was doing some research on that. And he actually bought me lunch because I found it for him smile Thus let me rephrase that: Thank you for lunch!

  4. ?????

    Howdy! Do you know if they make any plugins to protectagainst hackers? I’m kinda paranoid about losing everythingI’ve worked hard on. Any tips?Feel free to surf to my blog; weight loss tool

  5. explore

    I’d have to examine with you here. Which isn’t one thing I normally do! I get pleasure from studying a post that can make individuals think. Also, thanks for allowing me to comment!

  6. https://www.nebraskahistory.org/

    Pretty section of content. I just stumbled upon your blog and in accession capital to assert that I acquire actually enjoyed account your blog posts. Any way I’ll be subscribing to your augment and even I achievement you access consistently rapidly.

  7. tulum clothing

    Wow that was strange. I just wrote an really long commentbut after I clicked submit my comment didn’t appear.Grrrr… well I’m not writing all that over again. Anyway, just wanted to say great blog!

  8. to get more information

    Hi there! I know this is somewhat off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having trouble finding one? Thanks a lot!

  9. to get more information

    I am no longer sure where you’re getting your information, however great topic. I needs to spend some time finding out much more or figuring out more. Thanks for excellent information I used to be in search of this info for my mission.

  10. Tattoo

    Hi there, just became alert to your blog through Google, and found that it is trulyinformative. I am gonna watch out for brussels. I will appreciate if you continue this in future.Lots of people will be benefited from your writing.Cheers!

  11. here is the description

    Hi, I do think this is an excellent blog. I stumbledupon it 😉 I will revisit yet again since i have bookmarked it. Money and freedom is the greatest way to change, may you be rich and continue to help others.

  12. click here

    Hey There. I fοund your blog using msn. This is a realⅼy ѡell written article.I’ll be sure to bookmark it and rеtᥙrn to read more oof your useful info.Thanks for the post. I will certainly retսrn.My homepge :: apple pie recipe

  13. Smoking meat

    Nice post. I was checking constantly this blog and I’m inspired! Extremely useful info specifically the ultimate part 🙂 I take care of such info a lot. I was seeking this certain information for a very long time. Thank you and best of luck.

  14. more info

    Hey! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no back up. Do you have any methods to protect against hackers?

  15. Jessica Rodriguez

    An intriguing discussion is definitely worth comment. I believe that you need to publish more about this subject, it might not be a taboo matter but typically people do not talk about such issues. To the next! Kind regards.

Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Rúa Pilar Miró n 6 Santiago de Compostela

Jersey St , Manchester, Greater Manchester M4 6JG, GB

T. 609 538 171 - 634 59 34 43

info@teslatechnologies.com