Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Comments, trackbacks & pings »

[SOLVED] How do I place an embed above the post comment / submit button?


  #1  
Old Apr 1, 2011, 01:10 AM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
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
  #2  
Old Apr 1, 2011, 04:43 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Apr 2, 2011, 02:21 AM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
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.
  #4  
Old Apr 2, 2011, 05:58 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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") {	
	$comment_notes_after = '<br><strong>hello paul</strong>
		<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();
}
When adding something to a string, you concatenate it using the period. You may want to add a <br> after the last </div> if it doesn't look right - so you would have
HTML Code:
</code></p></div><br>'.myrp_api_ratings_form_table();
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Apr 3, 2011, 01:25 AM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
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.
  #6  
Old May 30, 2011, 02:24 PM
azazure
 
25 posts · Jan 2011
Gilbert, AZ
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);
?>

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Submit Comment" Button dumafiga Center area post/pages 1 Sep 3, 2010 02:52 PM
adding a submit button to the header search box eyelight Header configuration & styling 2 Aug 2, 2010 07:16 AM
Changing Hover Color of "Submit Comment" Button adum Comments, trackbacks & pings 2 Jun 21, 2009 03:37 PM


All times are GMT -6. The time now is 12:23 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.