• tembikai

    (@tembikai)


    I’m intergrating WP into a portal which links to news site. The problem is that most links belongs in multiple categories. The solution i want is to display the name of categories that the single link belongs in near the title of the link. Anyway to do that?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Lorelle

    (@lorelle)

    This article is from the <?php the_category(' and ') ?> categories.

    Change the stuff however you want. The “and” puts an “and” between each category like “category1 and category2” but you can use a comma or space or anything you want. Check out https://codex.www.ads-software.com/Template_Tags/the_category for more details on how to do this. Does that help?

    nieuwenj

    (@nieuwenj)

    How about doing the same but for links, not for posts ! Is it possible ?

    Thread Starter tembikai

    (@tembikai)

    i’m looking for links in multiple categories, not post. so it didn’t help. i’ve search for plugins but found none. someone ought to know how to do this….

    TechGnome

    (@techgnome)

    It is possible, but it isn’t easy.

    First a new table would need to be created, Link2Cat… It would have the LinkID and the CatID and probably it’s own ID.

    Then the admin screen would need to be modified to show the Categories list as a set of check boxes, rather than a dropdown.

    Then it would need to be further modified so that:
    1) When viewing a link, the proper categories are selected and
    2) When saving and edited link, the selected categories are saved to the new Link2Cat table, and any that were cleared are removed.

    And theeeen, the function that lists the links would need to be modified so show the links with their categories.

    It may seem straightforward, but I’ve simplified it a bit for brevity.

    But that’s it in a nushell.

    Tg

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘A Single Link in Multiple Categories’ is closed to new replies.