skip to Main Content

WordPress – Why does the get_template_directory_uri() function work on some files and not others?

I am converting a static page to wordpress and in my index.php I use: <?= get_template_directory_uri() ?> to create links, example: <a href="<?= get_template_directory_uri() ?>/pages/login.php" class="btn btn-success btn-lg">Login</a> and that works. But I have a <a href="<?= get_template_directory_uri() ?>/pages/login.php" class="btn…

VIEW QUESTION

WordPress – Display WooCommerce selected variation additional fee from custom field

Based on Product custom field to enable a specific fee in Woocommerce answer, I have the following code: // Create and display Backend Product custom field add_action('woocommerce_product_options_general_product_data', 'ba_adding_custom_product_general_field'); function ba_adding_custom_product_general_field() { global $woocommerce, $post; echo '<div class="options_group">'; // Custom fields…

VIEW QUESTION

How do get a dropdown of all countries in WordPress

Is there a shorter way to get all countries populated options, instead of writing options one by one, in the following dropdown? <select name="input-country" id="input-country" class="form-control form-control-alternative"> <option value="">Select a country / region…</option> <option value="AF">Afghanistan</option> <option value="AX">Åland Islands</option> <option value="AL">Albania</option>…

VIEW QUESTION
Back To Top
Search