How to use stack flair on my site?

I think it’s pretty self-explanatory, see the SE flair page. https://wordpress.stackexchange.com/users/flair Simply copy the provided HTML and paste it into the appropriate template file. I didn’t down vote, but i can understand why, this is really basic copy and paste HTML..

Which file displays the date archive?

archive.php is used to display author, search, category, tag and date archives. As clicking on a calendar day will take you to the date archive for that day, then the file you’re looking for is archive.php. More specifically, WordPress will check for these files in this order, stopping when it finds one of these files … Read more

How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?

Below is the code you need. Your issue could be that you’re not first setting up the variable $display_options to contain your options, or that you not asking if the option is set. add_action(‘widgets_init’, ‘arphabet_widgets_init’); function arphabet_widgets_init() { $options = get_option(‘muffin_options’); if(isset($display_options[‘header_layout’]) && $display_options[‘header_layout’] == ‘1’) { register_widget(‘arphabet_widget_1’); } if(isset($display_options[‘header_layout’]) && $display_options[‘header_layout’] == ‘1’) { … Read more

Customising widget titles/headings in WP 5.8

You’re right. I didn’t notice it before ! If you look at the code, you can see that Widgets are now showed from /wp-includes/widgets/class-wp-widget-block.php which extends /wp-includes/class-wp-widget.php The first file is a new one introduced in WP 5.8. In there you can see that the widget is now displayed through widget_block_content filter which use the … Read more

Display sidebar that created in functions.php

Here’s the way i would code it. Tested Add to functions file add_action( ‘widgets_init’, ‘wpsites_add_widget’ ); function wpsites_add_widget() { register_sidebar(array( ‘name’=>’Sidebar-Aries’, ‘id’ => ‘sidebar-aries’, ‘description’ =>’Display all the contents of sidebar at Aries page.’, ‘before_widget’ => ”, ‘after_widget’ => ”, ‘before_title’ => ”, ‘after_title’ => ”, )); } Or you could use this code in … Read more

register child class in another plugin

I question the wisdom of extending a class from another plugin. You have no idea what will happen next time that other plugin gets updated. However, generally speaking you can control when in a hook “queue” a function runs by passing a third parameter– a priority. So pass a priority high enough and your function … Read more

Best way to allow manageable social media URLS?

The best way is on the user profile page using the contact methods extension: add_filter( ‘user_contactmethods’, ‘more_contactmethods’ ); function more_contactmethods( $contactmethods ) { $contactmethods[‘twitter’] = ‘Twitter username’; $contactmethods[‘facebook’] = ‘Facebook URL’; return $contactmethods; } This adds fields to the user profile page for those social networks. You can have as many as you like, then … Read more

Remove Widgets in Dashboard

I think the best way to go about this is to create a new plugin (or put in the theme function.php but a plugin will always work independent of theme) that disables the widgets you don’t need. Something like this. function wpse_47707_disable_admin_meta() { remove_meta_box( ‘dashboard_browser_nag’, ‘dashboard’, ‘normal’ ); remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ ); remove_meta_box( ‘dashboard_recent_comments’, … Read more