Ovifdiu COmrasdd
Ovifdiu COmrasdd

Reputation: 55

CSS dosen't work with my PHP code (echo/no echo)

I am trying to convert an html theme to work with Wordpress and I got stuck on a rather simple code and I don't understand why.

Why does this code:

<div class="project-category text-faded">
    test
</div>

not work the same as this (CSS doesn't work)?

<div class="project-category text-faded">
     <?php the_category(); ?>
</div>

<a href="-----/category/test/" rel="category tag">Test</a> as output of <?php the_category(); ?>

Upvotes: 0

Views: 105

Answers (1)

Hanky Panky
Hanky Panky

Reputation: 46900

<a href="-----/category/test/" rel="category tag">Test</a>

That is the output of your PHP function according to your comment above. Your CSS works fine when you hard code the string Test but not when you get that output above. That only means one thing.

Your css styles are not for a tags under these classes project-category text-faded or a tag is style differently. So style your a tag appropriately for either of those and you're good.

Upvotes: 1

Related Questions