[SOLVED] How do I place an embed above the post comment / submit button?
I am using a plugin for users to rate a post when they leave a comment (1 - 5 stars). It currently appears below the post comment button by default, but I would like it to appear above the post comment button. Here is the code I need to insert: <?php myrp_api_ratings_form_table(); ?>
I have been trying to insert this code in various places in the theme's comments.php file but am not having any luck. I also have not found anything by searching the forums. Anyone know? I am using WordPress 3.1 and Atahualpa 3.6.4 Thanks |
the comment form is actually built by a WordPress function 'comment_form()' so that is what you would have to edit, however you could try using the 'comment_notes_after' argument (see http://codex.wordpress.org/Function_...e/comment_form) and edit the value in comments.php
|
Thank you. I've done a lot of reading and think I would be in over my head to modify a WP function - I don't even know where to find them. I was hoping to just modify the comments.php file as you suggested. I have tried adding my php line - <?php myrp_api_ratings_form_table(); ?> using every kind of format/syntax I could think of but I always get errors. Any thoughts?
if ($bfa_ata['show_xhtml_tags'] == "Yes") { $comment_notes_after = ' <p class="thesetags clearfix">' . sprintf(__('You can use %1$sthese HTML tags</a>','atahualpa'), '<a class="xhtmltags" href="#" onclick="return false;">') . '</p> <div class="xhtml-tags"><p><code>' . allowed_tags() . ' </code></p></div>', myrp_api_ratings_form_table(); } else { $comment_notes_after = '', myrp_api_ratings_form_table(); } Thank you. |
ahhh the issue of mixing HTML and PHP, you had the right idea, just have to format it correctly. Try this
HTML Code:
if ($bfa_ata['show_xhtml_tags'] == "Yes") { HTML Code:
</code></p></div><br>'.myrp_api_ratings_form_table(); |
Oh, I see. Well, I was close at least. Strange though, it did add the ratings box but placed it on top of the "Leave A Reply" comment box. It's not even inside of the comment box borders. I don't get it. I'll have to keep experimenting I guess, but at least I know how to mix html and php now. Thank you.
|
I finally figured out how to do it (with some help). To place something above the submit button you must insert your code in place of "comment_form($comment_form_settings);" at the bottom of your comments.php file. For my situation it now looks like this. Hope this helps.
<?php // Using the new function comment_form() with the custom settings $comment_form_settings $args = array("comment_notes_after"=>myrp_api_ratings_form _table(null, true)); comment_form($args); ?> |
All times are GMT -6. The time now is 09:00 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.