get_category_link is what you are looking for. And you could just use:
<?php echo get_category_link(6); ?>
and that will output the url to the category page.
<a href="https://wordpress.stackexchange.com/questions/45845/<?php echo get_category_link(6); ?>"><?php the_title(); ?></a>
Related Posts:
- How to handle broken links created by permalink/slug changes?
- How to Check if a Page Exists by URL?
- Keep getting same permalink with WP_Query?
- Link for the page archive for posts, like using custom post types with get_post_type_archive_link
- Changing my permalink structure – will new layout conflict with existing page?
- Removing rel=”nofollow” from links posted in Post Content
- How should I add links to other pages/posts from my post?
- Switch to page template when using post permalink
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- Custom Permalink Structure for Pages & Posts
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- Post/page title to permalink transformation – what is behind the scenes?
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Link from Post to Another Post Via Clicking on Words within Original Post
- Link to older links
- Changing permalink of WordPress
- Edit post & page option does not display on latest wordpress
- Please help a newbie with blog page issue?
- Custom permalink for wordpress page / post
- Category URL to use same string as Post URL Permalink
- Post Category link is same with Page link
- Permalink base only for posts
- How to give priority to page than to posts permalink structure?
- Precedence of page permalinks over woocommerce product category links?
- Posts in Page – How to customize the URL?
- My posts section for logged in user
- One of my posts is displayed as page
- How to mix pages and sub-categories in a url
- Modifying the permalink href for posts with jquery
- Read more link not working [closed]
- After the local installation of an old WP website I can see the homepage but I can’t access to the articles, why?
- Blog posts are not appearing as subs of Blog Page
- Automatically search and replace link in content (pages/posts)?
- Get the Current Page Number
- Stop WP from creating “Sample Page” and “Hello World!” post
- How to display by default only published posts/pages in the admin area?
- Disable Attachment Pages Completely
- Post slugs and images cannot have same name?
- Pretty URL with add_query_var
- Display posts by tag on page
- how to get permalink using sql
- Can I change a post to a page by changing it’s type?
- how to grab first link in post… and of course call it
- Add a custom option to a page in backend
- Creating new page with pre-defined parent page
- Linking to page with all posts
- Populating a page with content from post custom fields
- What Defines What Category A Post Picks (if in multiple)
- Custom post type permalinks breaking due to 3.1 bug fix
- disable column on post and user list
- Can a page_id and a post_id be same?
- How can I display widget in a Page or Post?
- Differentiate between posts and pages in search results
- Getting a 404 error when clicking edit page
- Problem with permalink routing?
- Get Page ID of blog homepage
- Retrieve post ID from “querying” URL
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- How do I do a page break?
- static landing page leading to author specific pages w/ “live” content
- WordPress 302 Redirect to Random Product/Post/Page
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- Link to date_query results in WordPress
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- Adding if statement into the_content()
- Archieve page, Advertisement Every 3 Posts
- Separate blog and reviews categories
- Creating a redirect option for current page url
- Change permalinks for posts & for custom post types
- I want to add another search box on posts page in dashboard
- Why the internal link get converted into a comment?
- WordPress: Develop multiple posts with different data
- How to set the post permalink using the WordPress REST API?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- unable to display two post per page in wordpress front-page.php
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Blocked posts in network tab
- How do I customize the post page
- Clicking on a Post takes 10+ seconds for the server to respond, Pages will respond immediately
- Page with Category Returning 1
- Using WP page password protection as defacto login
- How to add post under particular pages? Like website.com/page1/post1
- Permalink structure for two seperate blogs
- My post permalinks are always the same
- Fixing the WP Post Object for Custom Route
- All my posts don’t show, only the headline is displayed on the homepage
- How to change post template via url?
- Page not loading content – Body archive – page
- Featured Images link to post parent
- Using Post ID and Page ID in same function
- External link not showing on post but showing on comment
- How to display a paginated list of posts from one category on a page? [duplicate]
- TCPDF and permalinks
- WordPress sub-posts and permalinks
- Redirecting posts in WordPress to a specific page
- Wrap div-tag around posts in page
- Adding a post to a page
- When and how will php code in a user made WordPress page be executed?
- Post data returning null [closed]
- Edit Page button is gone