• I’m implementing metafizzy’s isotope to my genesis framework running bones child theme (I need a specific portfolio subpage with content filtering option).

    What I need is a way to distinguish a specific class selector in order to let isotope do it’s filtering. My solution is to adding class selectors to tags, so that it’s possible to let isotope work in concordance with a specific tag class selector. In example

    <a href="http://myblog.com/tag/kittens" rel="tag">kittens</a>

    needs to output

    <a href="http://myblog.com/tag/kittens" rel="tag" class="tag-kittens">kittens</a>

    To do this I’ve implemented following php in wp-themes/bfg102/functions.php:

    <?php
    $posttags = get_the_tags();
    if ($posttags) {
    foreach($posttags as $tag) {
    echo '<a href="';echo bloginfo(url);
    echo '/?tag=' . $tag->slug . '" class="' . $tag->slug . '">' . $tag->name . '</a>';
    }
    }
    ?>

    In my understanding, this should output correctly, but it’s not the case – it ain’t working. I’m working locally, so here’s the screenshot of the implementation and the result:

    implementation

    result

    What I need to know, is how to implement the function which applies class selectors to tags? My php knowledge is about 2 out of 10, so it’s most likely, that I’ve mixed something up in my general understanding. I’m dying to know the correct solution though!

  • The topic ‘Adding class selectors to tags’ is closed to new replies.