Copy/clone/associate Custom field to Custom Taxonomy

Here is a simple plugin with the convert function from the plugin you linked and a simple WordPress cron setup to run daily just make sure you change CUSTOM_FIELD_KEY and TAXONOMY_NAME to the actual values <?php /* Plugin Name: wpse62432 Plugin URI: http://en.bainternet.info Description: Answer to http://wordpress.stackexchange.com/questions/62432/copy-clone-associate-custom-field-to-custom-taxonomy Version: 1.0 Author: bainternet Author URI: http://en.bainternet.info */ … Read more

Trying to add taxonomy to get_categories() but it’s not working. How to fix this?

Use : $terms = get_terms( ‘location’, ‘hide_empty=0′ ); if(is_wp_error($terms)){ // error occurred } else if (empty($terms )){ // no terms were found } else { // process terms foreach($terms as $term){ // process this individual $term } } I’d advise you use the generic taxonomy & term functions everywhere, and avoid the special case category … Read more

Website loading slowly – Advanced Custom Fields images

I have managed to work it out – the function was leading to a lot of queries, so I rewrote it as follows: $housePhotos = get_post_custom_values(‘house_photos’); $housePhotos = explode(‘;’,$housePhotos[0]); preg_match_all(‘`”([^”]*)”`’, $housePhotos[1], $results); $imageURL = wp_get_attachment_image_src( $results[1][0], ‘house_search’ ); if (!empty($results[1][0])) { echo ‘<img src=”‘ . $imageURL[0] .'” alt=”” />’; }

Using wp_dropdown_categories in widget options

I got it 🙂 thanks to this function update( $new_instance, $old_instance ) { $instance = $old_instance; //Strip tags from title and name to remove HTML $instance[‘title’] = strip_tags( $new_instance[‘title’] ); $instance[‘kwtax’] = strip_tags( $new_instance[‘kwtax’] ); return $instance; } function form( $instance ) { //Set up some default widget settings. $defaults = array( ‘title’ => __(‘Equipment … Read more

get_term_link not working

That field can return multiple term objects depending on how you’ve got it configured, so I’ll guess that $series in this case is an array containing a single element, which contains your term object. Try inspecting the contents of series: print_r( $series ); You’ll probably see something like: Array ( [0] => stdClass Object ( … Read more