• Resolved Bolman Deal

    (@bolman-deal)


    Hi David, and thank you for a valuable tool!

    Sorry if this has been asked before. I’ve been scouring various forums, both for Yada Wiki and Twenty Twelve (I’ve made a child theme from Twenty Twelve), but not found anything. In most cases, there are a ton of support questions, but they don’t quite relate to my question.

    I’m building a glossary. I’d like to add a line somewhere on my articles / wiki pages that states what category an article is in (sometimes multiple categories), and a link to the category page(s) for that category/ies.

    Any suggestions? Thanks very much!

    –BoDe

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dmccan

    (@dmccan)

    Hi BoDe,

    Please try this:

    1. Copy the file content.php from the parent theme to the child theme.

    2. Open the copied file in your text editor and find the line around 55 like this:

    </div><!-- .entry-content -->

    3. After that line insert this code:

    
    <div>
    <?php 
    if ( is_singular('yada_wiki') ) {
        $terms = get_the_terms($post->ID, 'wiki_cats');
        foreach ($terms as $term) {
            $term_link = get_term_link($term, 'wiki_cats');
            if (is_wp_error($term_link))
                continue;
            echo '<a href="' . $term_link . '">' . $term->name . '</a>, ';
        }
    }
    ?>			
    </div>
    

    There should be a line after that like

    <?php endif; ?>

    I hope this helps,

    David

    Thread Starter Bolman Deal

    (@bolman-deal)

    Thank you! This helps VERY much!

    Plugin Author dmccan

    (@dmccan)

    You are welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Categories on Wiki Page’ is closed to new replies.