Retrieve tags data in post body

There are two ways to approach this: modify the existing the_tags function or build your own. the_tags ultimately relies on get_the_term_list, which returns a list of hyperlinked tags. You would have to use regular expressions to add classes and styles to that using a filter. That would be quite cumbersome. So, my preferred approach would … Read more

My get_terms not working for custom fields

The issue is with ACF as discussed here along with a solution: https://support.advancedcustomfields.com/forums/topic/how-to-use-wp-term-meta-on-acf-the-easy-way/ Courtesy of various posters there, the code I added to mu-plugins is: function acf_update_term_meta($value, $post_id, $field) { $object = get_queried_object(); $term_id = intval(filter_var($post_id, FILTER_SANITIZE_NUMBER_INT)); if (!isset($object->taxonomy) || !isset($object->term_id) || $term_id != $object->term_id) { // the current object is not a term return … Read more

Using Pagination with Timber Routes

After some messing around (and actually looking at the docs properly!) I have solved the problem. In my routing, I just need to add another map to handle paging with my custom routing: Routes::map(‘items/browse/:field/:value’, function($params) { $query = array( ‘post_type’ => ‘item’, ‘meta_key’ => $params[‘field’], ‘meta_value’ => $params[‘value’] ); Routes::load(‘archive-item.php’, $params, $query); }); Routes::map(‘items/browse/:field/:value/page/:page’, function($params) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)