display most popular tags in two columns

In my opinion you are doing it so complicated. I would rather do a classic query and then through css it made into 2-column. function top_tags() { $tags = get_the_tags(); if($tags) { $output=”<h4>Top tags</h4> <ul class=”top_tags”>”; foreach($tags as $tag) $output .= ‘<li><a href=”‘.get_tag_link($tag->term_id).'” title=”‘.$tag->name.'”>’.$tag->name.'</a></li>’; $output .= ‘</ul>’; echo $output; } } and your css .top_tags … Read more

How can I retrieve data within my widget

Read: SELECT_a_Column $sql = “SELECT ‘liters’ FROM ” . $wpdb->prefix . “tfp”; $liters = $wpdb->get_col( $sql ); if( $liters ) { foreach( $liters as $liter ) { echo ‘<option value=”‘ . $liter . ‘”>’ . $liter . ‘</option>’; } }

Why do none of my widgets have a title?

WordPress 5.8 added the ability to add Blocks to sidebars. Blocks do not use the title and markup defined for a sidebar. They just use the normal HTML they would use in the editor. “Legacy” widgets can still be added, and should still have the option to enter a title and use the markup defined … Read more

Need help adding additional controls to a custom widget

Here’s a complete example of the projects widget based on your code. This widget will allow users to specify the number of project posts to display and will also allow a word limit to be enforced for the content. Note that I went with using a word limit for the content instead of a character … Read more

Changing widget options via the functions.php when there are no hooks

After some digging, I’ve arrived at a solution (explained in the comments) – function change_widget_configuration() { $options = get_option(‘widget_some-widget’); // retrieve the options for all occurrences of the named widget* $widget_number = 3; // the id number of the specific occurrence of the widget whose options you wish to alter (this can be obtained simply … Read more