[Solved] The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null

So, I was researching this topic a bit deeper. All answers found on this SE suggested disabling Gutenberg with a plugin. This couldn’t be a valid “fix” in my oppinion. After researching and browsing through the git issues of WordPress/gutenberg I’ve found a pretty easy solution for this problem. The user joshuafredrickson on the git … Read more

[Solved] Woocommerce category description as subtitle

There is an extra hook you can use for this woocommerce_archive_description, hook into it like this: add_action( ‘woocommerce_archive_description’, ‘wc_category_description’ ); function wc_category_description() { if ( is_product_category() ) { global $wp_query; $cat_id = $wp_query->get_queried_object_id(); $cat_desc = term_description( $cat_id, ‘product_cat’ ); $subtit=”<span class=”subtitle”>”.$cat_desc.'</span>’; echo $subtit; } } 0 solved Woocommerce category description as subtitle

[Solved] How to add wordpress username after url?

You can do <?php if( get_current_user_id() ): // check if user is loggedin $current_user = wp_get_current_user(); //get user ?> <a href=”https://direktoriku.com/shopping/?user=<?php echo $current_user->user_login;?> <button>Click me</button> </a> <?php endif;?> 1 solved How to add wordpress username after url?

[Solved] Removing the default sidebar from admin panel

If you mean the default WordPress Widgets, you would add this to the functions.php file: <?php // unregister all default WP Widgets function unregister_default_wp_widgets() { unregister_widget(‘WP_Widget_Pages’); unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Archives’); unregister_widget(‘WP_Widget_Links’); unregister_widget(‘WP_Widget_Meta’); unregister_widget(‘WP_Widget_Search’); unregister_widget(‘WP_Widget_Text’); unregister_widget(‘WP_Widget_Categories’); unregister_widget(‘WP_Widget_Recent_Posts’); unregister_widget(‘WP_Widget_Recent_Comments’); unregister_widget(‘WP_Widget_RSS’); unregister_widget(‘WP_Widget_Tag_Cloud’); unregister_widget(‘WP_Nav_Menu_Widget’); } add_action(‘widgets_init’, ‘unregister_default_wp_widgets’, 1); ?> EDIT: register_sidebar(array(‘name’=>’sidebar2’, ‘before_widget’ => ‘<ul><li>’, ‘after_widget’ => “</li></ul>”, ‘before_title’ => ‘<h2 class=”widgettitle”>’, … Read more

[Solved] probleme adding Txt and Links in preg_match()

Finally a solution provide by @Rizier123 if(!preg_match(“https://wordpress.stackexchange.com/” . preg_quote($citation_string, “https://wordpress.stackexchange.com/”) . “https://wordpress.stackexchange.com/”, $footer_contents)) @Rizier123 say : The problem are the slashes in your pattern, just use preg_quote() to escape them, e.g. so the code will be like this : add_action(‘template_redirect’, ‘foobar_explode_if_no_citation’); function foobar_explode_if_no_citation(){ #Get the absolute server path to footer.php $footer_path = locate_template(‘footer.php’); #Store the … Read more

[Solved] How do you modify CSS files via admin panel?

If you’re wanting styles to be dynamic, then you’ll have to emit your CSS file as you are suggesting. However, as WordPress often uses styles.css as a theme definition file, renaming styles.php might cause problems. It might be better to collect all the ‘dynamic’ definitions into a separate file (eg dynamic-styles.php) and import them from … Read more

[Solved] Display Categories Assigned to a WooCommerce Product

I have solved the issue with creating a list with http://codex.wordpress.org/Template_Tags/wp_list_categories changing style to list, then style it with CSS to my needs 🙂 <?php $taxonomy = ‘product_cat’; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( ‘fields’ => ‘ids’ ) ); if ( !empty( $post_terms ) && !is_wp_error( $post_terms … Read more

[Solved] WordPress 2.8 Widget API is suitable for Worpress 3.1.4 plugins development?

WordPress APIs usually refer to group of functions and concepts and are not versioned. Any versions refer to WP itself (or in some cases to bundled components, developed by third parties such as jQuery). In WordPress version 2.8 creating widgets was refactored from older code (which you shouldn’t care about) to newer class-based code (which … Read more