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)?
- Trying to insert widget code into theme function
- Add a class to the anchor tag on HTML5 gallery
- Conditional Header in wordpress
- Remove meta description on certain pages
- Menu — How to add “current-menu-grand-ancestor” css class
- How to insert custom widget in custom sidebar in theme activation?
- Create onClick Event to Re-load a Widget
- Use menu link or onClick to set a variable
- Swapping wp_dropdown_categories function with wp_category_checklist
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Automatically remove a canceled order in Woocommerce
- Display fields as values in array from external SQL DB
- Only Show Link If div Exists
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- How to output widget
- Trying to establish connection to External Database
- add_action shortcut?
- Passing the custom field values in the wp_get_current_user array function
- Using fwrite() and “a” appends multiple times instead of once
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- How to style options page in dashboard?
- How to insert a single row to WP database table?
- Get date numerical and separate?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- WSoD being caused by this piece of code
- Converting HTML Template to WordPress Theme
- Extending the WP_Widget_Text class
- Set the background to a default image if there isn’t a specified “featured image”
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Add a variable in functions.php and call it in single.php
- How to access global variable $menu inside a class function
- Calling directories to load in wordpress
- WordPress add post format support not working
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Image media upload metabox
- How to remove the cufon script from Dzonia Lite theme [closed]
- How to remove or change the “W” icon in “My Sites”?
- get a simple array of all of the term names that exist in all taxonomies
- Login/logout in header
- How to display posts by current user in a drop down
- Logged in user ID as post ID
- How does WordPress insert Paragraphs in posts
- WordPress Access allowed to fewer pages till user logs in