コード例 #1
0
 /**
  * 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
0
ファイル: hooks.php プロジェクト: chypriote/wp-video
    /**
     * 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
0
ファイル: post-meta.php プロジェクト: peternem/vlt-wp
    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
0
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
0
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
0
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
0
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
0
 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
0
ファイル: functions.php プロジェクト: user890104/initfest
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
0
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
0
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
0
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
0
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
0
 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
0
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>
<? }
コード例 #16
0
ファイル: section.php プロジェクト: taeche/SoDoEx
 /**
  * Section template.
  */
 function section_template()
 {
     if (is_category() || is_archive() || is_search() || is_author()) {
         echo '<div class="current_posts_info">';
         if (is_search()) {
             printf('%s <strong>"%s"</strong>', __('Search results for', 'pagelines'), get_search_query());
         } elseif (is_category()) {
             printf('%s <strong>"%s"</strong>', __('Currently viewing the category:', 'pagelines'), single_cat_title(false, false));
         } elseif (is_tag()) {
             printf('%s <strong>"%s"</strong>', __('Currently viewing the tag:', 'pagelines'), single_tag_title(false, false));
         } elseif (is_archive()) {
             if (is_author()) {
                 global $author;
                 global $author_name;
                 $curauth = isset($_GET['author_name']) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
                 printf('%s <strong>"%s"</strong>', __('Posts by:', 'pagelines'), $curauth->display_name);
             } elseif (is_day()) {
                 printf('%s <strong>"%s"</strong>', __('From the daily archives:', 'pagelines'), get_the_time('l, F j, Y'));
             } elseif (is_month()) {
                 printf('%s <strong>"%s"</strong>', __('From the monthly archives:', 'pagelines'), get_the_time('F Y'));
             } elseif (is_year()) {
                 printf('%s <strong>"%s"</strong>', __('From the yearly archives:', 'pagelines'), get_the_time('Y'));
             } else {
                 if (is_post_type_archive()) {
                     $title = post_type_archive_title(null, false);
                 }
                 if (!isset($title)) {
                     $o = get_queried_object();
                     if (isset($o->name)) {
                         $title = $o->name;
                     }
                 }
                 if (!isset($title)) {
                     $title = the_date();
                 }
                 printf('%s <strong>"%s"</strong>', __('Viewing archives for ', 'pagelines'), $title);
             }
         }
         echo '</div>';
     }
 }
コード例 #17
0
   function section_template() { 	
	
		if(is_category() || is_archive() || is_search()):
		
		?>
		
			<div class="current_posts_info">
				<?php if(is_search()):?>
					<?php _e("Search results for ", 'pagelines');?> 
					<strong>"<?php the_search_query();?>"</strong>
				<?php elseif(is_category()):?>
					<?php _e("Currently viewing the category: ", 'pagelines');?> 
					<strong>"<?php single_cat_title();?>"</strong>
				<?php elseif(is_tag()):?>
					<?php _e("Currently viewing the tag: ", 'pagelines');?>
					<strong>"<?php single_tag_title(''); ?>"</strong>
				<?php elseif(is_archive()):?>
					<?php if (is_author()) { 
						global $author;
						global $author_name;
						$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
						_e('Posts by:', 'pagelines'); ?>
						<strong><?php echo $curauth->display_name; ?></strong>
					<?php } elseif (is_day()) {	?>
					 	<?php _e('From the daily archives:', 'pagelines'); ?>
						<strong><?php the_time('l, F j, Y'); ?></strong>
					<?php } elseif (is_month()) { ?>
						<?php _e('From the monthly archives:', 'pagelines'); ?>
						<strong><?php the_time('F Y'); ?></strong>
					<?php } elseif (is_year()) { ?>
						<?php _e('From the yearly archives:', 'pagelines'); ?>
						<strong><?php the_time('Y'); ?></strong>
					<?php } else {?> 
						<?php _e("Viewing archives for ", 'pagelines');?>
						<strong>"<?php the_date();?>"</strong>
					<?php } ?>
				<?php endif;?>
			</div>
		<?php endif;
	}
コード例 #18
0
    function wpex_copyright()
    {
        $copy = get_theme_mod('wpex_copyright', 'Powered by <a href=\\"http://www.wordpress.org\\" title="WordPress" target="_blank">WordPress</a> and <a href=\\"http://themeforest.net/user/WPExplorer?ref=WPExplorer" target="_blank" title="WPExplorer" rel="nofollow">WPExplorer Themes</a>');
        $year = the_date('Y', $before = '', $after = '', $echo = FALSE);
        $year = intval($year) + 1;
        $patron = '[year]';
        $copy = str_replace($patron, $year, $copy);
        ?>

        <?php 
        // Display custom copyright
        if ($copy) {
            echo do_shortcode($copy);
            ?>
            <?php 
            // Copyright fallback
        } else {
            ?>
            &copy; <?php 
            _e('Copyright', 'wpex');
            ?>
 <?php 
            the_date('Y');
            ?>
 &middot; <a href="<?php 
            echo home_url();
            ?>
" title="<?php 
            bloginfo('name');
            ?>
"><?php 
            bloginfo('name');
            ?>
</a>
        <?php 
        }
        ?>

        <?php 
    }
コード例 #19
0
    function sf_post_detail_heading()
    {
        global $post;
        ?>
            <header class="article-heading hidden-hatom">
                <div class="container">
                    <div class="entry-title" itemprop="name"><?php 
        the_title();
        ?>
</div>
                    <span class="date updated"><?php 
        the_date();
        ?>
</span>
                    <span class="vcard author">
                    	<span class="fn"><?php 
        the_author_meta('display_name');
        ?>
</span>
                    </span>
                </div>
            </header>
        <?php 
    }
コード例 #20
0
ks_header();
global $ks_settings;
if (have_posts()) {
    the_post();
    if (!ks_is_comments()) {
        ?>
		<div<?php 
        echo $ks_settings['h2_style'];
        ?>
><h2><?php 
        the_title();
        ?>
</h2></div>
		<?php 
        the_date('', '<div align="center"><font color="' . $ks_settings['date_color'] . '">', '</font></div>');
        ?>
		<div align="right"><img localsrc="68" alt="" /><font color="<?php 
        echo $ks_settings['author_color'];
        ?>
"><?php 
        the_author();
        ?>
</font>
		<img localsrc="46" alt=" @ " /><font color="<?php 
        echo $ks_settings['author_color'];
        ?>
"><?php 
        the_time();
        ?>
</font></div>
コード例 #21
0
</figure>
                        <h4 rel="author"><a target="_blank" title="Google Plus de <?php 
        echo get_the_author();
        ?>
" href="<?php 
        the_author_meta('google_plus');
        ?>
?rel=author" itemprop="contact"> de <span itemprop="name"><?php 
        echo get_the_author();
        ?>
</span></a></h4>
                        <time datetime="<?php 
        the_time('Y/m/d g:i:s A');
        ?>
" pubdate><?php 
        the_date('j F Y');
        ?>
</time>
                    </aside>
                    <?php 
        echo excerpt_count(160);
        ?>
                </article>
            <?php 
    }
    ?>
            <?php 
} else {
    ?>
            <h3 class="section_title">No hay contenido en <?php 
    echo single_tag_title('', false);
コード例 #22
0
ファイル: content-blog-tiles.php プロジェクト: jrartd/trihu
" rel="bookmark">

		<div class="entry-meta">
			<?php 
            $category = get_the_category();
            echo '<h3>' . $category[0]->cat_name . '</h3>';
            if (has_post_format()) {
                echo get_post_format_string(get_post_format());
            }
            ?>

		<span><time datetime="<?php 
            the_time('Y-m-d');
            ?>
"><?php 
            the_date('j F Y', '<br />', '<br />');
            ?>
</time></span>

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

		<h1 class="entry-title"><?php 
            the_title();
            ?>
</h1>

	</a><!-- .tile-content -->

	</article><!-- #post-<?php 
            the_ID();
            ?>
コード例 #23
0
ファイル: single.php プロジェクト: ViewFromTheBox/Fotographia
    						</span>
						</div>
					<?php 
        } else {
            ?>
						<div class="single-header">
							<h1 class="single-title" itemprop="headline"><?php 
            the_title();
            ?>
</h1>
							<h3 class="single-meta"><?php 
            _e('Written By: ', 'fotographia');
            the_author_posts_link();
            ?>
 &bull; <?php 
            the_date(get_option('date_format'));
            ?>
</h3>
						</div>
					<?php 
        }
        ?>
				<?php 
    }
}
?>
				<div id="inner-content" class="row">
					<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
コード例 #24
0
ファイル: single.php プロジェクト: slaFFik/l10n-ru
the_title();
?>
</h2>
				<div class="entry-content">
<?php 
the_content('<span class="more-link">' . __('Read More', 'veryplaintxt') . '</span>');
?>

<?php 
link_pages('<div class="page-link">' . __('Pages: ', 'veryplaintxt'), "</div>\n", 'number');
?>
				</div>

				<div class="entry-meta">
					<?php 
printf(__('This was written by %1$s. Posted on <abbr class="published" title="%2$s">%3$s at %4$s</abbr>. Filed under %5$s. %6$sBookmark the <a href="%7$s" title="Permalink to %8$s" rel="bookmark">permalink</a>. Follow comments here with the <a href="%9$s" title="Comments RSS to %8$s" rel="alternate" type="application/rss+xml">RSS feed</a>.', 'veryplaintxt'), '<span class="vcard"><span class="fn n">' . $authordata->display_name . '</span></span>', get_the_time('Y-m-d\\TH:i:sO'), the_date('l, F j, Y,', '', '', false), get_the_time(), get_the_category_list(', '), get_the_tag_list('Tagged ', ', ', '. '), get_permalink(), wp_specialchars(get_the_title(), 'double'), comments_rss());
if ('open' == $post->comment_status && 'open' == $post->ping_status) {
    ?>
					<?php 
    printf(__('<a href="#respond" title="Post a comment">Post a comment</a> or leave a <a href="%s" rel="trackback" title="Trackback URL for your post">trackback</a>.', 'veryplaintxt'), get_trackback_url());
} elseif (!('open' == $post->comment_status) && 'open' == $post->ping_status) {
    ?>
					<?php 
    printf(__('Comments are closed, but you can leave a <a href="%s" rel="trackback" title="Trackback URL for your post">trackback</a>.', 'veryplaintxt'), get_trackback_url());
} elseif ('open' == $post->comment_status && !('open' == $post->ping_status)) {
    ?>
					<?php 
    printf(__('Trackbacks are closed, but you can <a href="#respond" title="Post a comment">post a comment</a>.', 'veryplaintxt'));
} elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
    ?>
					<?php 
コード例 #25
0
ファイル: single.php プロジェクト: kevinchin34/WP-Sandbox
    $title = get_the_title();
    $upper_title = strtoupper($title);
    ?>

	<div class="container bg-shadow">
		<div class="row">
			<div class="col-sm-9">
				<div class="post-meta">
					<h2><?php 
    echo $upper_title;
    ?>
</h2>
					<div class="post-meta-bar cf">
						<div class="post-meta-date">
							<?php 
    the_date('', 'Posted on: <span class="glyphicon glyphicon-calendar"></span> <i>', '</i>');
    ?>
						</div>

						<div class="post-meta-cat">
							<?php 
    the_breadcrumbs();
    // $categories = get_the_category_list(', ');
    // //var_dump($categories);
    // echo  'Posted under: ' . '<i>' . $categories . '</i>';
    ?>
						</div>
					</div>

				</div>
				<?php 
コード例 #26
0
ファイル: search.php プロジェクト: besimhu/legacy
        ?>
">		
				<h3 class="search-title"><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        printf(__('Permalink to %s', 'pandora'), the_title_attribute('echo=0'));
        ?>
" rel="bookmark"><?php 
        the_title();
        ?>
</a></h3>
				<div id="entry-content-container">
					<?php 
        unset($previousday);
        printf(__('%1$s &#8211; %2$s', 'pandora'), the_date('', '', '', false), get_the_time());
        ?>
				</div>
				
				<?php 
        if ($post->post_type == 'post') {
            ?>
					<div id="entry-content-container">
						<?php 
            printf(__('By %s', 'pandora'), '<a class="url fn n" href="' . get_author_posts_url(get_the_author_meta('ID')) . '" title="' . sprintf(__('View all posts by %s', 'pandora'), $authordata->display_name) . '">' . get_the_author() . '</a>');
            ?>
						| <?php 
            printf(__('Posted in %s', 'pandora'), get_the_category_list(', '));
            ?>
						| <?php 
            comments_popup_link(__('Comments (0)', 'pandora'), __('Comments (1)', 'pandora'), __('Comments (%)', 'pandora'));
コード例 #27
0
ファイル: tag.php プロジェクト: viralss/sunglow-solution
			</div>

			<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

				<div class="row">



					<div class="date">

						<?php 
        echo str_replace(',', '</strong><br />', the_date('M,Y', '<p><strong>', '</p>', FALSE));
        ?>

					</div>



					<div class="project-title">

						<a href="<?php 
        the_permalink();
        ?>
"><h2><?php 
        the_title();
        ?>
</h2></a>
コード例 #28
0
        the_ID();
        ?>
" <?php 
        post_class('clearfix');
        ?>
 role="article">
				<section class="clearfix mb_80">
					<div class="container container620">
						<div class="row">
							<div class="blog_title text_indent col-sm-12 mb_25 clearfix">
								<h3 class="nomargin"><?php 
        the_title();
        ?>
</h3>
								<div class="blog_date"><?php 
        the_date('d.m.Y');
        ?>
, <?php 
        the_time();
        ?>
</div>
							</div>
							<div class="text_big col-sm-12 clearfix"><?php 
        the_excerpt();
        ?>
</div>	
							<div class="col-sm-12 text_indent blog_meta">
								<a class="more_info" href="<?php 
        the_permalink();
        ?>
">read more</a>
コード例 #29
0
ファイル: page.php プロジェクト: kunstudios/CuratedWellnes
if (have_posts()) {
    ?>
			<?php 
    while (have_posts()) {
        the_post();
        ?>
				<div class = "blogCopy clearfix">
					<a href="<?php 
        echo get_permalink();
        ?>
"><?php 
        the_title('<h3>', '</h3>');
        ?>
 </a>
					<p class="blogDate"><?php 
        the_date();
        ?>
 <em> in </em> <em><?php 
        the_category(' ');
        ?>
</em></p>
					<?php 
        the_excerpt();
        ?>
				</div>
			<?php 
    }
    ?>
			<?php 
} else {
    ?>
コード例 #30
0
ファイル: content.php プロジェクト: sbogdanov108/article_wp
/**
 * Created by PhpStorm.
 * User: sergey
 * Date: 23.01.16
 * Time: 15:07
 */
?>
<div class="blog-post">
  <h2 class="blog-post-title">
    <?php 
the_title();
?>
  </h2>
  <p class="blog-post-meta">
    <?php 
the_date('F d, Y');
?>
 &mdash; <a href="#"><?php 
the_author();
?>
</a>
  </p>

  <?php 
$content = get_the_content();
?>
  <?php 
if (is_single()) {
    ?>
    <?php 
    the_content();