Question:
Answer:
I have id of WP category on external resource. I know that if I have id of post I can create url like
http://example.com/?p={post_id}
But what if I know id of category? How can I generate link to it? Category permalinks look like
http://example.com/category/{category_slug}/
and I need to use something like
http://example.com/category/?cat_id={category_id}/
Answer:
If you have category ID you can create link to category like below :
<a href="/index.php?cat=7">Category Title</a>
For more details read from this link :
Thanks!

Không có nhận xét nào:
Đăng nhận xét