• Resolved Mew

    (@gokumew2)


    Hi.

    First off, thank you so much for this plugin! It works like a charm and I love it.

    I run a lyrics website and use the Tabby Responsive Tabs plugin to display lyrics in Japanese, transcribed Japanese, and an English translation all on one page using tabs. The Tabby plugin has a function where if you add “?target=TabTitle” to the URL, the selected tab will be open by default on page load.

    On my site, I have a Translation page where I use Display Posts Shortcode to display a list of all posts that have been tagged “translated.” If possible, I would like to add “?target=English” to the end of all the post links generated by the plugin on this page so that when users click on the link, they are automatically taken to the tab with the English translation.

    Is there any way to do this? Any help would be much appreciated. Thank you!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    This should do it for you: https://gist.github.com/billerickson/b88185ed7110df0b5a7a89d39487851b

    It modifies the output of the shortcode, changing any post permalink to “permalink + ?target=English”

    Add this to your theme’s functions.php file or a core functionality plugin.

    • This reply was modified 6 years, 7 months ago by Bill Erickson.
    Thread Starter Mew

    (@gokumew2)

    Hi.

    Thanks for the response! Will this change the permalink of all URLs displayed by the plugin though? I actually don’t want it on all URLs, just on some. If this will change for all URLs, is there a way to like use a different shortcode for the modified URL?

    I’m sorry I’m asking for so much. Thank you!

    Plugin Author Bill Erickson

    (@billerickson)

    I’ve updated the code snippet above so it only applies if you specify a ‘language’ parameter. Ex: [display-posts language=”English”]

    • This reply was modified 6 years, 7 months ago by Bill Erickson.
    Thread Starter Mew

    (@gokumew2)

    I could kiss you right now!! Thank you so much!!! It worked absolutely perfectly!!!

    Thank you so much for your time assisting me with this matter. I thought I had already rated your plugin but I guess I didn’t yet so I will go do that now. Five stars for not only the plugin but the support as well! THANK YOU!!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add arguments to post URL’ is closed to new replies.