本文整理汇总了PHP中the_date函数的典型用法代码示例。如果您正苦于以下问题:PHP the_date函数的具体用法?PHP the_date怎么用?PHP the_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_columns
/**
* Display of Custom Post Type Columns
* @param array $column
* @since 1.0.0
*/
public function custom_columns($column)
{
global $post;
switch ($column) {
case 'title':
the_title();
break;
case 'author':
the_author();
break;
case 'cat':
echo get_the_term_list($post->ID, 'docu_cat', ' ', ', ', '');
break;
case 'tag':
echo get_the_term_list($post->ID, 'docu_tag', ' ', ', ', '');
break;
case 'comment':
comments_number(__('No Comments', 'documentate'), __('1 Comment', 'documentate'), __('% Comments', 'documentate'));
break;
case 'views':
$views = get_post_meta($post->ID, 'documentate_post_views_count', true);
if ($views) {
printf(_n('%s view', '%s views', $rating, 'documentate'), $views);
} else {
echo __('No Views', 'documentate');
}
break;
case 'date':
the_date();
break;
}
}
示例2: mars_video_meta
/**
* Display Video Meta as Viewed, Liked
*/
function mars_video_meta()
{
global $post, $videotube;
$viewed = get_post_meta($post->ID, 'count_viewed', true) ? get_post_meta($post->ID, 'count_viewed', true) : 1;
$datetime_format = isset($videotube['datetime_format']) ? $videotube['datetime_format'] : 'videotube';
$comments = wp_count_comments($post->ID);
$block = '
<div class="meta">';
if ($datetime_format != 'videotube') {
$block .= '<span class="date">' . the_date('', '', '', false) . '</span>';
} else {
$block .= '<span class="date">il y a ' . human_time_diff(get_the_time('U'), current_time('timestamp')) . '</span>';
}
$block .= '
<span class="views"><i class="fa fa-eye"></i>' . $viewed . '</span>';
if (function_exists('mars_get_like_count')) {
$block .= '<span class="heart"><i class="fa fa-heart"></i>' . mars_get_like_count($post->ID) . '</span>';
}
$block .= '
<span class="fcomments"><i class="fa fa-comments"></i>' . $comments->approved . '</span>
';
$block .= '
</div>
';
return $block;
}
示例3: wpex_post_meta
function wpex_post_meta()
{
?>
<section class="meta clearfix" id="single-meta">
<ul>
<li class="meta-single-date"><span class="fa fa-calendar"></span><?php
the_date();
?>
</li>
<?php
if (comments_open()) {
?>
<li class="comment-scroll meta-single-comments"><span class="fa fa-comment"></span> <?php
comments_popup_link(__('Leave a comment', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link', __('Comments closed', 'wpex'));
?>
</li>
<?php
}
?>
<?php
if (function_exists('zilla_likes')) {
?>
<li class="meta-single-zilla-likes"><?php
zilla_likes();
?>
</li><?php
}
?>
</ul>
</section><!--/meta -->
<?php
}
示例4: post_excerpts_here
function post_excerpts_here()
{
//posts with date, author, time, content excerpts, and title..
if (have_posts()) {
while (have_posts()) {
echo '<div class="excerpt-div">';
the_post();
echo '<h2 class="post-title"><a href="';
the_permalink();
echo '" title="';
the_title();
echo '">';
the_title();
echo '</a></h2>';
echo '<h4 class="post-info">';
echo 'Created on ';
the_date();
echo ' at ';
the_time();
echo ' by ';
the_author_meta(first_name);
echo '.</h4>';
echo '<p class="post-excerpt">';
the_excerpt();
echo '</p>';
echo '</div>';
}
// end while
}
// end if
}
示例5: blog_summary_shortcode
function blog_summary_shortcode($attr)
{
// Describes what attributes to parse from shortcode; only 'count'
extract(shortcode_atts(array('count' => '5', 'grouptag' => 'ul', 'entrytag' => 'li', 'titletag' => 'h4', 'datetag' => 'span', 'commentstag' => 'span', 'summarytag' => 'div'), $attr));
// Queries to populate our loop based on shortcode count attribute
$r = new WP_Query("showposts={$count}&what_to_show=posts&nopaging=0&post_status=publish");
// Only run if we have posts; can't run this through searches
if ($r->have_posts() && !is_search()) {
// If we're using a Sandbox-friendly theme . . .
if (function_exists('sandbox_body_class')) {
// We can't have double hfeed classes, otherwise it won't parse
$groupclasses = 'xoxo';
} else {
// Otherwise, use hfeed to ensure hAtom compliance
$groupclasses = 'xoxo hfeed';
}
// Begin the output for shortcode and inserts in the group tag what classes we have
$output = '<' . $grouptag . ' class="' . $groupclasses . '">';
// Begins our loop for returning posts
while ($r->have_posts()) {
// Sets which post from our loop we're at
$r->the_post();
// Allows the_date() with multiple posts within a single day
unset($previousday);
// If we're using a Sandbox-friendly theme . . .
if (function_exists('sandbox_post_class')) {
// Let's use semantic classes with each entry element
$entryclasses = sandbox_post_class(false);
} else {
// Otherwise, use hentry to ensure hAtom compliance
$entryclasses = 'hentry';
}
// Begin entry wrapper and inserts what classes we got from above
$output .= "\n" . '<' . $entrytag . ' class="' . $entryclasses . '">';
// Post title
$output .= "\n" . '<' . $titletag . ' class="entry-title"><a href="' . get_permalink() . '" title="' . sprintf(__('Permalink to %s', 'blog_summary'), the_title_attribute('echo=0')) . '" rel="bookmark">' . get_the_title() . '</a></' . $titletag . '>';
// Post date with hAtom support
$output .= "\n" . '<' . $datetag . ' class="entry-date"><abbr class="published" title="' . get_the_time('Y-m-d\\TH:i:sO') . '">' . sprintf(__('%s', 'blog_summary'), the_date('', '', '', false)) . '</abbr></' . $datetag . '>';
// Comments number
$output .= "\n" . '<' . $commentstag . ' class="entry-comments"><a href="' . get_permalink() . '#comments" title="' . sprintf(__('Comments to %s', 'blog_summary'), the_title_attribute('echo=0')) . '">' . sprintf(__('Comments (%s)', 'blog_summary'), apply_filters('comments_number', get_comments_number())) . '</a></' . $commentstag . '>';
// Post excerpt with hAtom support
$output .= "\n" . '<' . $summarytag . ' class="entry-summary">' . "\n" . apply_filters('the_excerpt', get_the_excerpt()) . '</' . $summarytag . '>';
// Close each post LI
$output .= "\n" . '</' . $entrytag . '>';
// Finish the have_posts() query
}
// while ( $r->have_posts() ) :
// Close the parent UL
$output .= "\n" . '</' . $grouptag . '>';
// Rewinds loop from $r->the_post();
rewind_posts();
// End the initial IF statement
}
// if ( $r->have_posts() ) :
// Clears our query to put the loop back where it was
wp_reset_query();
// $r = new WP_Query()
// Returns $output to the shortcode
return $output;
}
示例6: rb_portfolio_loop_content
function rb_portfolio_loop_content()
{
if (have_posts()) {
add_thickbox();
while (have_posts()) {
the_post();
?>
<article <?php
post_class();
?>
>
<?php
rb_portfolio_add_image();
//rb_portfolio_featured_post_image();
the_date('F Y', '<span class="portfolio-date">', '</span>');
genesis_do_post_title();
rb_portfolio_add_authors();
rb_portfolio_display_thickbox_content();
?>
</article>
<?php
}
}
}
示例7: b_wp_contents_show
function b_wp_contents_show($options)
{
// global $xoopsDB,$xoopsUser;
// global $tableoptions,$tableusers;
// global $id, $posts, $post, $day, $previousday, $newday;
$id = 1;
global $posts, $post, $day, $previousday, $newday;
global $dateformat, $time_difference, $siteurl, $blogfilename;
global $tablelinks, $tablelinkcategories;
global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
global $tableposts, $tablepost2cat, $tablecomments, $tablecategories;
global $smilies_directory, $use_smilies, $wp_smiliessearch, $wp_smiliesreplace;
global $wp_bbcode, $use_bbcode, $wp_gmcode, $use_gmcode, $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni;
require_once dirname(__FILE__) . '/../wp-blog-header.php';
$blog = 1;
$block = array();
$block['siteurl'] = $siteurl;
foreach ($posts as $post) {
$content = array();
start_wp();
$content['date'] = the_date('', '<h2>', '</h2>', false);
$content['time'] = the_time('', false);
$content['title'] = the_title('', '', false);
$content['permlink'] = get_permalink();
//
ob_start();
the_author();
$content['author'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_category();
$content['category'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_content();
$content['body'] = ob_get_contents();
ob_end_clean();
//
ob_start();
link_pages('<br />Pages: ', '<br />', 'number');
$content['linkpage'] = ob_get_contents();
ob_end_clean();
//
ob_start();
comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)');
$content['comments'] = ob_get_contents();
ob_end_clean();
//
ob_start();
trackback_rdf();
$content['trackback'] = ob_get_contents();
ob_end_clean();
//
$block['contents'][] = $content;
}
return $block;
}
示例8: tabs
function tabs()
{
$course_duration_parameter = apply_filters('vibe_course_duration_parameter', 86400);
$drip_duration_parameter = apply_filters('vibe_drip_duration_parameter', 86400);
$unit_duration_parameter = apply_filters('vibe_unit_duration_parameter', 60);
$quiz_duration_parameter = apply_filters('vibe_quiz_duration_parameter', 60);
$product_duration_parameter = apply_filters('vibe_product_duration_parameter', 86400);
$assignment_duration_parameter = apply_filters('vibe_assignment_duration_parameter', 86400);
return apply_filters('wplms_course_creation_tabs', array('create_course' => array('icon' => 'book-open', 'title' => isset($this->course_id) ? __('EDIT COURSE', 'wplms-front-end') : __('CREATE COURSE', 'wplms-front-end'), 'subtitle' => __('Start building a course', 'wplms-front-end'), 'fields' => array(array('label' => __('Course title', 'wplms-front-end'), 'type' => 'title', 'id' => 'post_title', 'from' => 'post', 'value_type' => 'single', 'style' => 'col-md-12', 'default' => __('ENTER A COURSE TITLE', 'wplms-front-end'), 'help' => __('This is the title of the course which is displayed on top of every course', 'wplms-front-end')), array('label' => __('Course Category', 'wplms-front-end'), 'type' => 'taxonomy', 'taxonomy' => 'course-cat', 'from' => 'taxonomy', 'value_type' => 'single', 'style' => 'col-md-12', 'id' => 'course-cat', 'default' => __('Select a Course Category', 'wplms-front-end')), array('label' => __('Course Image', 'wplms-front-end'), 'type' => 'featured_image', 'level' => 'thumbnail', 'value_type' => 'single', 'upload_title' => __('Upload a Course Image', 'wplms-front-end'), 'upload_button' => __('Set as Course Image', 'wplms-front-end'), 'style' => 'col-md-3', 'from' => 'post', 'id' => 'post_thumbnail', 'default' => VIBE_URL . '/images/add_image.png'), array('label' => __('Course Short Description', 'wplms-front-end'), 'type' => 'textarea', 'style' => 'col-md-9', 'value_type' => 'single', 'id' => 'post_excerpt', 'from' => 'post', 'extras' => '<a class="link toggle_vibe_post_content">' . __('Add full description', 'wplms-front-end') . '</a>', 'default' => __('Enter a short description of the course.', 'wplms-front-end')), array('label' => __('Full Description', 'wplms-front-end'), 'type' => 'editor', 'style' => 'col-md-12', 'value_type' => 'single', 'id' => 'post_content', 'from' => 'post', 'noscript' => true, 'default' => __('Enter full description of the course.', 'wplms-front-end')), array('label' => isset($this->course_id) ? __('SAVE COURSE', 'wplms-front-end') : __('CREATE COURSE', 'wplms-front-end'), 'id' => isset($this->course_id) ? 'save_course_button' : 'create_course_button', 'type' => 'button'))), 'course_settings' => array('icon' => 'settings-1', 'title' => __('SETTINGS', 'wplms-front-end'), 'subtitle' => __('Course settings', 'wplms-front-end'), 'fields' => array(array('label' => __('Course duration', 'wplms-front-end'), 'text' => __('Maximum Course Duration', 'wplms-front-end'), 'type' => 'number', 'style' => '', 'id' => 'vibe_duration', 'from' => 'meta', 'extra' => calculate_duration_time($course_duration_parameter), 'default' => 9999, 'desc' => sprintf(__('Enter the maximum duration for the course in %s. This is the maximum duration within which the student should complete the course. Use 9999 for unlimited access to course.', 'wplms-front-end'), calculate_duration_time($course_duration_parameter))), array('label' => __('Course Evaluation', 'wplms-front-end'), 'text' => __('Course Evaluation Mode', 'wplms-front-end'), 'type' => 'switch', 'options' => array('H' => __('MANUAL', 'wplms-front-end'), 'S' => __('AUTOMATIC', 'wplms-front-end')), 'style' => '', 'id' => 'vibe_course_auto_eval', 'from' => 'meta', 'default' => 'H', 'desc' => __('User gets the course result instantly upon submission.', 'wplms-front-end')), array('label' => __('Prerequisite Course', 'wplms-front-end'), 'text' => __('Set a prerequisite Course', 'wplms-front-end'), 'type' => 'selectmulticpt', 'cpt' => 'course', 'style' => '', 'id' => 'vibe_pre_course', 'placeholder' => __('Enter first 4 letters of course for search', 'wplms-front-end'), 'from' => 'meta', 'desc' => __('Pre-required course which the user needs to complete before subscribing to this course.', 'wplms-front-end')), array('label' => __('Drip Feed', 'wplms-front-end'), 'text' => __('Course Drip Feed', 'wplms-front-end'), 'type' => 'conditionalswitch', 'hide_nodes' => array('vibe_course_section_drip', 'vibe_course_drip_duration'), 'options' => array('H' => __('DISABLE', 'wplms-front-end'), 'S' => __('ENABLE', 'wplms-front-end')), 'style' => '', 'id' => 'vibe_course_drip', 'from' => 'meta', 'default' => 'H', 'desc' => __('Drip Feed courses, units are released one by one after certain duration of time.', 'wplms-front-end')), array('label' => __('Drip Feed Type', 'wplms-front-end'), 'text' => __('Drip Feed Type', 'wplms-front-end'), 'type' => 'switch', 'options' => array('H' => __('UNIT', 'wplms-front-end'), 'S' => __('SECTION', 'wplms-front-end')), 'style' => '', 'id' => 'vibe_course_section_drip', 'from' => 'meta', 'default' => 'H', 'desc' => __('Drip Feed courses, units are released one by one after certain duration to the user.', 'wplms-front-end')), array('label' => __('Drip Duration', 'wplms-front-end'), 'text' => __('Set Duration between two successive Course elements', 'wplms-front-end'), 'type' => 'number', 'style' => '', 'id' => 'vibe_course_drip_duration', 'from' => 'meta', 'extra' => calculate_duration_time($drip_duration_parameter), 'default' => 1, 'desc' => sprintf(__('Enter the drip duration for the course in %s. This is the duration after which the next unit/section unlocks for the user after viewing the previous unit/section.', 'wplms-front-end'), calculate_duration_time($drip_duration_parameter))), array('label' => __('Course Certificate', 'wplms-front-end'), 'text' => __('Course Certificate', 'wplms-front-end'), 'type' => 'conditionalswitch', 'hide_nodes' => array('vibe_course_passing_percentage', 'vibe_certificate_template'), 'options' => array('H' => __('DISABLE', 'wplms-front-end'), 'S' => __('ENABLE', 'wplms-front-end')), 'style' => '', 'id' => 'vibe_course_certificate', 'from' => 'meta', 'default' => 'H', 'desc' => __('Award Course completion Certificates to student on course completion.', 'wplms-front-end')), array('label' => __('Passing Percentage', 'wplms-front-end'), 'text' => __('Set Certificate Percentage', 'wplms-front-end'), 'type' => 'number', 'style' => '', 'id' => 'vibe_course_passing_percentage', 'from' => 'meta', 'extra' => __(' out of 100', 'wplms-front-end'), 'default' => 40, 'desc' => __('Any user achieving more marks (weighted average of Quizzes/assignments in course) than this gets the Course certificate.', 'wplms-front-end')), array('label' => __('Certificate Template', 'wplms-front-end'), 'text' => __('Select Certificate template', 'wplms-front-end'), 'type' => 'selectcpt', 'cpt' => 'certificate', 'style' => '', 'id' => 'vibe_certificate_template', 'placeholder' => __('Enter first 3 letters to search course template', 'wplms-front-end'), 'from' => 'meta', 'desc' => __('Connect a custom Certificate template for this Course.', 'wplms-front-end')), array('label' => __('Course Badge', 'wplms-front-end'), 'text' => __('Course Badge', 'wplms-front-end'), 'type' => 'conditionalswitch', 'hide_nodes' => array('vibe_course_badge_percentage', 'vibe_course_badge_title', 'vibe_course_badge'), 'options' => array('H' => __('DISABLE', 'wplms-front-end'), 'S' => __('ENABLE', 'wplms-front-end')), 'style' => '', 'id' => 'vibe_badge', 'from' => 'meta', 'default' => 'H', 'desc' => __('Award Excellence badges to student on course completion.', 'wplms-front-end')), array('label' => __('Badge Percentage', 'wplms-front-end'), 'text' => __('Set Excellence Badge Percentage', 'wplms-front-end'), 'type' => 'number', 'style' => '', 'id' => 'vibe_course_badge_percentage', 'from' => 'meta', 'extra' => __(' out of 100', 'wplms-front-end'), 'default' => 75, 'desc' => __('Any user achieving more marks (weighted average of Quizzes/assignments in course) than this gets the Course Badge.', 'wplms-front-end')), array('label' => __('Badge Title', 'wplms-front-end'), 'text' => __('Set Badge title', 'wplms-front-end'), 'type' => 'text', 'style' => '', 'id' => 'vibe_course_badge_title', 'from' => 'meta', 'default' => __('Course Badge Title', 'wplms-front-end'), 'desc' => __('Course Badge Title', 'wplms-front-end')), array('label' => __('Course Badge', 'wplms-front-end'), 'text' => __('Upload Course Badge', 'wplms-front-end'), 'type' => 'media', 'style' => '', 'title' => __('Select or Upload a Course badge.', 'wplms-front-end'), 'button' => __('Add Course badge.', 'wplms-front-end'), 'id' => 'vibe_course_badge', 'default' => VIBE_URL . '/images/add_image.png', 'from' => 'meta', 'desc' => __('Upload a course badge.', 'wplms-front-end')), array('label' => __('Course Start Date', 'wplms-front-end'), 'text' => __('Start date', 'wplms-front-end'), 'type' => 'date', 'style' => '', 'id' => 'vibe_start_date', 'default' => the_date('Y-m-d', '', '', false), 'from' => 'meta', 'desc' => __('Set a Course start date.', 'wplms-front-end')), array('label' => __('Course Instructions', 'wplms-front-end'), 'text' => __('Add Course specific instructions', 'wplms-front-end'), 'type' => 'editor', 'noscript' => true, 'style' => '', 'id' => 'vibe_course_instructions', 'from' => 'meta', 'desc' => __('Course instructions are displayed when the user starts a course.', 'wplms-front-end')), array('label' => __('Course Completion Message', 'wplms-front-end'), 'text' => __('Completion Message', 'wplms-front-end'), 'type' => 'editor', 'noscript' => true, 'style' => '', 'id' => 'vibe_course_message', 'from' => 'meta', 'desc' => __('Completion message is shown to the student when she finishes the course.', 'wplms-front-end')), array('label' => __('SAVE SETTINGS', 'wplms-front-end'), 'id' => 'save_course_settings_button', 'type' => 'button'))), 'course_components' => array('icon' => 'archive', 'title' => __('COMPONENTS', 'wplms-front-end'), 'subtitle' => __('Course settings', 'wplms-front-end'), 'fields' => array(array('label' => __('Course Group', 'wplms-front-end'), 'text' => __('Set a Course Group', 'wplms-front-end'), 'type' => 'group', 'style' => '', 'id' => 'vibe_group', 'from' => 'meta', 'desc' => __('Set a course specific group.', 'wplms-front-end')), array('label' => __('Course Forum', 'wplms-front-end'), 'text' => __('Set a Course Forum', 'wplms-front-end'), 'type' => 'forum', 'style' => '', 'id' => 'vibe_forum', 'from' => 'meta', 'desc' => __('Set a course forum.', 'wplms-front-end')), array('label' => __('SAVE COMPONENTS', 'wplms-front-end'), 'id' => 'save_course_components_button', 'type' => 'button'))), 'course_curriculum' => array('icon' => 'file', 'title' => __('SET CURRICULUM', 'wplms-front-end'), 'subtitle' => __('Add Units and Quizzes', 'wplms-front-end'), 'fields' => array(array('label' => __('Curriculum'), 'id' => 'vibe_course_curriculum', 'buttons' => array('add_course_section' => __('ADD SECTION', 'wplms-front-end'), 'add_course_unit' => __('ADD UNIT', 'wplms-front-end'), 'add_course_quiz' => __('ADD QUIZ', 'wplms-front-end')), 'type' => 'curriculum', 'style' => '', 'default' => 9999, 'desc' => __('Build Course curriculum', 'wplms-front-end')))), 'course_pricing' => array('icon' => 'tag', 'title' => __('PRICING', 'wplms-front-end'), 'subtitle' => __('Set Price for Course', 'wplms-front-end'), 'fields' => array(array('label' => __('Course Pricing', 'wplms-front-end'), 'type' => 'heading'), array('label' => __('Free ', 'wplms-front-end'), 'text' => __('Free Course', 'wplms-front-end'), 'type' => 'switch', 'options' => array('H' => __('No', 'wplms-front-end'), 'S' => __('Yes', 'wplms-front-end')), 'style' => '', 'id' => 'vibe_course_free', 'from' => 'meta', 'default' => 'H', 'desc' => __('By pass any purchase process.', 'wplms-front-end')), array('label' => __('Product ', 'wplms-front-end'), 'text' => __('Set a Course Product', 'wplms-front-end'), 'cpt' => 'product', 'type' => 'selectproduct', 'style' => '', 'id' => 'vibe_product', 'from' => 'meta', 'default' => '', 'desc' => __('Connect a Product with this course.', 'wplms-front-end')), array('label' => __('SAVE PRICING', 'wplms-front-end'), 'id' => 'save_pricing_button', 'type' => 'button'))), 'course_live' => array('icon' => 'glass', 'title' => $this->status == 'publish' ? __('MODIFY COURSE', 'wplms-front-end') : __('PUBLISH COURSE', 'wplms-front-end'), 'subtitle' => $this->status == 'publish' ? __('Change Course status', 'wplms-front-end') : __('Go Live !', 'wplms-front-end'), 'fields' => array(array('label' => __('Take Offline', 'wplms-front-end'), 'id' => 'offline_course', 'type' => 'course_live')))));
}
示例9: sh_latest_posts
function sh_latest_posts($atts)
{
$atts = shortcode_atts(array('cat' => 'news', 'label' => __('News', 'initfest')), $atts);
$result = '<section class="content"><h3>' . $atts['label'] . ' | <small><a href="' . esc_url(get_term_link($atts['cat'], 'category')) . '">' . __('see all', 'initfest') . '</a></small></h3><div class="grid">';
$news_args = array('category_name' => 'news,news-bg', 'numberposts' => 6, 'lang' => of_get_lang());
$news = new WP_Query($news_args);
ob_start();
if ($news->have_posts()) {
$i = 0;
while ($news->have_posts() && $i++ < 6) {
$news->the_post();
?>
<div class="col3">
<h4><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h4>
<p class="info"><?php
pll_e('От');
?>
<?php
the_author();
?>
| <?php
pll_e('Публикувано на');
?>
<?php
the_date();
?>
</p>
<?php
the_excerpt();
?>
<a class="button" href="<?php
the_permalink();
?>
"><?php
pll_e('виж цялата новина');
?>
</a>
</div>
<?php
if ($i == 3) {
echo '</div></section><section class="content"><div class="grid">';
}
}
}
$result .= ob_get_contents();
$result .= '</div></section>';
ob_end_clean();
return $result;
}
示例10: b_wp_contents_show
function b_wp_contents_show($options)
{
global $xoopsDB, $xoopsUser, $wpdb, $siteurl;
global $tableoptions, $tableposts, $tableusers, $tablecategories, $tablecomments, $tablepost2cat;
global $querystring_start, $querystring_equal, $querystring_separator;
global $id, $posts, $post, $day, $previousday, $dateformat, $newday;
require_once dirname(__FILE__) . '/../wp-blog-header.php';
$blog = 1;
$block = array();
$block['siteurl'] = $siteurl;
foreach ($posts as $post) {
$content = array();
start_wp();
$content['date'] = the_date('', '<h2>', '</h2>', false);
$content['time'] = the_time('', false);
$content['title'] = the_title('', '', false);
$content['permlink'] = get_permalink();
//
ob_start();
the_author();
$content['author'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_category();
$content['category'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_content();
$content['body'] = ob_get_contents();
ob_end_clean();
//
ob_start();
link_pages('<br />Pages: ', '<br />', 'number');
$content['linkpage'] = ob_get_contents();
ob_end_clean();
//
ob_start();
comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)');
$content['comments'] = ob_get_contents();
ob_end_clean();
//
ob_start();
trackback_rdf();
$content['trackback'] = ob_get_contents();
ob_end_clean();
//
$block['contents'][] = $content;
}
return $block;
}
示例11: newlife_post_data
function newlife_post_data()
{
$postDate = the_date('', '', '', FALSE);
$postAuthor = get_the_author();
$postCategory = get_the_category_list(', ');
echo "<div class='post-data'>";
echo "Posted on " . $postDate . " by " . $postAuthor;
if ($postCategory != "") {
echo " in " . $postCategory . ".";
}
edit_post_link('EDIT', '<br /><span class="edit-post">', '</span>');
echo "</div>";
}
示例12: download_date_function
function download_date_function($atts)
{
$atts = shortcode_atts(array('id' => '', 'format' => 'Y/m/d \\a\\t g:i A', 'type' => ''), $atts, 'download_date');
if ($atts['id'] != '') {
$id = $atts['id'];
} else {
$id = get_the_ID();
}
if ($atts['type'] == 'modified') {
$date = the_modified_date($atts['format'], '', '', false);
} else {
$date = the_date($atts['format'], '', '', false);
}
return $date;
}
示例13: hjemmesider_intralist
function hjemmesider_intralist($atts)
{
global $post;
ob_start();
// define query parameters based on attributes
$options = array('post_type' => 'simpleintra', 'order' => 'DESC');
$query = new WP_Query($options);
// run the loop based on the query
if ($query->have_posts()) {
?>
<ul class="intranet-liste nul">
<?php
while ($query->have_posts()) {
$query->the_post();
?>
<li>
<h4><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h4>
<p class="dato"><b>Udgivet:</b> <?php
the_date();
?>
</p>
<p class="forfatter"><b>Forfatter:</b> <?php
the_author();
?>
</p>
<p class="comment-count"><b>Kommentarer: </b> <?php
comments_number('0', '1', '%');
?>
</p>
</li>
<?php
}
wp_reset_postdata();
?>
</ul>
<?php
$myvariable = ob_get_clean();
return $myvariable;
}
}
示例14: addImage
function addImage($fileId, $postId, $postType)
{
include_once ABSPATH . "wp-admin" . '/includes/image.php';
include_once ABSPATH . "wp-admin" . '/includes/file.php';
include_once ABSPATH . "wp-admin" . '/includes/media.php';
$post = get_post($postId);
$imageTitle = $post->post_title . the_date('yyyymmdd') . the_time('hhmmss');
$response = media_handle_upload($fileId, $postId, array(title => $imageTitle));
if (gettype($response) == 'integer') {
$urlImage = get_post_meta($response, '_wp_attached_file');
add_post_meta($postId, 'wpcf-imagenes', get_site_url() . '/wp-content/uploads/' . $urlImage[0]);
//Guarda los ids de las imagenes relacionadas
add_post_meta($postId, 'wpcf-ids-imagenes', $response);
return true;
} else {
return $response;
}
}
示例15: tbr_theme_intro
function tbr_theme_intro( $excerpt ) {
global $post;
$title = get_the_title($post->ID);
$github_slug = get_post_meta( $post->ID, 'github_slug', true );
$download_name = get_post_meta( $post->ID, 'download_name', true );
$download_path = '/wp-content/downloads/' . $download_name . '?no_cache=1';
$release_date = get_post_meta( $post->ID, 'release_date', true );
$terms = get_the_terms($post->ID, 'theme_type');
$terms_as_text = strip_tags( get_the_term_list( $post->ID, 'resource_type', '', ', ', '' ) );
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'full-size', true);
$resized_src = beans_edit_image( $thumb_url_array[0], array(
'resize' => array( 750, false )
) );
?>
<div class="uk-grid">
<div class="tm-image uk-width-small-1-1 uk-width-medium-3-5 uk-margin-large-bottom">
<figure class="uk-thumbnail">
<img src="<?php echo $resized_src; ?>" width="750" alt="<?php echo $title; ?> Child-Theme for the Beans WordPress Theme" />
</figure>
</div>
<div class="tm-theme-info uk-width-small-1-1 uk-width-medium-2-5">
<header class="tm-theme-top uk-clearfix uk-float-left">
<h1 class="uk-margin-remove-top uk-h2"><?php echo $title; ?></h1>
<p class="uk-article-lead"><?php echo the_excerpt(); ?></p>
</header>
<div class="tm-downloads">
<a class="uk-button uk-button-primary uk-margin-right" href="<?php echo $download_path; ?>" onclick="javascript:_paq.push(['trackEvent', 'Resource', 'Download' '<?php echo $title; ?>']);" title="Download <?php echo $title; ?>" data-uk-tooltip="{pos:'bottom-left'}">Download</a>
<?php if ( $github_slug != '' ) : ?>
<a class="tm-text-medium tm-github uk-button uk-margin-right" title="View the <?php echo $title; ?> code on GitHub" href="https://github.com/ThemeButler/<?php echo $github_slug; ?>" target="_blank" data-uk-tooltip="{pos:'bottom-left'}"><i class="uk-icon-github uk-icon-small uk-margin-small-right"></i>View on GitHub</a>
<?php endif; ?>
</div>
<ul class="tm-summary uk-list uk-margin-left-remove uk-clearfix">
<li>Type: <span><?php echo $terms_as_text; ?></span></li>
<li>Released: <span><?php the_date('d/m/Y'); ?></span></li>
<li>Requirements: <span>WordPress 4.0+</span></li>
</ul>
</div>
<? }