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)?
- I want the Title of page/post to show up topmost when reading the post/page
- Permalink issue with new blog posts > getting 301 redirect
- Determine if page is the Posts Page
- Get the Current Page Number
- How do I check if I linked to a post before I delete it?
- How to use “Add link” pop up for a WordPress widget
- Stop WP from creating “Sample Page” and “Hello World!” post
- Where is the old post permalink slug stored?
- Keyboard shortcut for updating a page or post?
- Apply the_title() filter in post & page title, but not in menu title
- How do I add /blog/ on my permalink without affecting the portfolio project types permalink?
- Woocommerce – custom post type of checkout page
- Posts and pages not getting published
- Limit amount of pages shown in pagination within wp_query
- How do I add an article to specific page?
- Permalink remain the same on each page
- How to have more post in a page than in your home page
- how to show all type of author posts in author page (SOLVED)
- Custom post page has attributes of latest post [closed]
- How can we pass a value from the_permalink() at WordPress?
- custom post type single page template not working
- Automatically add class to link based on link text
- WordPress “Posts Page” isn’t showing template dropdown
- Wrap div-tag around posts in page
- Adding Count Post in Page
- How to make posts appear under pages
- Insert Shortcode exactly at the end of the content
- Adding a post to a page
- When and how will php code in a user made WordPress page be executed?
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- How to find the page of specific post?
- WordPress Page Column Problem [closed]
- The page that displays Posts on homepage
- How to have 2 posting pages on a blog
- Post data returning null [closed]
- Default post type doesn’t display in url
- change page name on page list
- Cannot Create a new Post [closed]
- What function does the loop of displaying posts?
- How can I use wp_after_insert_post with $current_screen?
- Changes done in admin panel are taking time to reflect in the REST api responses
- How to change Permalinks only for Blogposts
- wordpress category Description not allowed tag
- How to automatically convert a form with HTML link into post
- Permalink structure for two separate blogs
- Header and Footer options in pages and posts
- How can I fixe the article title problem?
- How to add paraent in Blog post URL in wordpress
- Change permalinks in posts via SQL
- Why can posts never have a number as the link?
- How to remove category and other tags from posts page
- How to remove slug from CPT correctly?
- Edit Page button is gone
- Modify Post URL Programmatically
- Blog Posts Work in Preview, But Are Not Visible on the Live Page – READ MORE u003cspan aria-hidden=’true’u003e→u003c/spanu003e Error
- Custom permalink for ‘post’ not working
- How to display breadcrumb on category?
- When inserting media file in a post or page, show file name under the thumbnail
- Hide page title on dedicated posts page
- Post type gives 404 unless logged in
- It tells me that I exceeded the maximum number of executions when trying to publish content
- Parameter for pagination posts_pagination
- WordPress Version 6.6 facing “This block has encountered an error and cannot be previewed.” which edit text on page with link
- Change the slug of post type using custom code
- Page linking issue
- Issue Copying Posts and Pages from One WordPress Site to Another
- How do I link my post title/excerpt/read more to the source site?