editing fonts of category links from the_category() funtion

I have multiple pages using content-featured.php I’m having trouble pasting the code.. that file uses the_category function

The_category function displays names/links of categories. I’m having extreme difficulty editing the type of font for these category links. I was told to open the source for the page that uses this, look at the body class for the template-specific class it uses which is page-Id-2. And use that with custom css like .page-I'd-2 .entry-title { font-family: somefont; }.

However that didn’t work.

Is there any more info needed here to help me with this issue? Again I need to edit the fonts for category links displayed by the the_category() function.

Solutions Collecting From Web of "editing fonts of category links from the_category() funtion"

If you are using the_category() (so without passing parameters), the result will be something like:

<ul class='post-categories'>
<li><a href="../cat1">Category 1</a><li>
<li><a href="../cat2">Category 2</a><li>

So a css line like .post-categories li a {font-family:Myfont;} should do it.

Reference: the_category() calls get_the_category_list, which does the actual output. This function ends with a filter, which you could use to assign further classes, even to individual links.