how to get value of a select box in custom widget wordpress

I am trying to make a custom widget. My codes are as follows: class techno_widget extends WP_Widget { function __construct() { parent::__construct( ‘techno_widget’, __(‘Recent Full Post’, ‘techno_widget_domain’), array( ‘description’ => __( ‘A full post will be appeared on Sidebar’, ‘techno_widget_domain’ ), ) ); } public function widget( $args, $instance ) { $title = apply_filters( ‘widget_title’, $instance[‘title’] ); $blog-title = $instance[‘blog-title’]; echo $args[‘before_widget’]; if ( ! empty( $title ) ) echo $args[‘before_title’] . $title . $args[‘after_title’]; echo $instance[‘blog-title’]; echo $args[‘after_widget’]; } public function form( $instance ) { if ( isset( $instance[…

Web Design Weekly #250

Articles Writing Less Damn Code I’m a bit of a fan of Heydon Pickering’s thinking to be honest but it is a fine line. In this post Heydon shares a few use cases of why we should all aim to write less code and passes on few tips and ideas that might help us achieve the desired result. ( The target=”_blank” vulnerability by example Quite an eye opener… You may have read about this over the last few months but seeing an example sure does get you thinking. ( How…

Is there a template file to list all terms of a given custom taxonomy?

Suppose we registered the composers and the interprets custom taxonomies. The composers taxonomy could have the following terms: Wolfgang Amadeus Mozart Ludwig van Beethoven Richard Wagner The interprets taxonomy could have the following terms: Glenn Gould Daniel Barenboim Vienna State Opera I am wondering whether the WordPress template hierarchy has a special file , like taxonomy-terms.php, to list taxonomy terms with a simple loop: <?php while ( have_posts() ) : the_post(); the_title(); endwhile; ?> This would print (assuming the /%postname%/ permalink setting): Wolfgang Amadeus Mozart, Ludwig van Beethoven, Richard Wagner…

rest api request including meta_query filter

I’m creating a web service using the WP REST API v.2. Is it possible to include something like a meta_query filter when requesting a custom post type? For example, if I was using WP_Query, I could do this: $args = array( ‘post_type’ => ‘proposal’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘deadline’, ‘value’ => current_time( ‘m/d/Y’ ), ‘compare’ => ‘>=’, ) ) ); $proposals_query = new WP_Query( $args ); Is it possible to accomplish the same thing in a REST request? The example goal would be to let…

Showing comments only to same custom user role

Is there a way I could show only the comments by a particular user role to his same user role? For example: The logged in user belongs to the « Advertisers » user role, he should only see the comments made by him and all users under his role. Thank you. Source:

[CSS] Un effet de cible sur un bloc

Ayant eu le besoin pour un client de faire un effet « cible » sur les produits de sa boutique en ligne, j’ai décidé de tester cela en « full » CSS (sans images) et le résultat n’est pas si mal. Vous l’aurez compris, ce petit article sera consacré à mettre en place un effet «… Source:

WP-CLI wp theme install url PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

I tried use wp-cli theme install with option url from my dropbox link. But unfortunately, I got this problem: PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature This mean my zip file is corrupt. But I tried upload it through wordpress dashboard and it’s work good. I tried again with free theme in and it’s work good too, so maybe the problem in my vps setting? Maybe someone meet this problem, has resolved it and help me sort it out? Reference: Source:

How to count data records in wordpress which have same meta_value in wp_postmeta table?

I want to get number or count of same meta_value of meta_key == ‘parent_id’.How can i get it? What should be the wordpress query for counting records in same table? //set the meta_key to the appropriate custom field meta key $meta_key = ‘parent_id’; $allmiles = $wpdb->get_var( $wpdb->prepare( « SELECT meta_value, SUM(IF(meta_value = « Purva », 1,0)) AS ‘parent_id’, COUNT(meta_value) AS ‘total’ FROM $wpdb->wp_postmeta GROUP BY post_id ORDER BY parent_id DESC », $meta_key ) ); echo « <p>Total miles is {$allmiles}</p> »; Source: