Woocommerce: custom loop in product tabs breaks reviews tab

I found the solution which is probably quite basic for experienced WP developers. I’m gonna post it here instead of deleting the question though, I hope this might help someone someday… The issue was that the post data wasn’t reset, so all I needed is to add a function call wp_reset_postdata(); after my while loop. … Read more

Disable the “Skip to Toolbar” tabbing accessibility feature

It’s not possible without JavaScript. The HTML for it is output in the WP_Admin_Bar in a private and protected method with no filter. You can remove them after the page has loaded with JS like so: function wpse_287259_remove_skip_link() { echo “<script>jQuery( ‘.screen-reader-shortcut’ ).remove();</script>”; } add_action( ‘wp_after_admin_bar_render’, ‘wpse_287259_remove_skip_link’ ); I hope it goes without saying that … Read more

Display meta box on front end

Use this code $schema_group = rwmb_meta( ‘schema_group’ ); $schema_knvb = isset( $schema_group[‘schema_knvb’] ) ? $schema_group[‘schema_knvb’] : ”; echo $schema_knvb; for more detail check the “Meta Box Group” page on the plugin documentation https://metabox.io/docs/meta-box-group/#section-how-to-get-meta-value-of-a-sub-field

Shortcode insertion in tab

Sounds like you need to wrap your shortcode contents in ob_start()and return ob_get_clean() require_once(dirname(__FILE__).’/post-type.php’); //file that registers CPT function wporg_shortcodes_init(){ function wporg_shortcode($atts = []) { extract( shortcode_atts( array( ‘term’ => ‘columns’ ), $atts ) ); $custom_taxonomy = $atts[‘term’]; ob_start(); // <- works like magic // add query of custom post type board_members $recentPosts = new … Read more

Move WooCommerce product tabs out of the tabs [closed]

It turned out that woocommerce_get_template() was deprecated and replaced by wc_get_template(). I solved this by adding this to my functions.php. add_action( ‘woocommerce_after_single_product_summary’, ‘removing_product_tabs’, 2 ); function removing_product_tabs(){ remove_action(‘woocommerce_after_single_product_summary’,’woocommerce_output_product_data_tabs’, 10 ); add_action(‘woocommerce_after_single_product_summary’,’get_product_tab_templates_displayed’, 10 ); } function get_product_tab_templates_displayed() { wc_get_template( ‘single-product/tabs/description.php’ ); wc_get_template( ‘single-product/tabs/additional-information.php’ ); comments_template(); }

Disable Jquery UI post tabs

****See edit history for previous comments*** I decided i’m going to write a plugin to do this, the plugin discussed i’m sure was written with the best intentions, but the code in my personal opinion needs a total rewrite, which is essentially what i’ll be doing. The aim will basically be to emulate the functionality … Read more

Preserving tabs and line breaks in when switching from HTML to Visual Editor

Add to function.php add_filter(‘tiny_mce_before_init’, ‘tiny_mce_before_init’); And function tiny_mce_before_init: function tiny_mce_before_init($init) { $init[‘setup’] = “function(ed) { ed.onBeforeSetContent.add(function(ed, o) { if ( o.content.indexOf(‘<pre’) != -1) { o.content = o.content.replace(/<pre[^>]*>[\\s\\S]+?<\\/pre>/g, function(a) { return a.replace(/(\\r\\n|\\n)/g, ‘<br />’); }); } }); }”; return $init; } http://core.trac.wordpress.org/ticket/19666 – it’s known bug, there is workaround but not fix tabs only new line … Read more

Output ‘do_settings_sections()’ as tabs, not one under the other

So because I couldn’t find an out of the box way, I created this. Don’t forget to enqueue the jquery-ui-tabs script – /** Replace the call to ‘do_settings_sections()’ with a call to this function */ function do_settings_sections_tabs($page){ global $wp_settings_sections, $wp_settings_fields; if(!isset($wp_settings_sections[$page])) : return; endif; echo ‘<div id=”abb-tabs”>’; echo ‘<ul>’; foreach((array)$wp_settings_sections[$page] as $section) : if(!isset($section[‘title’])) continue; … Read more