Exemple #1
0
function thesis_nav_menu()
{
    global $thesis_site, $wp_query;
    #wp
    $current['id'] = !is_archive() ? $wp_query->queried_object_id : false;
    #wp
    $home_text = trim(wptexturize(thesis_home_link_text()));
    #wp
    $home_nofollow = $thesis_site->nav['home']['nofollow'] ? ' rel="nofollow"' : '';
    if ($current['id'] && $wp_query->post->ancestors) {
        $current['ancestors'] = $wp_query->post->ancestors;
    }
    echo "<ul class=\"menu\">\n";
    thesis_hook_first_nav_item();
    if ($thesis_site->nav['home']['show'] || $_GET['template']) {
        #wp
        if (is_front_page()) {
            #wp
            $current_page = get_query_var('paged');
            #wp
            $is_current = $current_page <= 1 ? ' current' : '';
        } else {
            $is_current = is_home() && is_front_page() ? ' current' : '';
        }
        #wp
        echo "<li class=\"tab tab-home{$is_current}\"><a href=\"" . get_bloginfo('url') . "\"{$home_nofollow}>{$home_text}</a></li>\n";
        #wp
    }
    if ($thesis_site->nav['pages']) {
        foreach ($thesis_site->nav['pages'] as $id => $nav_page) {
            if ($nav_page['show']) {
                $nav_items[] = $id;
                $page_data[$id] = get_page($id);
                #wp
                $parents[$id] = $page_data[$id]->post_parent != 0 ? $page_data[$id]->post_parent : 0;
            }
        }
        if (is_array($nav_items)) {
            foreach ($nav_items as $id) {
                if (!$parents[$id]) {
                    $nav_array[] = thesis_nav_array($id, $nav_items, $current);
                }
            }
        }
        if (is_array($nav_array)) {
            thesis_output_nav($nav_array, $page_data);
        }
    }
    if ($thesis_site->nav['categories']) {
        wp_list_categories('title_li=&include=' . $thesis_site->nav['categories']);
    }
    #wp
    if ($thesis_site->nav['links']) {
        $nav_links = get_bookmarks('category=' . $thesis_site->nav['links']);
        #wp
        foreach ($nav_links as $nav_link) {
            if ($nav_link->link_description) {
                $title = ' title="' . $nav_link->link_description . '"';
            }
            if ($nav_link->link_rel) {
                $rel = ' rel="' . $nav_link->link_rel . '"';
            }
            if ($nav_link->link_target) {
                $target = ' target="' . $nav_link->link_target . '"';
            }
            echo '<li><a href="' . $nav_link->link_url . '"' . $title . $rel . $target . '>' . $nav_link->link_name . "</a></li>\n";
        }
    }
    if ($thesis_site->nav['feed']['show'] || $_GET['template']) {
        #wp
        $feed_title = get_bloginfo('name') . ' RSS Feed';
        #wp
        $feed_nofollow = $thesis_site->nav['feed']['nofollow'] ? ' rel="nofollow"' : '';
        echo "<li class=\"rss\"><a href=\"" . thesis_feed_url() . "\" title=\"{$feed_title}\"{$feed_nofollow}>" . trim(wptexturize(thesis_feed_link_text())) . "</a></li>\n";
        #wp
    }
    thesis_hook_last_nav_item();
    echo "</ul>\n";
}
Exemple #2
0
function thesis_widget_subscriptions($args)
{
    extract($args);
    $options = get_option('thesis_widget_subscriptions');
    if ($options['thesis-subscriptions-rss-text'] != '' || $options['thesis-subscriptions-email'] != '') {
        $list = "<ul>\n";
        if ($options['thesis-subscriptions-rss-text'] != '') {
            $list .= "\t<li class=\"sub_rss\"><a href=\"" . thesis_feed_url() . '">' . $options['thesis-subscriptions-rss-text'] . "</a></li>\n";
        }
        if ($options['thesis-subscriptions-email'] != '') {
            $list .= "\t<li class=\"sub_email\">" . $options['thesis-subscriptions-email'] . "</li>\n";
        }
        $list .= "</ul>\n";
    }
    echo "{$before_widget}\n";
    echo $before_title . $options['thesis-subscriptions-title'] . $after_title . "\n";
    if ($options['thesis-subscriptions-description']) {
        echo '<p>' . $options['thesis-subscriptions-description'] . "</p>\n";
    }
    echo "{$list}{$after_widget}\n";
}
Exemple #3
0
 function rss_xml()
 {
     $feed_title = get_bloginfo('name') . ' RSS Feed';
     $rss_xml['alternate'] = '<link rel="alternate" type="application/rss+xml" title="' . $feed_title . '" href="' . thesis_feed_url() . '" />';
     $rss_xml['pingback'] = '<link rel="pingback" href="' . get_bloginfo('pingback_url') . '" />';
     $this->rss_xml = $rss_xml;
 }
Exemple #4
0
function thesis_widget_subscriptions($args)
{
    extract($args);
    $options = get_option('thesis_widget_subscriptions');
    if ($options['thesis-subscriptions-rss-text'] != '' || $options['thesis-subscriptions-email'] != '') {
        $list = '<ul>' . "\n";
        if ($options['thesis-subscriptions-rss-text'] != '') {
            $list .= '	<li class="sub_rss"><a href="' . thesis_feed_url() . '">' . $options['thesis-subscriptions-rss-text'] . '</a></li>' . "\n";
        }
        if ($options['thesis-subscriptions-email'] != '') {
            $list .= '	<li class="sub_email">' . $options['thesis-subscriptions-email'] . '</li>' . "\n";
        }
        $list .= '</ul>' . "\n";
    }
    echo $before_widget . "\n";
    echo $before_title . $options['thesis-subscriptions-title'] . $after_title . "\n";
    if ($options['thesis-subscriptions-description']) {
        echo '<p>' . $options['thesis-subscriptions-description'] . '</p>' . "\n";
    }
    echo $list;
    echo $after_widget . "\n";
}
Exemple #5
0
 function links()
 {
     global $thesis_site, $thesis_favicon;
     if ($thesis_favicon->favicon) {
         $links['favicon'] = "<link rel=\"shortcut icon\" href=\"{$thesis_favicon->favicon}\" />";
     }
     // Canonical URL
     if ($thesis_site->head['links']['canonical']) {
         global $wp_query;
         #wp
         if ($wp_query->is_single || $wp_query->is_page) {
             #wp
             global $post;
             $url = $wp_query->is_page && get_option('show_on_front') == 'page' && get_option('page_on_front') == $post->ID ? trailingslashit(get_permalink()) : get_permalink();
             #wp
         } elseif ($wp_query->is_author) {
             #wp
             $author = get_userdata($wp_query->query_vars['author']);
             #wp
             $url = get_author_link(false, $author->ID, $author->user_nicename);
             #wp
         } elseif ($wp_query->is_category || $wp_query->is_tax || $wp_query->is_tag) {
             #wp
             $url = get_term_link($wp_query->queried_object, $wp_query->queried_object->taxonomy);
         } elseif ($wp_query->is_day) {
             #wp
             $url = get_day_link($wp_query->query_vars['year'], $wp_query->query_vars['monthnum'], $wp_query->query_vars['day']);
         } elseif ($wp_query->is_month) {
             #wp
             $url = get_month_link($wp_query->query_vars['year'], $wp_query->query_vars['monthnum']);
         } elseif ($wp_query->is_year) {
             #wp
             $url = get_year_link($wp_query->query_vars['year']);
         } elseif ($wp_query->is_home) {
             #wp
             $url = get_option('show_on_front') == 'page' ? trailingslashit(get_permalink(get_option('page_for_posts'))) : trailingslashit(get_option('home'));
         }
         #wp
         if ($url) {
             $links['canonical'] = '<link rel="canonical" href="' . $url . '" />';
         }
     }
     $feed_title = get_bloginfo('name') . ' RSS Feed';
     #wp
     $xmlrpc = get_bloginfo('pingback_url');
     $links['alternate'] = '<link rel="alternate" type="application/rss+xml" title="' . $feed_title . '" href="' . thesis_feed_url() . '" />';
     $links['pingback'] = "<link rel=\"pingback\" href=\"{$xmlrpc}\" />";
     $links['rsd'] = "<link rel=\"EditURI\" type=\"application/rsd+xml\" title=\"RSD\" href=\"{$xmlrpc}?rsd\" />";
     if ($thesis_site->publishing['wlw']) {
         $links['wlw'] = '<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="' . get_bloginfo('wpurl') . '/wp-includes/wlwmanifest.xml" />';
     }
     #wp
     $this->links = $links;
 }
Exemple #6
0
 function links()
 {
     global $thesis_site;
     // Canonical URL
     if (!function_exists('yoast_canonical_link') && $thesis_site->head['links']['canonical']) {
         if (is_single() || is_page()) {
             #wp
             global $post;
             $url = is_page() && get_option('show_on_front') == 'page' && get_option('page_on_front') == $post->ID ? trailingslashit(get_permalink()) : get_permalink();
             #wp
         } elseif (is_author()) {
             #wp
             $author = get_userdata(get_query_var('author'));
             #wp
             $url = get_author_link(false, $author->ID, $author->user_nicename);
             #wp
         } elseif (is_category()) {
             #wp
             $url = get_category_link(get_query_var('cat'));
         } elseif (is_tag()) {
             #wp
             $tag = get_term_by('slug', get_query_var('tag'), 'post_tag');
             #wp
             if (!empty($tag->term_id)) {
                 $url = get_tag_link($tag->term_id);
             }
             #wp
         } elseif (is_day()) {
             #wp
             $url = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day'));
         } elseif (is_month()) {
             #wp
             $url = get_month_link(get_query_var('year'), get_query_var('monthnum'));
         } elseif (is_year()) {
             #wp
             $url = get_year_link(get_query_var('year'));
         } elseif (is_home()) {
             #wp
             $url = get_option('show_on_front') == 'page' ? trailingslashit(get_permalink(get_option('page_for_posts'))) : trailingslashit(get_option('home'));
         }
         #wp
         $links['canonical'] = '<link rel="canonical" href="' . $url . '" />';
     }
     $feed_title = get_bloginfo('name') . ' RSS Feed';
     #wp
     $links['alternate'] = '<link rel="alternate" type="application/rss+xml" title="' . $feed_title . '" href="' . thesis_feed_url() . '" />';
     $links['pingback'] = '<link rel="pingback" href="' . get_bloginfo('pingback_url') . '" />';
     #wp
     $this->links = $links;
 }