• I have tabbed widget. Each tab does have an option to select category. Categories are custom posts actually, not the normal posts category.

    Those custom posts categories are actually sub categories of custom post I’ve set as default for all.

    So what i need is this. Below each of tabs for an example tab 1 where i select one category, let’s call it category “WordPress”, i need a link which points to that category, so wordpress. So its actually view more from this category link and that’s all.

    I’ve tried many things, term link, id, category link..anything i could find on the web or codex and no luck. The best i could do is to list all custom posts cats and not the one which is selected in tab 1 for an example. If i pass the ID number it works, but that’s not what i need.

    #LOOP

    <?php if($fix_name1) { ?>
    <div id="tab1" class="tabber-content">
    <?php global $post; $recent = new WP_Query(array(
     'post_type' => 'match',
     'posts_per_page' => $fix_num1,
     'tax_query' => array(
    
    array(
    'taxonomy' => 'fixs_cat'
    , 'field' => 'slug',
     'terms' => $fix_cat1 ))
      )); while($recent->have_posts()) : $recent->the_post();?>
    
    <?php endwhile; ?>
    </div>
    <?php } ?>

    Other things related are here http://codepad.org/d2j1zHCP
    So i am trying to get for an example a link to $fix_cat1 which is first tab category.

    This shows all categories and i need the one which is selected in tab 1 for an example and then i can repeat the same for other tabs

    <?php
    $taxonomy = 'fixs_cat';
      $terms = get_terms( $taxonomy, $fix_cat1, '' );
      if ($terms) {
        foreach($terms as $term) {
       echo '<p>' . '<a href="' 
    
       . esc_attr(get_term_link($term)) .
    
        '" title="' 
    
        . sprintf( __( "View all posts in %s" ), $term->name ) . 
    
        '" ' . '>' . $term->name.'</a> has ' . $term->count . ' post(s). </p> ';
        }
      }
    
     ?>
  • The topic ‘How to get custom post category view more link?’ is closed to new replies.