function wiziapp_getTagsLinks($post_id) { $navLinks = array(); $tags = get_the_tags($post_id); if ($tags) { foreach ($tags as $tag) { $navLinks[] = array("link" => array("text" => wiziapp_formatComponentText($tag->name), "image" => "", "link" => wiziapp_buildTagLink($tag->term_id))); } } else { return FALSE; } $nav = array("navigation" => array("links" => $navLinks), 'class' => 'tags_nav_css'); return wiziapp_specialComponent("navigation", $nav); }
/** * Will echo the li item for the tags of the current post * No categories - no output */ function wiziapp_get_tags_nav() { global $post; $tags = get_the_tags($post->ID); // $max_to_show = 2; $count = count($tags); $html = ''; if ($tags) { if ($count > 1) { $link = wiziapp_buildPostTagsLink($post->ID); $tag_names = $count . ' ' . __('Tags', 'wiziapp'); } else { $link = wiziapp_buildTagLink($tags[key($tags)]->term_id); $tag_names = wiziapp_makeShortString($tags[key($tags)]->name, 18); } $tag_names = '<span class="names">: ' . $tag_names . '</span>'; $html .= '<li><a id="wizapp_tags_footer_link" class="wiziapp_footer_links" href="' . $link . '">'; $html .= '<div class="title-bar"></div><span class="title">' . __('Tags', 'wiziapp') . '</span>'; /**$names = array(); foreach($tags as $tag){; $names[] = "{$tag->name}"; } $tag_names = implode(', ', $names); $tag_names = wiziapp_makeShortString($tag_names, 30); if ( strpos($tag_names, '...') === FALSE ){ if ( $count > $max_to_show ){ $tag_names .= '...'; } } */ $html .= $tag_names . '</a></li>'; } echo $html; }
/** * Attribute getter method * * @return the actionURL of the component */ function get_actionURL_attr() { $link = ''; $cat = $this->data[0]; if ($this->layout == 'L1') { $link = wiziapp_buildCategoryLink($cat->cat_ID); } elseif ($this->layout == 'L2') { $link = wiziapp_buildLinksByCategoryLink($cat->term_id); } elseif ($this->layout == 'L3') { $link = wiziapp_buildTagLink($cat->term_id); } return $link; }