How to show only one post for each categories of taxonomy of custom post that contains a specific custom field

<?php // get all terms of the `bank` taxonomy $banks = get_terms( array( ‘taxonomy’ => ‘bank’, // more arguments can be used, see (1) below the code ) ); // look through banks, picking one post from each foreach ( $banks as $bank ) { $args = array( ‘post_type’ => ‘account’, // your custom post … Read more

Adding Custom Text Area to WooCommerce Product

There is a display bug in WooCommerce when displaying a WYSIWYG editor on admin product pages inside any “product data” setting tabs. Try it: // Display a custom field in product admin pages add_action( ‘woocommerce_product_options_general_product_data’, ‘add_product_custom_wysiwyg_field’ ); function add_product_custom_wysiwyg_field() { global $product_object; echo ‘<div class=”product_custom_field”> <p>’ . __( “Mer information” ) . ‘</p> <div style=”padding:9px;”>’; … Read more

Auto-add paragraphs to custom field?

Why don’t you use apply_filters( ‘the_content’, $var ); when outputting your custom field? You don’t really want to save the extra paragraphs, otherwise you’ll end up seeing them when editing the custom field. This is not what happens with WordPress. If you’re not happy with what the_content does (it does a lot of things including … Read more