With some assistance from @JacobPeattie I modified the code to the recommended get_tags() function. Now in the functions.php I have the following code.
// Get al the tags with published post
function get_all_tags(){
$posttags = get_tags('');
if ($posttags) {
foreach($posttags as $tag) {
echo '<li><a href="#">'.$tag->name.'</a></li>';
}
}
}
In the single.php file, I call this with the following code.
<?php $tagsAll = get_all_tags(); echo $tagsAll; ?>
Related Posts:
- Query all posts and not repeat the same tag
- get posts by tag to showing in a widget
- Customizing the_tags output?
- WordPress SQL query to tag all posts containing a specific word on title
- How to create an overview of posts with the same tag?
- List WordPress Post and Related Attachments outside of a post page
- Sort query_terms_list for post_tags alphabetically
- Attachment page tag queries & posts not found
- Not getting input from get_query_var
- Exclude Posts from a Widget
- Show certain number of post from tags
- SQL Query : how copy all tags of post into their post content in wordpress by sql query
- How to Optimize WP site for millions of posts
- Get Terms by IDs with IDs order
- Is there any difference between hooks posts_where with posts_join and posts_search performance wise?
- How many WordPress SQL Queries per page?
- Slow wp_enqueue_media()
- Advanced Custom Fields – Query Efficiency
- How to display lastest post date in the homepage?
- Show recent products first but “sold out last” in query
- How to tell if $query_var isset?
- Sorting Grids with Essential Grid and Events Manger
- The use of including upgrade.php when building custom queries
- Get the timout value of a saved transient?
- Does meta_query work within get_posts array?
- Slow meta_query with about 4 milion record on wp_postmeta
- How to show more than 5 posts?
- WordPress Find Duplicate Post By Content
- How many queries are normal to execute on a WP site?
- WP Query Sort by meta value (date)
- mySQL query. ORDER BY meta_key
- how to query multiple categories in wordpress?
- Disable the MySQL query in the main query
- Strange string in console from wpdb query
- Update slug (URL) of pending posts via phpMyAdmin
- Insert static element only once in query archive
- How to run a mysql query when admin updates user role?
- How can I get the query that would be run for the archive page?
- Error when using setup_postdata()
- Query metas (and not : query posts by metas)
- Select query for a login
- What’s wrong with my $wpdb prepare?
- where should I reset query after using get_results?
- Exclude featured image and custom field from this get_attachment query
- I can ‘t display product images based on the label
- Query posts intersecting tags and categories
- wpdb print all post meta
- Form and custom query problem
- Export Specific User data without plugin
- Create Indexes for Slow Queries
- I want to create a filter for the query string is this possible?
- How to write: $wpdb->update having WHERE NOT value pair in the array
- Exclude all sticky posts front page twenty twelve
- Query returning same results even though the ID changes
- Why my query ‘REPLACE INTO…’ does not work?
- wpdb COALESCE won’t work
- get csv of users with user_meta
- Custom SQL Query passing array to WHERE p.id
- Restrict query to last day with posts
- Custom query object with Simple-Fields custom date field
- Query does not return content
- Query posts dynamic date range
- Parse query filter in wordpress and relation
- Mysql query not working on WordPress 4.2.2
- Querying with WP query using meta key price
- Re-sort get_posts query results
- get_post_meta with WP_query
- How properly create a blog template for wordpress?
- Is there a way to add a link directly into this media query?
- Problem on displaying the results on my query
- Pagination not working on custom post types with rewrite slug
- Improve performance of slow query
- how to add tags to post in the Loop?
- WordPress search in modified post title
- meta_query not working
- Cannot get sql request from Query object?
- Get posts that match defined arrays of tags
- WordPress query: merge meta key (number) values and sort
- Question about of query
- Order posts by tags count?
- Is there any way to get all custom posts and all custom terms with it’s meta in few queries?
- Modify behaviour of “s” parameter in wp_query
- How to make MySQL search queries with quotes
- Limiting a filtered query
- Random posts in WP_Query when searching by tag
- Show posts by tags excluding current post
- Archive query not working correctly
- Custom MySQL Query for Post and Post Meta
- Displaying popular posts
- Exclude sticky posts from query
- How to have more post in a page than in your home page
- Find all posts via SQL beginning with A of type B
- learn to run wpdb class
- Display old posts if no future posts exist
- Access Tables with number prefix
- how to add a read more button to my blog page?
- How to add multiple values with add_query_arg?
- Query parsing only author ids
- 3 queries to update WordPress
- How to show sticky posts on all pages of the pagination, not just the first page?