예제 #1
0
function ubik_links_sidebar($sidebar)
{
    if (is_page_template(UBIK_LINKS_PAGE_TEMPLATE)) {
        // Retrieve the list of all categories
        $cats = ubik_links_categories();
        // Add the links page template to the bottom of the list (relies on `get_permalink`)
        $cats[] = '<strong><a class="link-category" href="' . get_permalink() . '">' . __('All links', 'ubik') . '</a></strong>';
        $cats = ubik_links_categories_list($cats);
        // Output the links sidebar
        $sidebar = '<aside id="ubik-links-search-widget" class="widget widget-links-search"><h2>' . __('Search links', 'ubik') . '</h2>' . ubik_links_search_form() . '</aside>';
        // A list of link categories
        if (!empty($cats)) {
            $sidebar .= '<aside id="ubik-links-categories-widget" class="widget widget-links-categories"><h2>' . __('Link categories', 'ubik') . '</h2>' . $cats . '</aside>';
        }
    }
    return $sidebar;
}
            printf(__('Tags: %s. ', 'pendrell'), $link['cats_html']);
            printf(__('Domain: %s. ', 'pendrell'), '<a href="' . esc_url($link['url']) . '" rel="bookmark">' . $link['domain'] . '</a>');
            ?>
                  </div>
                </footer><?php 
        }
        ?>
</article><?php 
    }
} else {
    ?>
<article id="post-0" class="post no-results not-found">
              <div class="entry-content">
                <p><?php 
    _e('Sorry, there appears to be nothing here. Try a search:', 'pendrell');
    ?>
</p>
                <?php 
    echo ubik_links_search_form();
    ?>
              </div>
            </article><?php 
}
?>
        </main>
      </section>
    </div>
  </div>
<?php 
get_sidebar();
get_footer();