Hot answers tagged

1

Managed to get it working with the following code: <?php $terms = wp_get_object_terms($post->ID, 'product_category'); if(!empty($terms)){ foreach($terms as $term){ $exampleName = $term->name; $exampleSlugs[] = $term->slug; $category_colour_primary = get_field('category_colour_primary', $term); $category_colour_secondary = ...


1

I would try something like this... // Assume there is only one category. $product_category = get_the_terms($post, 'product-category')[0]; $cat_fields = get_fields("term_$product_category"); $color = $cat_fields['category_colour_primary']; You could also do this... // Assume there is only one category. $product_category = get_the_terms($post, '...


1

Yep, there's a hook to change the lost password URL. I found it by going to this nice page to search all the hooks and filters and selecting 'Hooks' and trying 'lost password' https://developer.wordpress.org/reference/ An example from here: https://codex.wordpress.org/Plugin_API/Filter_Reference/lostpassword_url add_filter( 'lostpassword_url', '...


1

Firstly add this two line to your functions.php file. Sorry I forgot to mention about this earlier. require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; now you can use WP_Filesystem_Direct::get_contents($path) instead of file_get_contents($path)


1

OK so I have had this problem with searching custom fields data. The thing is with the native Wordpress search, is that is really good, fast and powerful, but it's limitations is that it only searches the wp_posts table. It does not frickin' query the wp_postmeta table! So to make the most of the native Wordpress search, what you can do is tailor the exact ...


Only top voted, non community-wiki answers of a minimum length are eligible