• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_day_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_day_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_day_link函数的具体用法?PHP get_day_link怎么用?PHP get_day_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_day_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: published_time_links

 function published_time_links()
 {
     $archive_year = get_the_time('Y');
     $archive_month = get_the_time('m');
     $archive_day = get_the_time('d');
     echo get_day_link($archive_year, $archive_month, $archive_day);
 }
开发者ID:luisomontano,项目名称:ProtoCulture,代码行数:7,代码来源:options-plugins.php


示例2: widget

 function widget($args, $instance)
 {
     global $post;
     /* PRINT THE WIDGET */
     extract($args, EXTR_SKIP);
     $title = !empty($instance['title']) ? $instance['title'] : '';
     if (!is_single()) {
         return;
     }
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title;
         echo $title;
         echo $after_title;
     }
     $name = get_the_author_meta('display_name', $post->post_author);
     echo '<div class="large-icons">';
     echo '<ul>';
     edit_post_link('<i class="icon-pencil"></i>' . __('Edit', 'myThemes'), '<li>', '</li>');
     echo '<li><a href="' . get_day_link(get_post_time('Y', false, $post->ID), get_post_time('m', false, $post->ID), get_post_time('d', false, $post->ID)) . '">';
     echo '<time datetime="' . get_post_time('Y-m-d', false, $post->ID) . '"><i class="icon-calendar"></i>' . get_post_time(get_option('date_format'), false, $post->ID) . '</time></a></li>';
     echo '<li><a href="' . get_author_posts_url($post->post_author) . '" title="' . __('Writed by ', 'myThemes') . ' ' . $name . '"><i class="icon-user-5"></i>' . $name . '</a></li>';
     if ($post->comment_status == 'open') {
         $nr = get_comments_number($post->ID);
         if ($nr == 1) {
             $comments = $nr . ' ' . __('Comment', 'myThemes');
         } else {
             $comments = $nr . ' ' . __('Comments', 'myThemes');
         }
         echo '<li><a href="' . get_comments_link($post->ID) . '"><i class="icon-comment"></i>' . $comments . '</a></li>';
     }
     echo '</ul>';
     echo '</div>';
     echo $after_widget;
 }
开发者ID:mathieu-aubin,项目名称:verbo-linuq,代码行数:35,代码来源:my_wdg_meta.php


示例3: zerif_posted_on_child

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function zerif_posted_on_child()
 {
     $time_string = '<time class="entry-date published" itemprop="datePublished" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     printf(__('<span class="posted-on">Originally appeared in <a href="%2$s">%3$s</a> on  %1$s</span>', 'zerif'), sprintf('<a href="%1$s" rel="bookmark">%2$s</a>', esc_url(get_day_link(get_the_date('Y'), get_the_date('m'), get_the_date('d'))), $time_string), esc_attr(get_field('original_source_url')), esc_attr(get_field('original_source_media_outlet')));
 }
开发者ID:sdathletics,项目名称:zmc,代码行数:12,代码来源:template-tags-child.php


示例4: simple_life_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function simple_life_posted_on()
 {
     $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     $posted_on = sprintf('%s', '<i class="fa fa-calendar" aria-hidden="true"></i> <a href="' . esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf('<i class="fa fa-user" aria-hidden="true"></i> %s', '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
     // WPCS: XSS OK.
 }
开发者ID:ernilambar,项目名称:simple-life,代码行数:15,代码来源:template-tags.php


示例5: test_page_type_date

 public function test_page_type_date()
 {
     $this->go_to(get_year_link('2015'));
     $this->assertTrue(is_year());
     $this->assertSame('date', Ad_Layers::instance()->get_current_page_type());
     $this->go_to(get_month_link('2015', '03'));
     $this->assertTrue(is_month());
     $this->assertSame('date', Ad_Layers::instance()->get_current_page_type());
     $this->go_to(get_day_link('2015', '03', '14'));
     $this->assertTrue(is_day());
     $this->assertSame('date', Ad_Layers::instance()->get_current_page_type());
 }
开发者ID:statnews,项目名称:ad-layers,代码行数:12,代码来源:test-page-types.php


示例6: tc_post_metas

        /**
         * The template part for displaying entry metas
         *
         * @package Customizr
         * @since Customizr 1.0
         */
        function tc_post_metas()
        {
            global $post;
            //when do we display the metas ?
            //1) we don't show metas on home page, 404, search page by default
            //2) +filter conditions
            $post_metas_bool = tc__f('__is_home') || is_404() || 'page' == $post->post_type ? false : true;
            $post_metas_bool = apply_filters('tc_show_post_metas', $post_metas_bool);
            if (!$post_metas_bool) {
                return;
            }
            ob_start();
            ?>

            <div class="entry-meta">
                <?php 
            if ('attachment' == $post->post_type) {
                $metadata = wp_get_attachment_metadata();
                printf('%1$s <span class="entry-date"><time class="entry-date updated" datetime="%2$s">%3$s</time></span> %4$s %5$s', '<span class="meta-prep meta-prep-entry-date">' . __('Published', 'customizr') . '</span>', apply_filters('tc_use_the_post_modified_date', false) ? esc_attr(get_the_date('c')) : esc_attr(get_the_modified_date('c')), esc_html(get_the_date()), isset($metadata['width']) && isset($metadata['height']) ? __('at dimensions', 'customizr') . '<a href="' . esc_url(wp_get_attachment_url()) . '" title="' . __('Link to full-size image', 'customizr') . '"> ' . $metadata['width'] . ' &times; ' . $metadata['height'] . '</a>' : '', __('in', 'customizr') . '<a href="' . esc_url(get_permalink($post->post_parent)) . '" title="' . __('Return to ', 'customizr') . esc_attr(strip_tags(get_the_title($post->post_parent))) . '" rel="gallery"> ' . get_the_title($post->post_parent) . '</a>.');
            } else {
                $categories_list = $this->tc_category_list();
                $tag_list = $this->tc_tag_list();
                $date = apply_filters('tc_date_meta', sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s">%4$s</time></a>', esc_url(get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d'))), esc_attr(get_the_time()), apply_filters('tc_use_the_post_modified_date', false) ? esc_attr(get_the_date('c')) : esc_attr(get_the_modified_date('c')), esc_html(get_the_date())));
                //end filter
                $author = apply_filters('tc_author_meta', sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'customizr'), get_the_author())), get_the_author()));
                //end filter
                // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
                $utility_text = '';
                if ($tag_list) {
                    $utility_text = __('This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
                } elseif ($categories_list) {
                    $utility_text = __('This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
                } else {
                    $utility_text = __('This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
                }
                $utility_text = apply_filters('tc_meta_utility_text', $utility_text);
                //echoes every metas components
                printf($utility_text, $categories_list, $tag_list, $date, $author);
            }
            //endif attachment
            ?>

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

            <?php 
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_post_metas', $html);
        }
开发者ID:andrewfandrew,项目名称:bronze-boar,代码行数:57,代码来源:class-content-post_metas.php


示例7: gardenia_entry_meta

function gardenia_entry_meta()
{
    $gardenia_categories_list = get_the_category_list(',', '');
    $gardenia_tag_list = get_the_tag_list('', ',');
    $gardenia_author = get_the_author();
    $gardenia_author_url = esc_url(get_author_posts_url(get_the_author_meta('ID')));
    $gardenia_comments = wp_count_comments(get_the_ID());
    $gardenia_date = sprintf('<time datetime="%1$s">%2$s</time>', sanitize_text_field(get_the_date('c')), esc_html(get_the_date()));
    ?>
	
		<div class="fancy_categories">
                <div class="glyphicon glyphicon-user color"><a href="<?php 
    echo $gardenia_author_url;
    ?>
" rel="tag"><?php 
    echo $gardenia_author;
    ?>
</a></div>
                <div class="glyphicon glyphicon-calendar color"><a href="<?php 
    echo esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j')));
    ?>
" rel="tag"><?php 
    echo $gardenia_date;
    ?>
</a></div>
               <?php 
    if (!empty($gardenia_tag_list)) {
        ?>
<div class="glyphicon glyphicon-tag color"><?php 
        echo $gardenia_tag_list;
        ?>
</div><?php 
    }
    ?>
               <?php 
    if (!empty($gardenia_categories_list)) {
        ?>
<div class="glyphicon glyphicon-folder-open color"><?php 
        echo $gardenia_categories_list;
        ?>
</div><?php 
    }
    ?>
                <div class="glyphicon glyphicon-comment color"><span class="comment"><?php 
    comments_number(__('No Comments', 'gardenia'), __('1 Comment', 'gardenia'), __('% Comments', 'gardenia'));
    ?>
</span></div>
		</div>
<?php 
}
开发者ID:jasmun,项目名称:Noco100,代码行数:50,代码来源:theme-default-setup.php


示例8: wpbppost_meta

    function wpbppost_meta()
    {
        ?>

<ul class="post-meta inline-list">
  <li>
    Posted:
    <a href="<?php 
        echo get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'));
        ?>
">
      <?php 
        printf('<time datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date()));
        ?>
    </a>
  </li>
  <li>
    <?php 
        the_tags('Tags: ', ', ', '');
        ?>
  </li>
  <li>
    <?php 
        $categories = get_the_category();
        $separator = ', ';
        $output = '';
        if (!empty($categories)) {
            foreach ($categories as $category) {
                $output .= '<a href="' . esc_url(get_category_link($category->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts in %s', 'textdomain'), $category->name)) . '">' . esc_html($category->name) . '</a>' . $separator;
            }
            echo 'Categories: ';
            echo trim($output, $separator);
        }
        ?>
  </li>
  <li>
    Author:
    <a href="<?php 
        echo esc_url(get_author_posts_url(get_the_author_meta('ID')));
        ?>
"><?php 
        echo get_the_author_meta('display_name');
        ?>
</a>
  </li>
</ul>

<?php 
    }
开发者ID:tgallimore,项目名称:wp-boilerplate,代码行数:49,代码来源:template-tags.php


示例9: get_rocket_post_dates_urls

/**
 * Get all dates archives urls associated to a specific post
 *
 * @since 1.0
 *
 * @param int $post_ID The post ID
 * @return array $urls List of dates URLs
 */
function get_rocket_post_dates_urls($post_ID)
{
    // Get the day and month of the post
    $date = explode('-', get_the_time('Y-m-d', $post_ID));
    $urls = array(get_year_link($date[0]) . 'index.html', get_year_link($date[0]) . $GLOBALS['wp_rewrite']->pagination_base, get_month_link($date[0], $date[1]) . 'index.html', get_month_link($date[0], $date[1]) . $GLOBALS['wp_rewrite']->pagination_base, get_day_link($date[0], $date[1], $date[2]));
    /**
     * Filter the list of dates URLs
     *
     * @since 1.1.0
     *
     * @param array $urls List of dates URLs
     */
    $urls = apply_filters('rocket_post_dates_urls', $urls);
    return $urls;
}
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:23,代码来源:posts.php


示例10: avocation_entry_meta

function avocation_entry_meta()
{
    $avocation_category_list = get_the_category_list(', ', ' <i class="fa fa-list-all"></i> ');
    $avocation_tag_list = get_the_tag_list('<i class="fa fa-tags"></i> ', ' , ');
    $avocation_date = sprintf('<time datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date()));
    $avocation_author = sprintf('<a href="%1$s" title="%2$s" >%3$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'avocation'), get_the_author())), get_the_author());
    if ($avocation_category_list) {
        $avocation_utility_text = '<div class="blog-meta"><ul><li><a href=' . esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))) . ' > <i class="fa fa-calendar"></i> %3$s </a></li> <li> <i class="fa fa-user"></i> %4$s </li> <li>  %2$s </li> <li> <i class="fa fa-list-alt"></i> %1$s </li> <li> <i class="fa fa-comment"></i> ' . avocation_comment_number_custom() . '</li></ul></div>';
    } elseif ($avocation_tag_list) {
        $avocation_utility_text = '<div class="blog-meta"><ul><li><a href=' . esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))) . ' > <i class="fa fa-calendar"></i> %3$s </a></li> <li> <i class="fa fa-user"></i> %4$s </li> </li> <li>  %2$s </li>  <li>  %1$s </li> <li> <i class="fa fa-comment"></i> ' . avocation_comment_number_custom() . '</li></ul></div>';
    } else {
        $avocation_utility_text = '<div class="blog-meta"><ul><li><a href=' . esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))) . ' > <i class="fa fa-calendar"></i> %3$s </a></li> <li> <i class="fa fa-user"></i> %4$s </li>  <li> <i class="fa fa-comment"></i> ' . avocation_comment_number_custom() . '</li></ul></div>';
    }
    printf($avocation_utility_text, $avocation_category_list, $avocation_tag_list, $avocation_date, $avocation_author);
}
开发者ID:stvnfrancisco,项目名称:art_portfolio_wordpress,代码行数:15,代码来源:theme-default-setup.php


示例11: widget

 function widget($args, $instance)
 {
     global $post;
     /* PRINT THE WIDGET */
     extract($args, EXTR_SKIP);
     $instance = wp_parse_args((array) $instance, array('title' => ''));
     $title = esc_attr($instance['title']);
     if (!is_single()) {
         return;
     }
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title;
         echo apply_filters('widget_title', $title, $instance, $this->id_base);
         echo $after_title;
     }
     $name = get_the_author_meta('display_name', $post->post_author);
     echo '<div class="large-icons">';
     echo '<ul>';
     edit_post_link('<i class="icon-pencil"></i>' . __('Edit', 'myThemes'), '<li>', '</li>');
     echo '<li><a href="' . get_day_link(get_post_time('Y', false, $post->ID), get_post_time('m', false, $post->ID), get_post_time('d', false, $post->ID)) . '">';
     echo '<time datetime="' . get_post_time('Y-m-d', false, $post->ID) . '"><i class="icon-calendar"></i>' . get_post_time(get_option('date_format'), false, $post->ID) . '</time></a></li>';
     echo '<li><a href="' . get_author_posts_url($post->post_author) . '" title="' . __('Writed by ', 'myThemes') . ' ' . $name . '"><i class="icon-user-5"></i>' . $name . '</a></li>';
     if ($post->comment_status == 'open') {
         $nr = get_comments_number($post->ID);
         if ($nr == 1) {
             $comments = $nr . ' ' . __('Comment', 'myThemes');
         } else {
             $comments = $nr . ' ' . __('Comments', 'myThemes');
         }
         echo '<li><a href="' . get_comments_link($post->ID) . '"><i class="icon-comment"></i>' . $comments . '</a></li>';
     }
     if (function_exists('stats_get_csv')) {
         $args = array('days' => -1, 'post_id' => $post->ID);
         $result = stats_get_csv('postviews', $args);
         $views = $result[0]['views'];
         $nr_views = number_format_i18n($views);
         $label_views = __('views', 'myThemes');
         if ($nr_views == 1) {
             $label_views = __('view', 'myThemes');
         }
         echo '<li><i class="icon-eye-2"></i> ' . $nr_views . ' ' . $label_views . '</li>';
     }
     echo '</ul>';
     echo '</div>';
     echo $after_widget;
 }
开发者ID:serpentinegalleries,项目名称:marathon-transformation,代码行数:47,代码来源:my_wdg_meta.php


示例12: widget

 function widget($args, $instance)
 {
     global $post;
     /* PRINT THE WIDGET */
     extract($args, EXTR_SKIP);
     $instance = wp_parse_args((array) $instance, array('title' => ''));
     $title = $instance['title'];
     if (!is_single()) {
         return;
     }
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title;
         echo apply_filters('widget_title', esc_attr($title), $instance, $this->id_base);
         echo $after_title;
     }
     $y = esc_attr(get_post_time('Y', false, $post->ID));
     $m = esc_attr(get_post_time('m', false, $post->ID));
     $d = esc_attr(get_post_time('d', false, $post->ID));
     $name = get_the_author_meta('display_name', $post->post_author);
     $dtime = get_post_time('Y-m-d', false, $post->ID);
     $ptime = get_post_time(esc_attr(get_option('date_format')), false, $post->ID, true);
     echo '<div class="large-icons">';
     echo '<ul>';
     edit_post_link('<i class="icon-pencil"></i>' . __('Edit', 'treeson'), '<li>', '</li>');
     echo '<li><a href="' . esc_url(get_day_link($y, $m, $d)) . '">';
     echo '<time datetime="' . esc_attr($dtime) . '"><i class="icon-calendar"></i>' . esc_html($ptime) . '</time></a></li>';
     echo '<li><a href="' . esc_url(get_author_posts_url($post->post_author)) . '" title="' . sprintf(__('Writed by %s', 'treeson'), esc_attr($name)) . '"><i class="icon-user-5"></i>' . esc_html($name) . '</a></li>';
     if ($post->comment_status == 'open') {
         $nr = get_comments_number($post->ID);
         echo '<li>';
         echo '<a href="' . esc_url(get_comments_link($post->ID)) . '">';
         echo '<i class="icon-comment"></i>';
         echo sprintf(_nx('%s Comment', '%s Comments', absint($nr), 'Number of comment(s) from widget "myThemes: Meta Details"', 'treeson'), number_format_i18n(absint($nr)));
         echo '</a></li>';
     }
     if (function_exists('stats_get_csv')) {
         $args = array('days' => -1, 'post_id' => $post->ID);
         $result = stats_get_csv('postviews', $args);
         $views = $result[0]['views'];
         echo '<li><i class="icon-eye-2"></i> ' . sprintf(_n('%s view', '%s views', absint($views), 'treeson'), number_format_i18n(absint($views))) . '</li>';
     }
     echo '</ul>';
     echo '</div>';
     echo $after_widget;
 }
开发者ID:roundtopdog,项目名称:wordpress,代码行数:46,代码来源:mythemes.post_meta.class.php


示例13: gdlr_get_cause_info

 function gdlr_get_cause_info($array = array(), $post_option = array(), $wrapper = true)
 {
     global $theme_option;
     $ret = '';
     foreach ($array as $post_info) {
         switch ($post_info) {
             case 'date':
                 $ret .= '<div class="cause-info cause-date"><i class="icon-time"></i>';
                 $ret .= '<a href="' . get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d')) . '">';
                 //$ret .= '<time date-time="' . get_the_time('Y-m-d') . '" pubdate>';
                 $ret .= get_the_time($theme_option['date-format']);
                 //$ret .= '</time>';
                 $ret .= '</a>';
                 $ret .= '</div>';
                 break;
             case 'category':
                 $cat = get_the_term_list(get_the_ID(), 'cause_category', '', '<span class="sep">,</span> ', '');
                 if (empty($cat)) {
                     break;
                 }
                 $ret .= '<div class="cause-info cause-category"><i class="icon-folder-close-alt"></i>';
                 $ret .= $cat;
                 $ret .= '</div>';
                 break;
             case 'pdf':
                 if (!empty($post_option['pdf'])) {
                     $ret .= '<div class="cause-info cause-pdf"><i class="icon-file-text"></i>';
                     $ret .= '<a href="' . wp_get_attachment_url($post_option['pdf']) . '" >';
                     $ret .= __('Download PDF', 'gdlr-cause');
                     $ret .= '</a>';
                     $ret .= '</div>';
                 }
                 break;
         }
     }
     if ($wrapper && !empty($ret)) {
         return '<div class="gdlr-cause-info">' . $ret . '<div class="clear"></div></div>';
     } else {
         if (!empty($ret)) {
             return $ret . '<div class="clear"></div>';
         }
     }
     return '';
 }
开发者ID:TheHiddenHaku,项目名称:fuzzy-waddle,代码行数:44,代码来源:gdlr-cause-item.php


示例14: get_post_footer

function get_post_footer()
{
    $p_y = get_the_time('Y');
    $p_m = get_the_time('m');
    $p_d = get_the_time('d');
    $p_date = $p_y . '/' . $p_m . '/' . $p_d;
    $p_link = get_permalink();
    $result = '<div class="post-footer"><a href="' . $p_link . '" title="' . $p_link . '">#</a> | ';
    $result .= '<a href="' . get_day_link($p_y, $p_m, $p_d) . '" title="' . $p_date . ' ' . get_the_time("h:i:s a") . '">' . $p_date . '</a> | ' . get_the_category_list(' &bull; ');
    if (!is_page() && comments_open()) {
        $c_num = get_comments_number();
        if ($c_num == 0) {
            $c = __('No Comments', 'nutcrackr');
        } elseif ($c_num > 1) {
            $c = sprintf(__('%d Comments', 'nutcrackr'), $c_num);
        } else {
            $c = __('1 Comment', 'nutcrackr');
        }
        $result .= ' | <span class="number-of-comments"><a href="' . $p_link . '#comments" title="' . __('comment', 'nutcrackr') . '">' . $c . '</a></span>';
    }
    $result .= '</div>';
    echo $result;
}
开发者ID:bodies,项目名称:wp-nodancer,代码行数:23,代码来源:functions.php


示例15: get_calendar


//.........这里部分代码省略.........
    }
    echo '
	</tr>
	</thead>

	<tfoot>
	<tr>';
    if ($previous) {
        if (function_exists('mb_substr')) {
            $smonth_name = mb_substr($month[zeroise($previous->month, 2)], 0, 3);
        } else {
            $smonth_name = substr($month[zeroise($previous->month, 2)], 0, 3);
        }
        $month_str = ereg_replace('%MONTH', $month[zeroise($previous->month, 2)], $wp_month_format);
        $month_str = ereg_replace('%YEAR', date('Y', mktime(0, 0, 0, $previous->month, 1, $previous->year)), $month_str);
        echo "\n\t\t" . '<td abbr="' . $month[zeroise($previous->month, 2)] . '" colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="View posts for ' . $month_str . '">&laquo; ' . $smonth_name . '</a></td>';
    } else {
        echo "\n\t\t" . '<td colspan="3" id="prev" class="pad">&nbsp;</td>';
    }
    echo "\n\t\t" . '<td class="pad">&nbsp;</td>';
    if ($next) {
        if (function_exists('mb_substr')) {
            $smonth_name = mb_substr($month[zeroise($next->month, 2)], 0, 3);
        } else {
            $smonth_name = substr($month[zeroise($next->month, 2)], 0, 3);
        }
        $month_str = ereg_replace('%MONTH', $month[zeroise($next->month, 2)], $wp_month_format);
        $month_str = ereg_replace('%YEAR', date('Y', mktime(0, 0, 0, $next->month, 1, $next->year)), $month_str);
        echo "\n\t\t" . '<td abbr="' . $month[zeroise($next->month, 2)] . '" colspan="3" id="next"><a href="' . get_month_link($next->year, $next->month) . '" title="View posts for ' . $month_str . '">' . $smonth_name . ' &raquo;</a></td>';
    } else {
        echo "\n\t\t" . '<td colspan="3" id="next" class="pad">&nbsp;</td>';
    }
    echo '
	</tr>
	</tfoot>

	<tbody>
	<tr>';
    // Get days with posts
    $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)\n\t\t\tFROM {$wpdb->posts[$wp_id]} WHERE MONTH(post_date) = {$thismonth}\n\t\t\tAND YEAR(post_date) = {$thisyear}\n\t\t\tAND post_status = 'publish'\n\t\t\tAND post_date < '" . date("Y-m-d H:i:s", time() + $time_difference * 3600) . "'", ARRAY_N);
    if ($dayswithposts) {
        foreach ($dayswithposts as $daywith) {
            $daywithpost[] = $daywith[0];
        }
    } else {
        $daywithpost = array();
    }
    if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE") || strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "camino") || strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "safari")) {
        $ak_title_separator = "\n";
    } else {
        $ak_title_separator = ", ";
    }
    $ak_titles_for_day = array();
    $ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom " . "FROM {$wpdb->posts[$wp_id]} " . "WHERE YEAR(post_date) = '{$thisyear}' " . "AND MONTH(post_date) = '{$thismonth}' " . "AND post_date < '" . date("Y-m-d H:i:s", time() + $time_difference * 3600) . "' " . "AND post_status = 'publish'");
    if ($ak_post_titles) {
        foreach ($ak_post_titles as $ak_post_title) {
            if (empty($ak_titles_for_day["day_" . $ak_post_title->dom])) {
                $ak_titles_for_day["day_" . $ak_post_title->dom] = '';
            }
            if (empty($ak_titles_for_day["{$ak_post_title->dom}"])) {
                // first one
                $ak_titles_for_day["{$ak_post_title->dom}"] = htmlspecialchars(stripslashes($ak_post_title->post_title));
            } else {
                $ak_titles_for_day["{$ak_post_title->dom}"] .= $ak_title_separator . htmlspecialchars(stripslashes($ak_post_title->post_title));
            }
        }
    }
    // See how much we should pad in the beginning
    $pad = intval(date('w', $unixmonth));
    if (0 != $pad) {
        echo "\n\t\t<td colspan='{$pad}' class='pad'>&nbsp;</td>";
    }
    $daysinmonth = intval(date('t', $unixmonth));
    for ($day = 1; $day <= $daysinmonth; ++$day) {
        if (isset($newrow) && $newrow) {
            echo "\n\t</tr>\n\t<tr>\n\t\t";
        }
        $newrow = false;
        if ($day == date('j', time() + $time_difference * 3600) && $thismonth == date('m', time() + $time_difference * 3600)) {
            echo '<td id="today">';
        } else {
            echo "<td>";
        }
        if (in_array($day, $daywithpost)) {
            // any posts today?
            echo '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"{$ak_titles_for_day[$day]}\">{$day}</a>";
        } else {
            echo $day;
        }
        echo '</td>';
        if (6 == date('w', mktime(0, 0, 0, $thismonth, $day, $thisyear))) {
            $newrow = true;
        }
    }
    $pad = 7 - date('w', mktime(0, 0, 0, $thismonth, $day, $thisyear));
    if ($pad != 0 && $pad != 7) {
        echo "\n\t\t<td class='pad' colspan='{$pad}'>&nbsp;</td>";
    }
    echo "\n\t</tr>\n\t</tbody>\n\t</table>";
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:101,代码来源:template-functions-general.php


示例16: get_calendar


//.........这里部分代码省略.........
	</tr>
	</thead>

	<tfoot>
	<tr>';
    if ($previous) {
        $calendar_output .= "\n\t\t" . '<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
    } else {
        $calendar_output .= "\n\t\t" . '<td colspan="3" id="prev" class="pad">&nbsp;</td>';
    }
    $calendar_output .= "\n\t\t" . '<td class="pad">&nbsp;</td>';
    if ($next) {
        $calendar_output .= "\n\t\t" . '<td colspan="3" id="next"><a href="' . get_month_link($next->year, $next->month) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' &raquo;</a></td>';
    } else {
        $calendar_output .= "\n\t\t" . '<td colspan="3" id="next" class="pad">&nbsp;</td>';
    }
    $calendar_output .= '
	</tr>
	</tfoot>

	<tbody>
	<tr>';
    $daywithpost = array();
    // Get days with posts
    $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)\n\t\tFROM {$wpdb->posts} WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'\n\t\tAND post_type = 'post' AND post_status = 'publish'\n\t\tAND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N);
    if ($dayswithposts) {
        foreach ((array) $dayswithposts as $daywith) {
            $daywithpost[] = $daywith[0];
        }
    }
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false) {
        $ak_title_separator = "\n";
    } else {
        $ak_title_separator = ', ';
    }
    $ak_titles_for_day = array();
    $ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom " . "FROM {$wpdb->posts} " . "WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' " . "AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' " . "AND post_type = 'post' AND post_status = 'publish'");
    if ($ak_post_titles) {
        foreach ((array) $ak_post_titles as $ak_post_title) {
            /** This filter is documented in wp-includes/post-template.php */
            $post_title = esc_attr(apply_filters('the_title', $ak_post_title->post_title, $ak_post_title->ID));
            if (empty($ak_titles_for_day['day_' . $ak_post_title->dom])) {
                $ak_titles_for_day['day_' . $ak_post_title->dom] = '';
            }
            if (empty($ak_titles_for_day["{$ak_post_title->dom}"])) {
                // first one
                $ak_titles_for_day["{$ak_post_title->dom}"] = $post_title;
            } else {
                $ak_titles_for_day["{$ak_post_title->dom}"] .= $ak_title_separator . $post_title;
            }
        }
    }
    // See how much we should pad in the beginning
    $pad = calendar_week_mod(date('w', $unixmonth) - $week_begins);
    if (0 != $pad) {
        $calendar_output .= "\n\t\t" . '<td colspan="' . esc_attr($pad) . '" class="pad">&nbsp;</td>';
    }
    $daysinmonth = intval(date('t', $unixmonth));
    for ($day = 1; $day <= $daysinmonth; ++$day) {
        if (isset($newrow) && $newrow) {
            $calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t";
        }
        $newrow = false;
        if ($day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp'))) {
            $calendar_output .= '<td id="today">';
        } else {
            $calendar_output .= '<td>';
        }
        if (in_array($day, $daywithpost)) {
            // any posts today?
            $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . '" title="' . esc_attr($ak_titles_for_day[$day]) . "\">{$day}</a>";
        } else {
            $calendar_output .= $day;
        }
        $calendar_output .= '</td>';
        if (6 == calendar_week_mod(date('w', mktime(0, 0, 0, $thismonth, $day, $thisyear)) - $week_begins)) {
            $newrow = true;
        }
    }
    $pad = 7 - calendar_week_mod(date('w', mktime(0, 0, 0, $thismonth, $day, $thisyear)) - $week_begins);
    if ($pad != 0 && $pad != 7) {
        $calendar_output .= "\n\t\t" . '<td class="pad" colspan="' . esc_attr($pad) . '">&nbsp;</td>';
    }
    $calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>";
    $cache[$key] = $calendar_output;
    wp_cache_set('get_calendar', $cache, 'calendar');
    if ($echo) {
        /**
         * Filter the HTML calendar output.
         *
         * @since 3.0.0
         *
         * @param string $calendar_output HTML output of the calendar.
         */
        echo apply_filters('get_calendar', $calendar_output);
    } else {
        /** This filter is documented in wp-includes/general-template.php */
        return apply_filters('get_calendar', $calendar_output);
    }
}
开发者ID:jenoya,项目名称:final,代码行数:101,代码来源:general-template.php


示例17: get_ls_languages


//.........这里部分代码省略.........
                 $lang['missing'] = 1;
             }
         } elseif (is_archive() && !is_tag()) {
             global $icl_archive_url_filter_off;
             $icl_archive_url_filter_off = true;
             if ($this->wp_query->is_year) {
                 if (isset($this->wp_query->query_vars['m']) && !$this->wp_query->query_vars['year']) {
                     $this->wp_query->query_vars['year'] = substr($this->wp_query->query_vars['m'], 0, 4);
                 }
                 $lang['translated_url'] = $this->archive_url(get_year_link($this->wp_query->query_vars['year']), $lang['code']);
             } elseif ($this->wp_query->is_month) {
                 if (isset($this->wp_query->query_vars['m']) && !$this->wp_query->query_vars['year']) {
                     $this->wp_query->query_vars['year'] = substr($this->wp_query->query_vars['m'], 0, 4);
                     $this->wp_query->query_vars['monthnum'] = substr($this->wp_query->query_vars['m'], 4, 2);
                 } else {
                     if ($icl_lso_link_empty) {
                         if (!empty($template_args['link_empty_to'])) {
                             $lang['translated_url'] = str_replace('{%lang}', $lang['code'], $template_args['link_empty_to']);
                         } else {
                             $lang['translated_url'] = $this->language_url($lang['code']);
                         }
                     }
                     $lang['missing'] = 1;
                 }
                 $lang['translated_url'] = $this->archive_url(get_month_link($this->wp_query->query_vars['year'], $this->wp_query->query_vars['monthnum']), $lang['code']);
             } elseif ($this->wp_query->is_day) {
                 if (isset($this->wp_query->query_vars['m']) && !$this->wp_query->query_vars['year']) {
                     $this->wp_query->query_vars['year'] = substr($this->wp_query->query_vars['m'], 0, 4);
                     $this->wp_query->query_vars['monthnum'] = substr($this->wp_query->query_vars['m'], 4, 2);
                     $this->wp_query->query_vars['day'] = substr($this->wp_query->query_vars['m'], 6, 2);
                     gmdate('Y', current_time('timestamp'));
                     //force wp_timezone_override_offset to be called
                 }
                 $lang['translated_url'] = $this->archive_url(get_day_link($this->wp_query->query_vars['year'], $this->wp_query->query_vars['monthnum'], $this->wp_query->query_vars['day']), $lang['code']);
             } else {
                 if (isset($this->wp_query->query_vars['post_type'])) {
                     do_action('_icl_before_archive_url', $this->wp_query->query_vars['post_type'], $lang['code']);
                     if ($this->is_translated_post_type($this->wp_query->query_vars['post_type']) && function_exists('get_post_type_archive_link')) {
                         remove_filter('post_type_archive_link', array($this, 'post_type_archive_link_filter'), 10);
                         $lang['translated_url'] = $this->convert_url(get_post_type_archive_link($this->wp_query->query_vars['post_type']), $lang['code']);
                     } else {
                         if ($k != $this->get_default_language()) {
                             $skip_lang = true;
                             unset($w_active_languages[$k]);
                         }
                     }
                     do_action('_icl_after_archive_url', $this->wp_query->query_vars['post_type'], $lang['code']);
                 }
             }
             add_filter('post_type_archive_link', array($this, 'post_type_archive_link_filter'), 10, 2);
             $icl_archive_url_filter_off = false;
         } elseif (is_search()) {
             $url_glue = strpos($this->language_url($lang['code']), '?') === false ? '?' : '&';
             $lang['translated_url'] = $this->language_url($lang['code']) . $url_glue . 's=' . urlencode($wp_query->query['s']);
         } else {
             global $icl_language_switcher_preview;
             if ($icl_lso_link_empty || is_home() || is_404() || 'page' == get_option('show_on_front') && ($this- 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_db函数代码示例发布时间:2022-05-15
下一篇:
PHP get_day_end函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap