WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category Thumbnail Link (2 posts)

  1. exbionic
    Member
    Posted 6 years ago #

    Hi all,

    I am setting up a site for a company that produces television commercials. They want to be able to have their videos split by both genre and the director who worked on the piece. I thought the best way to go about this would be to use categories i.e. have 2 master categories - genres and directors to which child cats such as Drama, Animation or the directors names could be added.

    When the user clicks on the main nav button Genres, for example, I would like to have a 'grid view' of all the genre child categories each with an associated thumbnails that link to all the post within each of these child categories.

    I found this snippet in the codex:

    <ul>
    <?php wp_list_categories('orderby=id&show_count=1
    &use_desc_for_title=0&child_of=8'); ?>
    </ul>

    This outputs the child categories that I need but I was wondering if anyone knew how I could get a thumbnail to appear too?

    I recall using the 'the_author' tag once to display a jpg to show a profile photo next each post created by an author (the jpg file name had to the same as the authors' name) and thought something similar could be used here. I just have no idea how to go about it :-S

    Any help, as ever, would be greatly appreciated.

    Cheers.

  2. exbionic
    Member
    Posted 6 years ago #

    Should anyone be looking for a solution to this in the future I managed to solve this by installing this plug-in:

    http://tacoen.smedia.or.id/contents/coen_catcustlist.phps

    I also installed the PHP Exec plugin so that I could write the following into a WordPress page:

    <ul class="floatleft"><?php catcus_list('<li><a href=" %caturl%"><img src="../wp-content/images/%catname%.jpg" width="100px" height="100px"></a><br/>%catname%</li>','3','cat_name',0); ?></ul>

    It outputs an unordered list (styled by css to float left), of all the category names and a jpg file that MUST have the same as the category. This then links to the list of posts within each category.

Topic Closed

This topic has been closed to new replies.

About this Topic