You should be using get_term_link
instead, also for consistencys sake and to future proof, use get_terms
instead of get_categories
. Both work on categories/tags and all custom taxonomies.
Also check for the return of a WP_Error object ( returned when an invalid or nonexistent term is passed )
Related Posts:
- Get parent page url to show up when it is in child pages
- Why is there a link tag with rel “profile” pointing to gmpg.org?
- How to use wpLink without editor?
- How to print translation supported text with HTML URL
- Is it possible to link to draft pages?
- How to use wp_rel_nofollow to add nofollow to external links only?
- Is there any way to set default for “Insert/Edit Link” to “Open link in new window”?
- Category links suddenly started giving 404 errors
- How to splice in wp_links links into the loop?
- Is there an easy way to create a links index page?
- How do I remove or disable “Or link to existing content” in “insert link” dialogue?
- Retrieving all Links from a Post?
- Generate Random Post Links Somewhere in the post
- Plugin that inserts favicon next to links
- Get post / page ID from ACF Link field
- Make page tab link to pdf
- How to change server name on WordPress Installation?
- Plugin for wikipedia style references in WP?
- Problem creating an edit link for a custom post type
- Direct link to “New post” in specific category?
- Automaticly replace a link with other “new link”
- How to add a WordPress page with multiple picture links?
- Enumerating over a category of links
- Is there a way to hide WordPress behind a web visible directory?
- Links in nonalphabetic order
- Class active for Archive link – looped out
- How to automatically nofollow a set domains? (I seem to have half of the answer)
- My custom link works only on home page
- Get category url in loop
- Read more link to external webpage
- How to apply default post categories to link manager plugin
- How to change all external links to “nofollow” but only for Contributor role?
- How do I hide the ‘Edit’ link in publshed posts
- Do you use links?
- how do I get rid of the links and all the links related menu items on the admin ui?
- Get paged category link programmatically
- How to deal with internal links in blog while developing new site in WordPress?
- How do I list custom taxonomy terms with the links?
- Remove nofollow from specific internal links
- How to remove massive link in WordPress content
- Delete all href attribute in WordPress posts
- Allow insecure embedded content in a SSL secured website
- How to prevent WordPress from abbreviating long slugs?
- Put password on a wordpress link in a article
- javascripts files not linking to my category slugs?
- Disable title link in the backend for non-admins
- Add class to all links created by tinyMCE
- How do i remove all Bit.ly shortened links from site?
- echo site_url() returns a different value than what is in the database siteurl field
- how do I turn off whatever causes links to be embedded as URL’s site title
- How to make entire in blog post page linked?
- How to make a random dynamic url?
- WordPress does not show correct page
- Bulk change link to pdf’s
- How can I automatically display the section link on my one-page Elementor website?
- White image when I share my site
- How to enable HTML tags in category description without breaking the category page
- How to track which users click link/button?
- How can I get the url from file uploaded in Media Library
- Getting duplicate homepage links | Even if there is only one page in Dashboard Please Help
- Link to index.php from home.php?
- Rotate prefix for external domain links using functions.php?
- How to change the canonical link from a category or taxonomy archive?
- How to mask external download links to be only accessible by logged-in users?
- Content -> Post is easy, but Post -> Content is hard
- Metallex Theme modifies links after saving them
- Get youtube link title in post title
- bloginfo(); outputs wrong urls without https on inner pages
- How can I add a sortable link_updated column to the Link Manager?
- how to display country/region/subject/post reasonably
- Show Subcategory Name Instead of Parent Category
- Post Category link is same with Page link
- Links open when scrolling on touch devices/mobile
- Site migration and how to write internal links with migration in mind
- List pages including both parent and child pages
- How can I generate a list of post-type specific categories?
- Remove all link title attributes
- How do I change the “href” link that corresponds with an “li class” statement?
- Unable to create hyperlink after WordPress updated
- Anchor doesn’t work if it’s given in the url
- Links offset on my page
- Link rewrite to https (NOT URL rewrite)
- random characters on links
- Detect what page was linked-from
- link header to homepage (for wp multisite)
- insert link in wordpress editor greyout whole screen?
- permalink and $_GET
- pictures does not apeare in posts
- remove the ‘page’ URL parameter in previous/next posts link
- Internal linking search box not working – WP 3.2
- Blogroll import/export with categories and descriptions
- Featured image for links and categories
- WordPress: How to make a subsubdirectory
- External Links Not Working [closed]
- Access the article edit page from the web address bar?
- Link to blogg-page
- Is it posibble to have alink to display all posts on index.php?
- Trying to chance my link style
- I’ve been trying for an hour to remove the underline from links; I don’t understand why something that should be so simple is so difficult [closed]
- How to remove category and other tags from posts page