How to design WooCommerce-like admin tabs for plugin settings page?

I’ve figured it out how to do it on my custom admin page. You can use default wordpress classes and get variable trickery like so: <?php if( isset( $_GET[ ‘tab’ ] ) ) { $active_tab = $_GET[ ‘tab’ ]; } // end if ?> <h2 class=”nav-tab-wrapper”> <a href=”https://wordpress.stackexchange.com/questions/350785/?page=sandbox_theme_options&tab=display_options” class=”nav-tab <?php echo $active_tab == ‘display_options’ ? … Read more

WordPress User Portal

Nevermind, turns out the Elementor Role Manager does pretty much this exactly by limiting out the more confusing or dangerous elements from being edited.

Some Admin disappeared

I’d look at your error.log file just after you access the admin page. I’d suspect that there is a plugin code that is failing on the admin page. The error log might point you to the culprit. Alternately, you could disable recently added/updated plugins by renaming that plugin’s folder (in wp-content/plugins folder), which will effectively … Read more

How to alter query so that image changes in order every time page is refreshed

Your code is functional, however, it has several major flaws: query_posts query_posts and wp_reset_query are used, I would recommend never using this function, it has major problems, and encourages bad habits. if you want to modify the posts pulled in by WordPress, use the pre_get_posts filter, don’t replace the main query with a second and … Read more

Include Facebook Javascript SDK In WordPress

I’m assuming you’re referring to the header.php file of your theme. In that case, it’s as easy as just enqueueing the script by appending this function to your theme’s functions.php file: function enqueue_facebook_javascript_sdk(): void { wp_enqueue_script( ‘facebook-javascript-sdk-initializer’, get_template_directory_uri() . ‘/path/to/your/initializer.js’ ); wp_enqueue_script( ‘facebook-javascript-sdk’, ‘https://connect.facebook.net/en_US/sdk.js’, array(), null ); return; } add_action( ‘wp_enqueue_scripts’, ‘enqueue_facebook_javascript_sdk’ ); The first … Read more

reformat entry-title with two different styles

ok found out – added this to my content-page.php maybe not nice, but works for now… <?php $pieces = explode(‘:’, the_title( ”, ”, false ), 2 ); if (2 == count($pieces)) : ?> <h1 class=”entry-title”><span><span style=”font-size: 24px;”><?php print $pieces[0]; ?>: </span><span><?php print $pieces[1]; ?></span></span></h1> <?php else : ?> <h1 class=”entry-title”><?php the_title(); ?></h1> <?php endif; ?>

Remove Span Class From Woocommerce Price

You can use “woocommerce_get_price_html” filter to remove class from span tag like: add_filter( ‘woocommerce_get_price_html’, ‘remove_class_price_html’, 10, 2 ); function remove_class_price_html( $price, $product ) { return str_replace( ‘woocommerce-Price-currencySymbol’, ”, $price ); } Or else you can use preg_replace to remove class from both span tags.