| | #1 |
| Watching you... War Room Member Join Date: 2008 Location: Waterdown, Ontario, Canada
Posts: 8,208
Thanks: 2,059
Thanked 3,699 Times in 2,243 Posts
Blog Entries: 2 |
I suck at JS... Here is what I need: Setup - WP blog, comments are allowed, not moderated. When a visitor submits a comment (i.e. clicks the Submit button) and the comment goes through - I need a one-line code to appear above the comment form. It will be an anchor tag displaying a link. The idea is the blog post will about a discount sale but they need to comment to get the link ![]() PM me if you can help! Thanks |
| | |
| |
| | #2 |
| Web Developer Join Date: 2010 Location: Wisconsin
Posts: 322
Thanks: 2
Thanked 80 Times in 74 Posts
|
Will it be one link for all posts comments or different for each. Example, If I post a comment on the post Test Post one and a comment on Test Post two Will I get the same link? If not and it is a specialized link for each post then it gets more complicated. |
| | |
| |
| | #3 |
| Watching you... War Room Member Join Date: 2008 Location: Waterdown, Ontario, Canada
Posts: 8,208
Thanks: 2,059
Thanked 3,699 Times in 2,243 Posts
Blog Entries: 2 |
One link for all. It is a temporary thing, e.g. leave a comment and you will get the discount coupon (or something like that). I can do it on a simple html page but cannot make it work on a WordPress comment. |
| | |
| |
| | #4 |
| Web Developer Join Date: 2010 Location: Wisconsin
Posts: 322
Thanks: 2
Thanked 80 Times in 74 Posts
|
I have worked this out in PHP, if it will work for you Add this code to the end of your active themes functions.php PHP | function comment_extras ($loca - Content on Comment Submit - dgUuq7wJ - Pastebin.com Then add this to your templates that you have comments open on eg, page.php single.php I put it after the container div for the previous and next links PHP | <?php if (isset($_GET['thanky - Content on Comment Submit - w9GED2x3 - Pastebin.com Then in the same templates (outside the loop, before the <?php if(have_posts()) add this jQuery code Note: if you don't have jQuery in your theme you will need this line <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/JavaScript"></script> Here is the complete jQuery JavaScript | <!-- If you don't have jQuery - Content on Comment Submit - Df9KF4W9 - Pastebin.com What it does is animate the box to hidden after about 8 seconds Good Luck |
| | |
| |
|
| Bookmarks |
| Tags |
| help or job, javascript, quick |
| |