Showing Meta Box via Jquery Checkbox

Found a solution to it though, pretty simple <script type=”text/javascript”> jQuery(document).ready(function($) { var dw_match_display = $(‘#dw_match_display’); dw_match_display.hide(); if ($(‘#dw_complete’).prop(‘checked’) ) { dw_match_display.show(); } $( ‘#dw_match_details’ ).on( ‘change’, ‘#dw_complete’, function() { dw_match_display.hide(); if ( $(this).prop(‘checked’) ) { dw_match_display.show(); } }); }); jQuery(document).ready(function($) { $( ‘#dw_match_display’ ).change(); }); </script>

Display content of metabox if filled in

Under the premise, that website-link-project is the key of the postmeta in question and you know the post’s ID (or this being in The Loop, respectively): <?php /* store post ID and metadata in variables */ $postid = get_the_ID(); $website_link = get_post_meta( $postid, ‘website-link-project’, true ); /* output some HTML on the condition of $website_link … Read more

How to add functionality to an existing theme (using child themes)

You also have a functions.php file which is really powerful in your child theme. You can override main theme functions, add new features – whatever you want. First thing I do in my child theme (usually) is add my google verification code. function lmc_do_meta_tags(){ echo “<meta name=\”google-site-verification\” content=\”YOUR-CODE-HERE\” />”; } add_action(‘wp_head’, ‘lmc_do_meta_tags’);

WooCommer Product Category Loop – How to change the display order of the rating and price?

For example you just want to swap rating and price where price would come before rating, you would do the following. remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 ); remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 5 ); add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 11 ); add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 12 ); Put these lines of code in your theme’s functions.php file.

Translating (WooCommerce) placeholder text

You can filter gettext: add_filter( ‘gettext’, function( $translation, $text, $domain ) { if ( ‘woocommerce’ === $domain and ‘Select a state&hellip;’ === $text ) return ‘Select a province&hellip;’; return $translation; }, 10, 3 ); Note the 3 as last parameter. This ensures you get all three variables passed, so you can replace exactly the text … Read more

Is “get_template_part” hierarchy possible?

Yes, what you describe is already built in to the get_template_part() function: <?php get_template_part( $slug, $name ); ?> Where “masthead” is the general template slug in your example, and “custom” is the more specialized version. You’ll have to name your parts slug-name.php (so, masthead-custom.php, rather than custom-masthead.php). Note that you can also use the value … Read more