WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Insert automatic REL=prettyPhoto (9 posts)

  1. jose1310
    Member
    Posted 1 year ago #

    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

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

  3. jose1310
    Member
    Posted 1 year ago #

    Thanks for your interest in my question

    Only the link refers to youtube

    Thank

  4. 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.

  5. jose1310
    Member
    Posted 1 year ago #

    Thanks, I hope your answer

  6. 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.

  7. jose1310
    Member
    Posted 1 year ago #

    thanks dad, you're a master, works wonders

  8. Old tricks are the best. I'm glad that worked. ;)

  9. pietergoosen
    Member
    Posted 1 year ago #

    Hi there Jan,

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

    Many thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.