• Resolved sailormarcus

    (@sailormarcus)


    I have a problem with my blog. I’d like the category name to appear on the same line as the excerpt, i.e

    Politics. Today, Gordon Brown …

    but I’ve noticed that wordpress will automatically put the_excerpt() in a paragraph (<p> </p>), so I end up with this

    Politics.

    Today, Gordon Brown …

    That code is nowhere in the main index template, and I can’t find it anywhere in the style.css either (that said, maybe it is there?).

    Any help would be much appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sailormarcus

    (@sailormarcus)

    Actually, I found a plug-in to deal with the “autop”. (I swear, I was looking around for a long time before I posted, but it’s always like that – I’m never able to find the solution by myself until after I’ve posted here)

    But I still have a problem – it seems the_category() doesn’t do quite what I want it to – I want it to JUST display the category name, not contain a link to it. I figured I could use the single_cat_title command but apparently it doesn’t work in the loop. Then I figured I could use category_description – but that doesn’t work inside the loop either.

    So that leaves me with get_the_category, right? But I’m not entirely sure it can do what I want it to and I don’t quite get what kind of code I should use when I want something to be displayed. Any help would be much much appreciated!

    Did you read the “get_the_category”-page you linked? The first example there is exactly what you need. *lol*

    flamesfans

    (@flamesfans)

    In case the above responses didn’t help, I found the answer to a similar question here:

    https://www.ads-software.com/support/topic/155806

    By default, the function the_excerpt is wrapped with <p> tags. You can comment that out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘the_category() and the_excerpt() on the same line – is it possible?’ is closed to new replies.