How do I create a custom add media button modal?

You can inspire from this tutorial here: http://www.sitepoint.com/adding-a-media-button-to-the-content-editor/ For videos you can change the library type to ‘video’: function open_media_window() { var window = wp.media({ title: ‘Insert a media’, library: {type: ‘video’}, multiple: false, button: {text: ‘Insert’} }); } Hope this helps.

Button not refreshing page

Because onsubmit event not working with “input” tag. You can see more details in https://www.w3schools.com/jsref/event_onsubmit.asp Supported HTML tags: form, keygen Replace code to <form method=”post” onSubmit=”window.location.reload()”> <input type=”submit” name=”switchlon” id=”switchlon” value=”Switch to London” /><br/> </form> or <form method=”post” > <input type=”submit” name=”switchlon” id=”switchlon” onClick=”window.location.reload()” value=”Switch to London” /><br/> </form>

Insert a button on a page with random number generation

all thing you have to do is use javaScript function JavaScript Example: var random_number = function(){ return Math.floor(Math.random() * 10000) + 1; }; document.getElementById(‘button_text’).onclick = function () { document.getElementById(“input_box”).innerHTML = random_number(); }; jQuery Example: $.randomBetween(0,10000);

Gutenberg Button Border Radius Default

This should theoretically work by defining the initial value in theme.json as shown in these examples https://gist.github.com/skorasaurus/d50ea7eb79d664775418492e46cef021 and https://github.com/WordPress/theme-experiments/blob/304e6ef3d561f048c87d9bc27311328ae8197bae/tt1-blocks/theme.json#L276 however, the value is still unset when I tried it out in a theme and it appears they may have disabled it – https://github.com/WordPress/gutenberg/issues/29210

Dont’t change active Button while I’m listing a category?

Okay, I did it this way:: add_filter(‘nav_menu_css_class’ , ‘special_nav_class’ , 10 , 2); function special_nav_class($classes, $item){ if(is_category() && $item->title == “Blog”){ //Notice you can change the conditional from is_single() and $item->title $classes[] = “special-class”; } return $classes; }