Only display on sidebar if only got value inserted on post

Try using this: // Get the ‘WpForest_soft’ custom field value. $text = get_post_meta( $post->ID, ‘WpForest_soft’, true ); // Print the value and surrounding markup only if the value tests true. if ( $text ) printf( ‘<tr><td class=”attr-name”>%s</td><td class=”attr-detail”>%s</td></tr>’, __( ‘Software Version’, ‘WpForest’ ), $text ); General Case To do the above with any optional markup … Read more

multiple excerpt length and styles

Are you aware of the uses of the More Tag? Customizing the Read More shows many uses of variable length teasers with variable link phrases to read more. For example, this markup entered in the Post editor will provide a link with Read the rest of this story in the anchor text. <!–more Read the … Read more

Fetch the input type date value via ajax

If you want to post the value as soon as user has entered the date and click somewhere else, this might help you: jQuery(‘#your-name’).on(‘blur’, function(){ var date_Value = this.value; var ajaxdata = { action: ‘process_date’, date_value: date_Value }; jQuery.post(ajaxurl, ajaxdata, function(res){ /* whatever you want to do, res contains the output generated by your php … Read more

Upload image to wordpress

Output during saving You can not print something during the data is saved. If you use die( var_dump( $your_var ) ); it will print the values, but also stops the script. The reason is, first the data will be parsed. Then you will be redirected back to profile.php. So everything you print while parsing the … Read more

Google Search and Own Website Search?

Why not create a form that submits direct to Google? This would be the simplest solution (assuming you want to search every website in the world): <form action=”http://www.google.com/search” method=”get”> <input type=”text” name=”q” placeholder=”Search Google”/> <input type=”submit” /></form> I believe that would do the job you want it to. The result would look something like: https://www.google.com/search?q=this%20that