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?
- Add CSS Class to Link in TinyMCE editor
- How to print translation supported text with HTML URL
- Get the prev / next page links only (not title, etc)
- How to re-enable the links manager?
- Wondering how to turn your firefox bookmarks into a WordPress blog?
- How can I link to the most recent post in a category?
- Links redirecting to localhost after migration to server
- Is it possible to link to draft pages?
- How can I find all internal links that are pointing to post/page?
- Creating a Link Directory using WordPress?
- Count and show Clicks on external links in a single page/post
- 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
- root-relative links for multiple parked domains
- Get link value only from the_content()?
- How to splice in wp_links links into the loop?
- widget to output a link to archive view
- Is there an easy way to create a links index page?
- Can’t add a class to links in the visual editor since WP 3.1?
- wp_list_categories link to first post of category instead of calling taxonomy template
- What is the canonical way to link to pages?
- how can i add a menu link that goes to an external page
- Remove all links to a specific website
- HTTPS page link in menu
- How do I remove or disable “Or link to existing content” in “insert link” dialogue?
- Retrieving all Links from a Post?
- Link Category Description
- Auto-embed link info from URLs in link post format?
- programatically change href to onclick=window.open
- Disable automatic content hyperlinking
- Open link in a new tab checked by default when adding a new link in visual post editor
- Deep linking to an accordion tab with Visual Composer
- Setting a page link in the footer?
- How to add/change a value of $wpdb property/var?
- Need advice on how to add links in users profile page?
- Generate Random Post Links Somewhere in the post
- How to hide a customization link themes menu in wordpress?
- Any way to assign Post Categories and Tags to Links?
- Getting only the most recent bookmark?
- WordPress links/bookmarks – need to urlencode because spaces are getting stripped
- Custom Post Type archive link in WYSIWYG editor
- Add Link Text Back to Insert/edit link Box
- How to list all external URLs that I have posted on my WordPress blog?
- How do I make my navigation bar link to an external page?
- Plugin that inserts favicon next to links
- Create anchor from Wysiwyg editor
- Is there any way of changing the post order via user click?
- Get post / page ID from ACF Link field
- Creating a navigation link to my front-page
- How to remove author name and link from a shared link preview?
- Is it possible to select and edit the way the most recent post from a certain category is displayed on the page?
- wp_get_attachment_link to add title attribute to link tag around image
- Can I generate then display a mixed list of linked and unlinked terms
- Relative links for performance?
- Make page tab link to pdf
- Dont’t change active Button while I’m listing a category?
- How to change server name on WordPress Installation?
- How to prevent a page from being linked in the menu/crossbar
- How do i set the read more link?
- Plugin for wikipedia style references in WP?
- Problem creating an edit link for a custom post type
- How to enable category hierarchy for links?
- How to convert all links to no follow links of particlular section of a webpage
- Direct link to “New post” in specific category?
- Linking from Menu and a Page to the latest post from a specific category
- Linking to the most recent post in a Custom Post Type
- After duplicating site to a sub folder, links send user to original site
- Automaticly replace a link with other “new link”
- Links are not working on All Plugins Page
- Combining post categories and link categories?
- How to add a WordPress page with multiple picture links?
- Enumerating over a category of links
- Displaying a full post instead of a slug per category?
- Is there a way to hide WordPress behind a web visible directory?
- Twitter links in widget don’t work?
- Links in nonalphabetic order
- Link Attachment Image to Category
- Suddenly unable to share WordPress link on Facebook
- How to get category slug link? ( include parent categories)
- tinymce “Link” popup throwing error, not working
- 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]
- Short website link for all post
- How to have all RSS feed entries linking to the same specific page
- gallery link not displaying photos
- how to create a link to open app? [closed]
- How to remove category and other tags from posts page
- Allow Linking to draft posts from classic editor
- My links on the site are suddenly not underlined anymore
- Text decoration no longer applied to In post links
- I am looking for a function to create category links in the wordpress loop for articles
- My home page article links are directing users back to the home page instead of linking to individual articles
- Disable Category Link
- How could I add conditional link colour to my wordpress site that depends on the purpose of the hyperlink?
- passing vars to pages in wordpress 6 and search them
- Detect post title(s) in content and automaticly linking
- WordPress links only showing as text on main blog page