Building a plugin in wordpress with checkboxes options - wordpress

I'm trying to build a widget with some checkboxes but i don't know how to save values.
is there a way to save them i'm almost at the end of finish my widget, thank you.
this part of my code:
function update($new_instance, $old_instance){
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']); // new_instance es el titulo que ingresa el usuario
$urlsprite = strip_tags($new_instance['urlsprite']);
$urlfacebook = strip_tags($new_instance['urlfacebook']);
$urltwitter = strip_tags($new_instance['urltwitter']);
$urlpicassa = strip_tags($new_instance['urlpicassa']);
$urlyoutube = strip_tags($new_instance['urlyoutube']);
$urlrss = strip_tags($new_instance['urlrss']);
$chkfacebook = $new_instance['chkfacebook'];
$chktwitter = $new_instance['chktwitter'];
$chkpicassa = $new_instance['chkpicassa'];
$chkyoutube = $new_instance['chkyoutube'];
$chkrss = $new_instance['chkrss'];
return $instance;
}
function widget($args, $instance){
extract($args);
<a id="facebook" target="_blank" href="<?php echo $instance['urlfacebook'] ?>"></a>
<a id="twitter" target="_blank" href="<?php echo $instance['urltwitter'] ?>"></a>
<a id="picassa" target="_blank" href="<?php echo $instance['urlpicassa'] ?>"></a>
<a id="youtube" target="_blank" href="<?php echo $instance['urlyoutube'] ?>"></a>
<a id="rss" target="_blank" href="<?php echo $instance['urlrss'] ?>"></a>
<?php
}

This will help you. Basic example of saving wordpress options.
<?php
// create custom plugin settings menu
add_action('admin_menu', 'baw_create_menu');
function baw_create_menu() {
//create new top-level menu
add_menu_page('BAW Plugin Settings', 'BAW Settings', 'administrator', __FILE__, 'baw_settings_page',plugins_url('/images/icon.png', __FILE__));
//call register settings function
add_action( 'admin_init', 'register_mysettings' );
}
function register_mysettings() {
//register our settings
register_setting( 'baw-settings-group', 'new_option_name' );
register_setting( 'baw-settings-group', 'some_other_option' );
register_setting( 'baw-settings-group', 'option_etc' );
}
function baw_settings_page() {
?>
<div class="wrap">
<h2>Your Plugin Name</h2>
<form method="post" action="options.php">
<?php settings_fields( 'baw-settings-group' ); ?>
<?php do_settings_sections( 'baw-settings-group' ); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">New Option Name</th>
<td><input type="text" name="new_option_name" value="<?php echo get_option('new_option_name'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Some Other Option</th>
<td><input type="text" name="some_other_option" value="<?php echo get_option('some_other_option'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Options, Etc.</th>
<td><input type="text" name="option_etc" value="<?php echo get_option('option_etc'); ?>" /></td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php } ?>
Source: http://codex.wordpress.org/Creating_Options_Pages

Related

(Magento) Display product list

How to display products in list?
Replace the whole code of list.phtml to this...
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="category-products">
<?php echo $this->getToolbarHtml() ?>
<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<table id="itemtable" style="width:100%;">
<thead><tr><th>Name</th><th>Short description</th><th>Brand</th><th>Price With Tax</th><th>Price Without Tax</th><th>Add To Cart</th></tr></thead>
<tbody>
<?php foreach ($_productCollection as $_product): ?>
<tr class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
<td><?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></td>
<td><?php echo $_product->getShortDescription(); ?></td>
<td>brand</td>
<td><?php
$_priceIncludingTax = Mage::helper('tax')->getPrice($_product, $_product->getPrice(), true, null, null, null, null, false);
echo $_priceIncludingTaxWithCurrency = Mage::helper('core')->currency($_priceIncludingTax); ?></td>
<td><?php
$_priceExcludingTax = Mage::helper('tax')->getPrice($_product, $_product->getPrice(), false, null, null, null, null, false);
echo $_priceExcludingTaxWithCurrency = Mage::helper('core')->currency($_priceExcludingTax); ?></td>
<td>
<?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form_<?php echo $_product->getId(); ?>"><input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" /><button class="form-button" onclick="productAddToCartForm_<?php echo $_product->getId(); ?>.submit()"><span><?php echo $this->__('Add to Cart'); ?></span></button></form>
<script type="text/javascript"> var productAddToCartForm_<?php echo $_product->getId(); ?> = new VarienForm('product_addtocart_form_<?php echo $_product->getId(); ?>'); productAddToCartForm_<?php echo $_product->getId(); ?>.submit = function(){ if (this.validator.validate()) { this.form.submit(); } }.bind(productAddToCartForm_<?php echo $_product->getId(); ?>);</script>
<?php endif;?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
<?php endif; ?>
<div class="toolbar-bottom">
<?php echo $this->getToolbarHtml() ?>
</div>
</div>
<?php endif; ?>
<?php
//set product collection on after blocks
$_afterChildren = $this->getChild('after')->getSortedChildren();
foreach($_afterChildren as $_afterChildName):
$_afterChild = $this->getChild('after')->getChild($_afterChildName);
$_afterChild->setProductCollection($_productCollection);
?>
<?php echo $_afterChild->toHtml(); ?>
<?php endforeach; ?>
<style>
#itemtable th{ font-weight:bold!important;text-align:center!important;}
#itemtable tr{ height:50px!important;}
#itemtable tr td{ text-align:center!important;}
</style>
Let me know if you have any query...

Logic rules want pop up if Enable conditional logic?

This is code....
<?php
if (!defined('IPHORM_VERSION')) exit;
if (!isset($element['logic'])) $element['logic'] = false;
?>
<tr valign="top">
<th scope="row">
<label for="prevent_duplicates_<?php echo $id; ?>"><?php esc_html_e('Enable conditional logic', 'iphorm'); ?></label>
</th>
<td>
<input type="checkbox" id="logic_<?php echo $id; ?>" name="logic_<?php echo $id; ?>" <?php checked(true, $element['logic']); ?> onclick="iPhorm.toggleLogic(iPhorm.getElementById(<?php echo $id; ?>));" />
<p class="description">
<?php
if ($element['type'] == 'groupstart') {
esc_html_e('Enables you to create rules to show or hide this group depending on the values of other fields', 'iphorm');
} else {
esc_html_e('Enables you to create rules to show or hide this field depending on the values of other fields', 'iphorm');
}
?>
</p>
</td>
</tr>
<?php
if (!isset($element['logic_action'])) $element['logic_action'] = 'show';
if (!isset($element['logic_match'])) $element['logic_match'] = 'all';
if (!isset($element['logic_rules'])) $element['logic_rules'] = array();
?>
<tr valign="top" class="ifb-show-if-logic-on <?php if (!$element['logic']) echo 'ifb-hidden'; ?>">
<th scope="row">
<label><?php esc_html_e('Logic rules', 'iphorm'); ?></label>
</th>
<td>
<div id="ifb_logic_rules_<?php echo $id; ?>"></div>
</td>
</tr>
Create toggleLogic() javascript function and put your popup box code and check your logic to display content.
Like this.
function toggleLogic(someid)
{
// your logic code
...
}

Wordpress custom post template page/2 loop not working

I have a loop in the sidebar of a custom template and it works perfectly when the page is loaded. The page is -
http://ere.doneready.com/senior-consultants
However the loop (which shows the list of names) does not work when I click the "next" button i.e. this page -
http://ere.doneready.com/senior-consultants/page/2/
Can anyone help? The following is the code I use -
<div id="people-sidebar-content">
<div id="custom-search-form-for-people">
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div id="custom-search-form-label"><label for="s" class="assistive-text"><?php _e( 'SEARCH' ); ?></label></div>
<span id="search-box-box"><input class="search-box" type="text" name="s" id="s" /></span>
<span id="search-box-button"><input type="image" name="submit" id="searchsubmit" SRC="http://www.doneready.com/ere/wp-content/themes/ere/images/search_button.png" HEIGHT="17" WIDTH="20" BORDER="0" ALT="Submit Form"></span>
</form>
</div>
<div id="people-sidebar-content-usable" class="senior-consultants-active">
<div id="sidebar-for-people">
<a class="directors" href="http:/www.ere.doneready.com/directors/">Directors</a><br />
<a class="finance-admin" href="http:/www.ere.doneready.com/finance-and-admin/">Finance & Admin</a><br />
<a class="senior-consultants" href="http:/www.ere.doneready.com/senior-consultants/">Senior Consultants</a><br />
<div id="actual-people-list">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
'post_type'=>'staff',
'posts_per_page' => 99,
'paged'=>$paged,
'staff_categories'=>'Senior Consultants'
);
$temp1 = $wp_query;
$wp_query= null;
$wp_query = new WP_Query($args);
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
<div class="actual-people-list-single">
<a href ="<?php the_permalink(); ?>">
<?php echo esc_html( get_post_meta( get_the_ID(), 'staff_short_name', true ) ); ?>
</a>
</div>
<?php
endwhile; endif;
/* PageNavi at Bottom */
$wp_query = null;
$wp_query = $temp1;
wp_reset_query();
?>
</div>
<a class="consultants" href="http:/www.ere.doneready.com/consultants/">Consultants</a><br />
<a class="technical-support" href="http:/www.ere.doneready.com/technical-support/">Technical Support</a>
</div>
</div><!--END PEOPLE-SIDEBAR-CONTENT-USABLE-->
</div><!--END PEOPLE-SIDEBAR-CONTENT-->
</div><!--END CONTENT CONTAINER-->
</div><!--END PAGE-WRAP-->
Welcome to StackOverflow, try to search the archives at least semi-extensively first because many variations of this question exist. Here's a link to my answer to a very similar question, it worked for me, it might work for you:
Making a single page blog in WordPress
Solved. I used a new loop and the code looks like this now -
<div id="people-sidebar-content">
<div id="custom-search-form-for-people">
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div id="custom-search-form-label"><label for="s" class="assistive-text"><?php _e( 'SEARCH' ); ?></label></div>
<span id="search-box-box"><input class="search-box" type="text" name="s" id="s" /></span>
<span id="search-box-button"><input type="image" name="submit" id="searchsubmit" SRC="http://www.doneready.com/ere/wp-content/themes/ere/images/search_button.png" HEIGHT="17" WIDTH="20" BORDER="0" ALT="Submit Form"></span>
</form>
</div>
<div id="people-sidebar-content-usable" class="senior-consultants-active">
<div id="sidebar-for-people">
<a class="directors" href="http:/www.ere.com.my/directors/">Directors</a><br />
<a class="senior-consultants" href="http:/www.ere.com.my/senior-consultants/">Senior Consultants</a><br />
<div id="actual-people-list">
<?php
$args = array( 'post_type' => 'staff', 'staff_categories'=>'Senior Consultants', 'posts_per_page' => 50 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="actual-people-list-single">
<a href ="<?php the_permalink(); ?>">
<?php echo esc_html( get_post_meta( get_the_ID(), 'staff_short_name', true ) ); ?>
</a>
</div>
<?php
endwhile;
?>
<?php
wp_reset_query();
?>
</div>
<a class="consultants" href="http:/www.ere.com.my/consultants/">Consultants</a><br />
<a class="technical-support" href="http:/www.ere.com.my/technical-support/">Technical Support</a>
<a class="finance-admin" href="http:/www.ere.com.my/finance-and-admin/">Finance & Admin</a><br />
</div>

CSS Styled Option Buttons?

I'm working through some touches on an e-commerce site for someone and have run into something I'm not sure about. The product page currently has radio buttons for choosing a product size. I had a drop down menu in before. The client wants styled square buttons similar to those on here.
Section of my code currently reads...
<td valign="top" width="910">
<div id="content"><?php echo $content_top; ?>
<h1><?php echo $heading_title; ?></h1>
<div class="right">
<?php if ($price) { ?>
<div class="price">
<?php if (!$special) { ?>
<?php echo $price; ?>
<?php } else { ?>
<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
<?php } ?>
<br />
<?php if ($tax) { ?>
<?php } ?>
<?php if ($points) { ?>
<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
<?php } ?>
<?php if ($discounts) { ?>
<br />
<div class="discount">
<?php foreach ($discounts as $discount) { ?>
<?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
<?php } ?>
</div>
<?php } ?>
</div>
<?php
$get_meta_desc = "SELECT meta_description
FROM product_description
WHERE product_id = '".$product_id."'";
$get_meta_res = mysql_query($get_meta_desc);
$meta_desc = mysql_fetch_array($get_meta_res, MYSQL_ASSOC);
if ($meta_desc['meta_description']) {
echo "<p id=\"cmmeta-desc\">".$meta_desc['meta_description']."</p>";
}
mysql_free_result($get_meta_res);
?>
<?php } ?>
<?php if ($options) { ?>
<div class="options">
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'select') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<select name="option[<?php echo $option['product_option_id']; ?>]">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($option['option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</option>
<?php } ?>
</select>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'radio') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php } ?>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'checkbox') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"> <?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php } ?>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'text') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'textarea') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'file') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<a id="button-option-<?php echo $option['product_option_id']; ?>" class="button"><span><?php echo $button_upload; ?></span></a>
<input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'date') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'datetime') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'time') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
</div>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<div class="cart">
<div><?php echo $text_qty; ?>
<input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
<input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
<a id="button-cart" class="button2"><span>ADD TO BAG</span></a></div>
<?php if ($minimum > 1) { ?>
<div class="minimum"><?php echo $text_minimum; ?></div>
<?php } ?>
</div>
Never really done anything like these before...
Many Thanks
L
This is a really good tutorial on styling radio buttons.
http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/
From there you can get what your after pretty easily :)
Hope this helps you out!
In the site you linked, they are using a select element with the options inside it. It is then hidden with Javascript, and a list of links (a) is constructed using the dropdown options, which can be easily styled. If you click one of the links, they are tied to the original select element. This can be easily achieved with Javascript.
If you disable Javascript in your browser, and check out that site, you will see the underlying form elements.
Unfortunately, elements like radio buttons, checkboxes and dropdowns cannot really be styled through CSS, only in a very limited way. Most solutions (like the one posted by #Graeme, but there are thousand others) use Javascript to hide these elements and use a substitute element whose actions are linked to the original element.
If you only want to use CSS, there is a tricky CSS3 solution, but it will only work in modern browsers (no IE8 or lower). You can see an example in one of my previous posts: Custom Checkbox .
I think you are referring to the 'GO' button. This is an input element of the type image. Which means it's a clickable button that consists of an image. So in order to get the nice square button, you have to create an image, upload it, and refer to it in the src attribute of your input tag.
Here's an example that looks quite dated, but is simple and straight forward: http://www.echoecho.com/htmlforms14.htm
It also describes the options.
Perhaps a useful tip, if you're not already using it: if you come across something on a site that you want to use, use an inspection tool, like Firebug for Firefox, to see how it's made.
EDIT:
The product size buttons are not actually radio buttons, they are list items <li> and styled using CSS. The value that they represent, are registered using a piece of javascript. This info is posted when you hit the submit button. I don't know If you're familiar with javascript and/or are using a javascript framework, but your situation would be a good one to utilize it.
I've created this jsfiddle with a very straightforward solution, using plain javascript: http://jsfiddle.net/r2K9h/3/
it sets a hidden input field with the size selected. So when you send the form, this value will be submitted as well.

WordPress 'comment is awaiting moderation.' message not appearing when a comment is submitted?

Everything is pretty standard from WP samples, with minor modifications. But when a comment is submitted, it does not show the "your comment is awaiting moderation" message.
The comments.php:
<div id="comment-block">
<h4><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h4>
<ul id="commentlist">
<?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>
</ul>
<?php // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<h4>Leave a reply</h4>
<div class="cancel-comment-reply">
<small><?php cancel_comment_reply_link(); ?></small>
</div>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be logged in to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p class="loggedIn">Logged in as <?php echo $user_identity; ?>. Log out »</p>
<?php else : ?>
<table width="675" cellpadding="0" cellspacing="0" border="0">
<tr><td style="padding-right: 20px;"><label for="author">Name <?php if ($req) echo "(required)"; ?></label></td>
<td style="padding-right: 20px;"><label for="email">Email <?php if ($req) echo "(required)"; ?></label> <small>(will not be published)</small></td>
<td><label for="url">Website <?php if ($req) echo "(required)"; ?></label></td>
</tr>
<tr><td style="padding-right: 20px;"><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" class="text" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /></td>
<td style="padding-right: 20px;"><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" class="text" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /></td>
<td><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" class="text" tabindex="3" /></td>
</tr>
</table>
<?php endif; ?>
<label for="comment">Comment <?php if ($req) echo "(required)"; ?></label><br />
<textarea name="comment" id="comment" rows="10" tabindex="4" class="text"></textarea>
<input name="submit" type="image" src="<?php bloginfo('template_directory'); ?>/images/submit_button.png" width="130" height="24" alt="Submit" id="submit" tabindex="5" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<div class="clear"></div>
<?php endif; // If registration required and not logged in ?>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>
And the mytheme_comments function in functions.php
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<span class="comment-author vcard">
<?php printf(__('<cite class="fn">%s</cite> <span class="says">says at</span>'), get_comment_author_link()) ?>
</span>
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.') ?></em>
<br />
<?php endif; ?>
<span class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
<?php printf(__('%2$s, %1$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></span>
<?php comment_text() ?>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php
}
?>
my English is poor !
i have got the solution if you can try !
this problem generally related to actual domain with hosted site
eg.
<1>if your site hosted on "anotherdomainsite.com"
and your domain is "yoursite.com" then this problem will occur !
you can try to change your actual domain ! which is actually hosted your site!
means both hosted & domain should be same !
<2> thing you can try
submit a comment on your site
when you are done
replace the actual hosted domain instead of pointed domain
eg.
http://yoursite.com/yourposturl/#comment-265
place anotherdomainsite.com instead of yoursite.com

Resources