Title: prempwp's Replies | WordPress.org

---

# prempwp

  [  ](https://wordpress.org/support/users/prempwp/)

 *   [Profile](https://wordpress.org/support/users/prempwp/)
 *   [Topics Started](https://wordpress.org/support/users/prempwp/topics/)
 *   [Replies Created](https://wordpress.org/support/users/prempwp/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/prempwp/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/prempwp/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/prempwp/engagements/)
 *   [Favorites](https://wordpress.org/support/users/prempwp/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checkbox issue](https://wordpress.org/support/topic/checkbox-issue/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/checkbox-issue/#post-2775360)
 * well , makes a bit of sense only as of now, but since i am a beginner, can’t 
   expect much from myself… Thanks again.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checkbox issue](https://wordpress.org/support/topic/checkbox-issue/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/checkbox-issue/#post-2775357)
 * **keesiemeijer**, You sir, are a legend!!! Thank you so very much, it works like
   a charm now.
 * I would like to know what the problem was, theoretically, for example, was there
   an issue in my save post function??
 * 😀
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checkbox issue](https://wordpress.org/support/topic/checkbox-issue/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/checkbox-issue/#post-2775349)
 * `http://pastebin.com/jhwFFCDu`
 * Here you go Sir.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checkbox issue](https://wordpress.org/support/topic/checkbox-issue/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/checkbox-issue/#post-2775260)
 * Hey **keesiemeijer**, thanks again.
 * I tried echoing that, but all it displays is:
 * **pp_is_feat_meta = **
 * Which means, there is nothing in get_option(‘pp_is_feat_meta’); which is why 
   the problem is i suppose.
 * I also tried manually adding checked=”checked” within the input, like so:
 *     ```
       echo "<input type='checkbox' name='pp_is_feat_meta' id='pp_is_feat_meta' value='1'
       checked='checked' />";
       ```
   
 * And here, the check-box remains checked, which means the only issue is to find
   out how to get the check-box state (in our case we are using get_option(‘pp_is_feat_meta’);,
   which doesn’t seem to work)
 * As for saving the form options:
 *     ```
       add_action('save_post',function($post_id){
       global $post;
       if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;
       if($_POST && wp_verify_nonce($_POST['pp_nonce'], __FILE__)) {
       	if(isset($_POST['pp_is_feat_meta'])){
       		update_post_meta($post->ID, 'pp_is_feat_meta', $_POST['pp_is_feat_meta']);
       	}
       }
       ```
   
 * this one here, saves it on update.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checkbox issue](https://wordpress.org/support/topic/checkbox-issue/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/checkbox-issue/#post-2775253)
 * Hey, thanks, and nope, still the same… I guess that false at the end just makes
   sure that the checked=”checked” does not get displayed in browser.
 * I am actually concerned if **get_option(‘pp_is_feat_meta’)** part is correct
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checking if checkbox is checked](https://wordpress.org/support/topic/checking-if-checkbox-is-checked/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/checking-if-checkbox-is-checked/#post-2770627)
 * `<input type="checkbox" name="pp_is_feat_meta" id="pp_is_feat_meta" value="1"
   <?php checked( 'pp_is_feat_meta' , 1 ); ?> />`
 * so, is the above statement alright?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Checking if checkbox is checked](https://wordpress.org/support/topic/checking-if-checkbox-is-checked/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years ago](https://wordpress.org/support/topic/checking-if-checkbox-is-checked/#post-2770354)
 * [@frumph](https://wordpress.org/support/users/frumph/): Thanks for your reply,
   much appreciated.
 * This is the callback function where i create the check-box:
 *     ```
       function pp_is_feat_cb(){
       global $post;
       $meta = get_post_meta($post->ID, 'pp_is_feat_meta', true);
   
       wp_nonce_field(__FILE__, 'pp_nonce');
       ?>
       <label for="pp_is_feat_meta">
       <input type="checkbox" name="pp_is_feat_meta" id="pp_is_feat_meta" value="" />
       Is the post featured?</label>
   
       <?php
       }
       ```
   
 * And heres where i save the meta_boxes:
 *     ```
       add_action('save_post',function(){
       global $post;
       if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;
       if($_POST && wp_verify_nonce($_POST['pp_nonce'], __FILE__)) {
       	if(isset($_POST['pp_is_feat_meta'])){
       		update_post_meta($post->ID, 'pp_is_feat_meta', $_POST['pp_is_feat_meta']);
       	}
       }
       });
       ```
   
 * Am i wrong somewhere?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Rewriting Custom post type](https://wordpress.org/support/topic/rewriting-custom-post-type/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/rewriting-custom-post-type/#post-2670288)
 * well, tried reading it, but couldn’t figure out. Please help.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Displaying posts (tricky)](https://wordpress.org/support/topic/displaying-posts-tricky/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/displaying-posts-tricky/#post-2667788)
 * OMG this is fantastic: [@alchymyth](https://wordpress.org/support/users/alchymyth/)
   you, sir, freed me from my 3 days struggle. It all works now, it was just a minor
   CSS problem.
 * Thank you very much [@alchymyth](https://wordpress.org/support/users/alchymyth/)
   and [@esmi](https://wordpress.org/support/users/esmi/) as well.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Displaying posts (tricky)](https://wordpress.org/support/topic/displaying-posts-tricky/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/displaying-posts-tricky/#post-2667784)
 * [@alchymyth](https://wordpress.org/support/users/alchymyth/), Thanks for your
   help, i tried that code.
 * The only thing is, with that code it won’t add the
    `<li>` to the first post,
   so i modified it to this:
 *     ```
       <?php $postCount = 1; ?>
       <?php if(have_posts()) : while(have_posts()) : the_post(); $postCount++; ?>
       <?php if( $wp_query->current_post%3 == 0 || $postCount == 1) echo "\n".'<li>';
       $item_nr = ($wp_query->current_post%3+1);	?>
       /*all the code here*/
       <?php if( $wp_query->current_post%3 == 2 || $wp_query->current_post == $wp_query->post_count-1 ) echo '</li>'; endwhile; endif; ?>
       </ul>
       ```
   
 * But, now it doesn’t display anything at all. in short, this code doesn’t work.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Slider in wordpress](https://wordpress.org/support/topic/slider-in-wordpress/)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/slider-in-wordpress/#post-2665913)
 * Thanks for your reply, but that sorf of slider is not useful to me because i 
   need an image slider. Please try out the demo in this link:
    [http://css-tricks.com/anythingslider-jquery-plugin/](http://css-tricks.com/anythingslider-jquery-plugin/)
   so you know what i mean.

Viewing 11 replies - 1 through 11 (of 11 total)