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 li {display:block; float:left; width:50%; clear:right;}
Related Posts:
- Add a select-option to the default widgets
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Edit tag cloud widget number
- How to automatically apply woocommerce product title to all product images alt tags?
- How to get the registered sidebar’s name by its id?
- show limited tags in an article
- WordPress menu deletes when trying to add a hook
- dynamic sidebar not showing anything
- Get widget settings function?
- javaScript in section of WP API
- Highlight Current Tag in wp_tag_cloud
- Add before_content and after_content to register_sidebar
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- WordPress widget/sidebar dividers?
- Missing argument 3 for wp_register_sidebar_widget()
- How to create a linked tag list in my sidebar
- Missing sidebar parameter “fix” – before_content
- Way to querry data (tags) from a wordpress database?
- How to put a variable in a instance in the widget
- Dynamic Sidebars & Echo
- Child page menu in sidebar
- Adding a widget function into the php theme file
- How to determine if the sidebar is empty? Or not active?
- Edit the_category (); for a hierarchical display
- Need to put a script above tag in header.php – WP 5.7.1
- Widget back end radio button issue
- Sidebar not appearing in footer, but it appears everywhere else!
- Filtering a function’ output for a new continued function
- My website is not showing Footer section
- How to get post category list as select in front-end?
- Show different website layout if no sidebar added
- Stuck with sidebar registering
- Don’t display a sidebar widget when on a specific page
- remove specificly the last tag in all posts
- How a HTML form can trigger a PHP function?
- Retrieve the whole widget sidebar and pass it inside an html
- Loading Widgets Via Child Theme
- is_user_logged_in() not working in homepage
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- Using Tag Groups: Displaying groups and adjacent tags of current post
- Add disclaimer before certain posts and pages
- Notify admin (by email) if post added with specific tag
- How to list categories by page id in wordpress
- how to run a php code in widget?
- Cannot access variables within a widget
- WordPress – registering sidebar and adding a button directly after .textwidget
- List sibling pages widget, exclude current page
- Insert wordpress tags below posts via functions.php
- Using tag to output text in Genesis?
- My custom widget won’t stay in the widget area after I refresh the widget page
- WP Debug enabled Undefined index error in a widget
- Change background image based on tags
- how to loop through blog posts in php
- The search doesn’t work properly
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- Limit the number of inactive widgets
- Proper use of Output Buffer
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- Should I write a PHP function in home.php?
- Debugging an error: wp_enqueue_style was called incorrectly
- How to log out everywhere else, destroy all sessions “all other devices”?
- Get the sidebar ID in which the current widget was dropped
- Transform php code into a widget?
- class=”parent” for wp_list_pages?
- Allow authors to post only in categories they create in WordPress
- Changing the HTML Of the content
- if has theme mod
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Need to get specific data from array
- WooCommerce – Display variation custom field value [closed]
- Restrict WordPress File Type Uploads by User Type
- New Plugin Review
- Problems with function on function.php
- Woocommerce HTML email option unavailable
- Use template for posts with a particular category grandparent
- How to slow down server response
- Click loads template via ajax
- How to group 2 radio buttons in a widget?
- Sort registered users by post count? (inside admin dashboard)
- How to change a public function inside a class of a plugin?
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- Function set default image when image not present
- Adding country tags automatically
- WooCommerce – Reset quantity input field when variation changes
- Use menu link or onClick to set a variable
- Automatically remove a canceled order in Woocommerce
- Trying to establish connection to External Database
- WordPress add post format support not working
- How to remove the cufon script from Dzonia Lite theme [closed]
- Login/logout in header
- Custom random quote widget breaks when used in multiple sidebars
- How to put “Read more” link in Custom Excerpt inside p tag?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Get users that likes the post
- How to abort saving data in save_extra_profile_fields function WordPress?
- Create highly customized submenu (possibly using wp_list_pages)
- Get the date of the className or classID
- $wpdb->wp_users returning empty value for
- WordPress Custom field Colors