Querying multiple meta_keys in WordPress SQL query

WordPress Provides a native functions to query these kind of things very easily like WP_User_Query $args = array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => $meta_key1, ‘value’ => $search1, ‘compare’ => ‘LIKE’ ), array( ‘key’ => $meta_key2, ‘value’ => $search2, ‘compare’ => ‘=’ ) ) ); $user_query = new WP_User_Query( $args );

Get Value of Custom Field

As the $posts are the posts of post_type abschreibungstabelle, you can get the custom field values by using get_post_custom_values if( ! $posts ) return; $out=”<select id=”afa_select”><option>Anlagegut auswählen</option>”; foreach( $posts as $p ) { $custom_field_value = get_post_custom_values( ‘nutzungsdauer’, $p->ID ); // Now you can use the value the way you want $out .= ‘<option value=”‘ . … Read more

Extending site width according to the image size

What you need is a responsive theme that can handle wide pages gracefully. I don’t think there is any simple hack that will not break your theme if it was not designed for it. A saner option is to show a scaled down image that fits your theme and open the full image when it … Read more

title tag for custom post type remove taxonomy name from title tag

I believe that WPPizza Categories is coming from ‘name’ => _x( ‘WPPizza Categories’, ‘taxonomy general name’ ) And your url problem is coming from not setting a slug. For example: ‘rewrite’ => array( ‘slug’ => ‘pizza_categories’, ‘with_front’ => false ), You need to replace the slug with something else, as you need something in place … Read more