Support » How-To and Troubleshooting » [Resolved] Insert automatic REL=prettyPhoto

[Resolved] Insert automatic REL=prettyPhoto

  • current text entry, and insert the link to the tool (alt + shift + a)

    This I insert the following code:

    <a href="http://youtube.com/watch?v=KaUAPGu6P86">Video 1</a>

    I wonder if there is any plug, class, etc. stylo allow me to customize the link and the code is inserted as follows:

    <a href="youtube.com/watch?v=KaUAPGu6P86" rel="prettyPhoto" >Aerosmith </a>

    This means that on any link, adding the code: rel = "PrettyPhoto" automatically.

    Since I am currently manually entering as there are thousands of links that were entered, is a big job.

    advanced thanks for any suggestions

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Jan Dembowski


    Volunteer Mod. & Brute Squad

    All links or just the ones with http://youtube.com/watch??

    Thanks for your interest in my question

    Only the link refers to youtube


    Moderator Jan Dembowski


    Volunteer Mod. & Brute Squad

    There’s a way to do it with post content using a the_content filter, but sadly I am running out the door. 😉

    I’ll post the pastebin.com link to the code tonight when I return.

    Thanks, I hope your answer

    Moderator Jan Dembowski


    Volunteer Mod. & Brute Squad

    I’ve recycled some code I’ve used previously for adding that rel="PrettyPhoto" to YouTube links and put that into a small plugin.

    Visit http://pastebin.com/J53iNwsq and you can see what I’ve done.

    You can download the text file directly via this link.

    The file will want to save as youtube-rel.php.txt but you want to rename it without the .txt extension.

    Using FTP upload that new file youtube-rel.php to your wp-content/plugins directory on your WordPress installation.

    Don’t try to use the WordPress dashboard, it won’t work for text files.

    Once that is there visit your WordPress dashboard and activate the new plugin called “YouTube PrettyPhoto links”.

    That should find your YouTube links in your posts and display them with rel="PrettyPhoto". This will not change them in the database, it will filter the_content so that what you want gets added.

    thanks dad, you’re a master, works wonders

    Moderator Jan Dembowski


    Volunteer Mod. & Brute Squad

    Old tricks are the best. I’m glad that worked. 😉

    Hi there Jan,

    Do you maybe have something like that for single images and images in a gallery.

    Many thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Insert automatic REL=prettyPhoto’ is closed to new replies.