Manipulating images inside post content

Because the old image_send_to_editor function did NOT include the wp-image-xxxxx class with the image ID, we have to make database queries to find the correct ID for a given image. Making database queries for every image does not seem like a good idea. The only real solution is to manually delete and re-add the images … Read more

Display new posts categories in separated divs

You should first make a query to retrieve all your categories. This can be done using: $categories = get_categories(array(‘hide_empty’=> 0,)); Now that you have a list of your categories as object, you have to run a foreach to output their content: foreach ($categories as $category) { $params = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘product’, … Read more

WP_Query extended with AJAX

this is my geo_query extension of wp_query: add_filter( ‘posts_fields’, ‘willy_geo_fields’, 10, 2 ); function willy_geo_fields( $fields, $q ) { if ( isset( $q->query_vars[‘geo_query’][‘latfrom’], $q->query_vars[‘geo_query’][‘lngfrom’], $q->query_vars[‘geo_query’][‘latto’], $q->query_vars[‘geo_query’][‘lngto’], $q->query_vars[‘geo_query’][‘distancefrom’], $q->query_vars[‘geo_query’][‘distanceto’] ) ) { global $wpdb; $fields .= $wpdb->prepare(“, ( 6371 * acos( cos( radians( %f ) ) * cos( radians( metalatfrom.meta_value ) ) * cos( radians( metalngfrom.meta_value … Read more

Post by Email – Shortcode for Language? [closed]

I haven’t found a way to get Jetpack and Polylang to properly work together when it comes to pushing posts by mail into the desired language category. But, i have found a plugin that offers that called Postie. The Polylang addon costs 29$. http://postieplugin.com/

Creating custom post type relationships

Here, WordPress doesn’t allow to run URL in two way. e.g. (1) www.example.com/work/directors-cut-best-in-the-world/ (2) www.example.com/director/wes-pollitt/directors-cut-best-in-the-world/ You should decide which URL do you want to run in browser. If you want to run single URL then check this : Add category base to url in custom post type/taxonomy You can conditionally change permalink before load.