• Hello,

    I have a problem with category.php files :

    The code :

    <h2><?php the_category(' &bull; '); ?></h2>

    Does’nt show the real category but always the same.

    For example, when I go on url : wordpressurl/category/acea/bruxelles

    I don’t see Title h3 with “Bruxelles” but I see “Divers ? Europe”

    And I have the same problem for all categorys.

    I think the problem appear when I turn on the permalink with the custom structure /%postname%

    Thank you very much for any help.
    Laurent

Viewing 7 replies - 1 through 7 (of 7 total)
  • So simple !

    Try to replace
    <h2><?php the_category(' &bull; '); ?></h2>
    by
    <h2><?php single_cat_title(''); ?></h2>

    Thread Starter halau

    (@halau)

    Hello Riversatile,

    Thank you for this response but it’s working only for one category. Do you have the code for multiple categories?

    Exemple link :

    https://urlwebsite/category/acea/monde+expositions

    Thank you very mich,
    Laurent

    So, try this :
    <h2><?php the_category(',', '' ); ?></h2>

    This should work !

    Thread Starter halau

    (@halau)

    Hello,

    Thank for this new response.

    I tried it but it doesn’t work. There is effectivly 2 categories show but always the same… ??

    There is no code like ? :

    <h2><?php multiple_cat_title(”); ?></h2>

    Thank you

    … I’m not sure the issue is in the category.php file.

    What do you want to do ?

    – You want to ensure that the address coincides with the different categories ? (https://mywebsite/category/cat1/cat2/cat3/ browse the sub-categories) OR (https://mywebsite/category/cat1+cat2+cat3/ gather the categories in one page)

    OR

    – You want to display side by side the categories in which the article is, in the H2 tag ? (<h2>xxxxxxxx</h2>)

    Thread Starter halau

    (@halau)

    Hello,

    I want to :

    – (https://mywebsite/category/cat1+cat2+cat3/ gather the categories in one page)

    AND

    – You want to display side by side the categories in which the article is, in the H2 tag ? (<h2>xxxxxxxx</h2>)

    Thank you very much,
    Laurent

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘category.php does'nt show real category…’ is closed to new replies.