create-guten-block in wordpress theme?
Creator of create-guten-block here. You should be building Gutenberg blocks via companion plugins. Keep your theme for styles only 🙂 That’s the best practice for now.
Creator of create-guten-block here. You should be building Gutenberg blocks via companion plugins. Keep your theme for styles only 🙂 That’s the best practice for now.
It is not possible to assign multiple parents to the attachment. However, there is an alternative solution. You can use update_post_meta. to store the attachment id to the post and similarly, you can use function get_post_meta. for getting the attachment id.
It is good practise to use semantic versioning e.g. 1.0.1 MAJOR.MINOR.PATCH MAJOR version when you make incompatible changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Don’t update the version on every code commit in git (just do it manually), rather on every group … Read more
In is_page you are passing an array with one element that is also an array. Since $result is already an array, you should do if ( is_page( $result ) ){
Unfortunately there is no filter allowing to modify the “Show all” link directly or to add any class to this item: $output .= “<li class=”cat-item-all”><a href=”https://wordpress.stackexchange.com/questions/331852/$posts_page”>$show_option_all</a></li>”; But there is a wp_list_categories at the end of function that allows you to modify all the output. Here’s a filter that will highlight “Show all” option if no … Read more
I’m not sure if this is what you wanted, but you can use wp.customize.get() to get all the currently set Customizer settings: var settings = wp.customize.get(); // get all settings var border_style = settings[‘myplugin[border_style]’]; var border_color = settings[‘myplugin[border_color]’]; // Or, this works, too. var border_style = wp.customize.get()[‘myplugin[border_style]’]; var border_color = wp.customize.get()[‘myplugin[border_color]’]; Reference
This sounds like a timing issue, there is probably already some JS running after your script is ran. Try wrapping your JS in $(window).load(), this will run the function after other page assets have loaded and should fix the timing issue. For example… $(window).load(function() { document.getElementById(‘user_pass’).focus(); }); Here is some info about the difference between … Read more
I found the answer. Notices in the Block Editor would require JavaScript code. ( function( wp ) { wp.data.dispatch(‘core/notices’).createNotice( ‘error’, // Can be one of: success, info, warning, error. ‘Error Message.’, // Text string to display. { isDismissible: true, // Whether the user can dismiss the notice. // Any actions the user can perform. actions: … Read more
According to the documentation, the only required files in a theme are style.css and index.php. All other files are optional. You can use the ones you need and discard the ones you don’t need. If you haven’t seen it, I’d recommend you check out WordPress’s developer site on the topic of themes.
It’s one way to do it. I like it, because it allows you to write HTML code pretty easily and it makes it pretty obvious and easy to maintain. But it’s just opinion based, I guess. It doesn’t harm your performance to much. You shouldn’t use output buffering to generate whole content of the site, … Read more