Remove type attribute from script added by wp_localize_script
Remove type attribute from script added by wp_localize_script
Remove type attribute from script added by wp_localize_script
Search user metadata with checkboxes via ajax (almost working)
<?php ob_start(); query_posts(array(‘post_type’ => ‘topnews’)); while (have_posts()) : the_post(); ?> { // the_title() can use a false to return the value for use with strip_tags (apparently) ‘title’ : ‘<?php echo stripslashes(the_title(false)); ?>’, // Where is this $desc coming from? ‘button_list’ : [ { ‘title’:’Demo’, ‘url’ : ‘http://bonchen.net/’ }, { ‘title’:’Download’, ‘url’:’http://porfolio.bonchen.net/’} ], ‘tags’ : [‘Portrait’] … Read more
Not with the WordPress API, but you can do it with vanilla PHP pretty easily. <?php //Get the full path of the local directory first. $fullpath = __DIR__; //check if you are in a theme directory or a plugin directory if (strpos( $fullpath, ‘themes’ ) !== false ) { //It’s a theme, use get_stylesheet_uri } … Read more
You are getting this error because your edit and save function output doesn’t match. save({attributes}) { return ( <button class=”usa-button”> { attributes.text } </button> ); } precisely, { attributes.text } is the save function is not being called or used in edit function. Either add attributes.text in edit function or remove that from save function. … Read more
Display notification only once
with jquery in footer.php jQuery(document).ready(function($){ $(‘.wpcft-form-control div.checkbox’).addClass(‘col-4’); } or via css (you will have to adjust for various screen resolution and make some test) <style> .wpcft-form-control div.checkbox{width:33%;max-width:33%;float:left} </style> But I think you can create separate n separate checkboxes and wrap them in a <div class=”col-4″>[checkbox checkbox-x “option1″]</div> <div class=”col-4”>[checkbox checkbox-x “option2″]</div> <div class=”col-4”>[checkbox checkbox-x “option3”]</div> … Read more
You can access Customizer values with get_theme_mod(), so you just need to check the value of your setting before enqueueing stylesheets the normal way: function wpse_310123_enqueue_scheme_css() { $scheme = get_theme_mod( ‘theme_scheme’ ); if ( $scheme === ‘green’ ) { wp_enqueue_style( ‘theme-green’, get_theme_file_uri( ‘green.css’ ) ); } elseif ( $scheme === ‘blue’) { wp_enqueue_style( ‘theme-blue’, get_theme_file_uri( … Read more
Gutenberg – What is the best way to save/update post meta?
How to check if customize previewer is refreshing?