Setting custom search engine indexing for a “dynamic WordPress page” with htaccess

You’ll need the Header set …. directive, but to set it conditionally based on the URL. One way of doing this is to use mod_rewrite to set an environment variable (eg. ROBOTS_INDEX) when your URL criteria are met (for the URLs you want indexed) and use the env= argument to the Header directive to conditionally … Read more

Implement toggle switch for theme options in settings API

There are several ways to implement an options page. You can implement a quick and easy options page via Advanced Custom Fields Pro (find out more here: https://www.advancedcustomfields.com/resources/options-page/) To do things the WordPress way(without the help of plugins), you will want to follow this guide here: https://developer.wordpress.org/plugins/settings/custom-settings-page/ Once implemented, you should be able to save … Read more

write custom woocommerce templates and forms

To answer your second question you’ll have to properly enqueue the Bootstrap 4 styles and scripts: Including CSS & JavaScript | Theme Development From there you either have to add existing WooCommerce classes to your BootStrap CSS or add BootStrap classes to your WooCommerce templates (preferred/recommended). As for the templates, it really depends on which … Read more

Adding country tags automatically

I’d recommend making use of this API: https://www.countryflags.io/. You’ll also need a list of countries and country codes. Download that here: https://gist.github.com/keeguon/2310008 Then, you can do something like this to register all of the countries to your custom post type’s taxonomy. (you only really need to run this code once) $countries_json = file_get_contents(‘/countries.json/’); $countries = … Read more