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
- Is it possible to disable a function of a parent theme?
- Hide old attachments from wp media library
- PHP – redirect https to http and www to non-www
- Create Image Uploader for Widget
- Displaying a variable stored in functions.php inside widget
- List authors with posts in a category
- Removing unneccessary p-tags (Not every p)
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- How to add seperate classes to no-search-result and found-search-result pages on wordrpess search – is_search()
- Firing schema via code in functions.php doesn’t work
- A non-numeric value encountered in /wp-includes/functions.php on line 68
- Blog posts repeat
- Ajax load more button for comments wordpress
- Update user profile information from functions.php
- How can I modify footer when footer.php calls to another file?
- If tag equals then show else show
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How to set the WordPress logo programmatically with PHP
- Function won’t run onclick using Ajax
- Add login hyperlink to secondary navigation menu
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- List all blogs, but exclude the main site
- change the default order of posts only for specific categories
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Splitting the_content() by size?
- random reason on refresh
- WP-Bakery – Add custom colors to buttons with template colors
- Create shortcode for metabox gallery
- Show all people who commented on all posts by an author
- How can I redefine WordPress wp-content directory programmatically?
- Trim Titles Only On Some Pages
- Custom global variable not working in function
- get_the_author_meta( ‘ID’ ) just return 1
- Enqueue sripts and styles only if function is called
- Add widget area from visual editor
- Site title not showing. Please help me
- Need to Echo A Url path to show on a wordpress page
- add a value to an external link query in searchform
- How to get category pages to look like a certain archive page?
- How to call a specific value within the functions.php file?
- How to define template directory in this widget code
- Warning: filemtime(): stat failed for wp_
- Keep users logged in Without Remember Me
- How to use js variable to php in wordpress functions.php
- Automatically change insurance quantity based on cart total [closed]
- hiddenQuestions.find is not a function