/**
  * 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;
     }
 }
function kbe_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, 'kbe_taxonomy', ' ', ', ', '');
            break;
        case "tag":
            echo get_the_term_list($post->ID, 'kbe_tags', ' ', ', ', '');
            break;
        case "comment":
            comments_number(__('No Comments', 'kbe'), __('1 Comment', 'kbe'), __('% Comments', 'kbe'));
            break;
        case "views":
            $views = get_post_meta($post->ID, 'kbe_post_views_count', true);
            if ($views) {
                echo $views . __(' Views', 'kbe');
            } else {
                echo __('No Views', 'kbe');
            }
            break;
        case "date":
            the_date();
            break;
    }
}
예제 #3
0
/**
 * Display common postmeta information. The parent theme originally showed
 * date, author, and a comment link.
 */
function webonary_zeedisplay_display_entry_header()
{
    $options = get_option('themezee_options');
    if (isset($options['themeZee_blog_mode']) and $options['themeZee_blog_mode'] == BLOG_MODE) {
        ?>
		<div class="postmeta">
			<span class="date"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_time(get_option('date_format'));
        ?>
</a></span>
			<span class="author"><?php 
        the_author();
        ?>
 </span>
			<span class="comment"><a href="<?php 
        the_permalink();
        ?>
#comments"><?php 
        comments_number(__('No comments', ZEE_LANG), __('One comment', ZEE_LANG), __('% comments', ZEE_LANG));
        ?>
</a></span>
		</div>
		<?php 
    }
}
예제 #4
0
    /**
     * Prints HTML with meta information for the current post-date/time and author.
     */
    function shapely_posted_on_no_cat()
    {
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        if (get_the_time('U') !== get_the_modified_time('U')) {
            $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><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()));
        ?>

		<ul class="post-meta">
		<li><span class="posted-on"><?php 
        echo $time_string;
        ?>
</span></li>
		<li><span><?php 
        echo esc_html__('by', 'shapely');
        ?>
 <a
					href="<?php 
        echo esc_url(get_author_posts_url(get_the_author_meta('ID')));
        ?>
"
					title="<?php 
        echo esc_attr(get_the_author());
        ?>
"><?php 
        esc_html(the_author());
        ?>
</a></span>
		</li>
		</ul><?php 
    }
    function rambo_post_meta_content()
    {
        ?>
<div class="blog_section2_comment">
    <a href="<?php 
        the_permalink();
        ?>
"><i class="fa fa-calendar icon-spacing"></i><?php 
        the_time(get_option('date_format'));
        ?>
</a>
    <a href="<?php 
        the_permalink();
        ?>
"><i class="fa fa-comments icon-spacing"></i><?php 
        comments_popup_link(__('leave a comment', 'rambo'));
        ?>
</a>
    <a href="<?php 
        echo get_author_posts_url(get_the_author_meta('ID'));
        ?>
"><i class="fa fa-user icon-spacing"></i> <?php 
        _e("By", 'rambo');
        ?>
&nbsp;<?php 
        the_author();
        ?>
</a>
</div>
<?php 
    }
    /**
     * Generates an individual listing for a commit object
     *
     * @param $commit - The commit object to display
     */
    public static function draw_commit_listing($commit)
    {
        ?>
		<div>
			<div>
				<strong>
					<a href="<?php 
        echo admin_url('/edit.php?post_type=acf-commit');
        ?>
">
						<?php 
        echo get_the_date('M d, Y H:i a', $commit->ID);
        ?>
					</a>
				</strong>
			</div>
			<div><em><?php 
        echo get_field('commit_message', $commit->ID);
        ?>
</em></div>
			<div>Author: <?php 
        the_author();
        ?>
</div>
			<hr/>
		</div>
		<?php 
    }
예제 #7
0
 function cpotheme_page_title()
 {
     global $post;
     if (isset($post->ID)) {
         $current_id = $post->ID;
     } else {
         $current_id = false;
     }
     $title_tag = function_exists('is_woocommerce') && is_woocommerce() && is_singular('product') ? 'span' : 'h1';
     echo '<' . $title_tag . ' class="pagetitle-title heading">';
     if (function_exists('is_woocommerce') && is_woocommerce()) {
         woocommerce_page_title();
     } elseif (is_category() || is_tag() || is_tax()) {
         echo single_tag_title('', true);
     } elseif (is_author()) {
         the_author();
     } elseif (is_date()) {
         _e('Archive', 'brilliance');
     } elseif (is_404()) {
         echo __('Page Not Found', 'brilliance');
     } elseif (is_search()) {
         echo __('Search Results for', 'brilliance') . ' "' . get_search_query() . '"';
     } else {
         echo get_the_title($current_id);
     }
     echo '</' . $title_tag . '>';
 }
    function ro_theme_author_render()
    {
        ob_start();
        ?>
		<?php 
        if (is_sticky() && is_home() && !is_paged()) {
            ?>
			<span class="featured-post"> <?php 
            _e('Sticky', 'robusta');
            ?>
</span>
		<?php 
        }
        ?>
		<div class="ro-about-author clearfix">
			<div class="ro-author-avatar"><?php 
        echo get_avatar(get_the_author_meta('ID'), 170);
        ?>
</div>
			<div class="ro-author-info">
				<h6 class="ro-name"><?php 
        the_author();
        ?>
</h6>
				<?php 
        the_author_meta('description');
        ?>
			</div>
		</div>
		<?php 
        return ob_get_clean();
    }
예제 #9
0
function php_exec_process($phpexec_text)
{
    $phpexec_userdata = get_userdatabylogin(the_author('login', false));
    if ($phpexec_userdata->user_level >= php_exec_getuserlevel()) {
        $phpexec_doeval = true;
    }
    $phpexec_textarr = preg_split("/(<phpcode>.*<\\/phpcode>)/Us", $phpexec_text, -1, PREG_SPLIT_DELIM_CAPTURE);
    // capture the tags as well as in between
    $phpexec_stop = count($phpexec_textarr);
    // loop stuff
    for ($phpexec_i = 0; $phpexec_i < $phpexec_stop; $phpexec_i++) {
        $phpexec_content = $phpexec_textarr[$phpexec_i];
        if (preg_match("/^<phpcode>(.*)<\\/phpcode>/Us", $phpexec_content, $phpexec_code)) {
            // If it's a phpcode
            $phpexec_php = $phpexec_code[1];
            if ($phpexec_doeval) {
                ob_start();
                eval("?>" . $phpexec_php . "<?php ");
                $phpexec_output .= ob_get_clean();
            } else {
                $phpexec_output .= htmlspecialchars($phpexec_php);
            }
        } else {
            $phpexec_output .= $phpexec_content;
        }
    }
    return $phpexec_output;
}
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;
}
    function widget($args, $instance)
    {
        extract($args);
        //$options = get_option('custom_recent');
        $title = $instance['title'];
        $postscount = $instance['posts'];
        //GET the posts
        global $postcount;
        $myposts = get_posts(array('orderby' => 'comment_count', 'numberposts' => $postscount));
        //SHOW the posts
        ?>
        <div class = "sidebar-box">
            <div class="sidebar-box">
                <h4><?php 
        echo $before_widget . $before_title . $title . $after_title;
        ?>
</h4>
                <div class="sidebar-b">               
                    <?php 
        foreach ($myposts as $post) {
            setup_postdata($post);
            $feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
            ?>
                        <div class="sidebar-poppost">
                            <div class="sidebar-poppostimg"><img src="<?php 
            echo $feat_image;
            ?>
" alt="" class="img-responsive2"></div>
                            <div class="sidebar-popposttitle">
                                <a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a>
                                <span>By <?php 
            the_author();
            ?>
 on <?php 
            the_time('F j, Y');
            ?>
</span>
                            </div>
                        </div>

            <?php 
        }
        echo $after_widget;
        ?>



                </div>
            </div>
        </div>
        <?php 
    }
예제 #12
0
function set_facebook_meta_tags()
{
    if (is_single()) {
        ?>
		<!-- Open Graph Meta Tags for Facebook and LinkedIn Sharing !-->
		<!-- HEY THIS PLUGIN WORKED -->
		<meta property="og:title" content="<?php 
        the_title();
        ?>
"/>
		<meta property="og:description" content="<?php 
        echo strip_tags(get_the_excerpt($post->ID));
        ?>
" />
		<meta property="og:url" content="<?php 
        the_permalink();
        ?>
"/>
		<?php 
        $fb_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'fb-image');
        ?>
		<?php 
        if ($fb_image) {
            ?>
			<meta property="og:image" content="<?php 
            echo $fb_image[0];
            ?>
" />
			<?php 
        }
        ?>
		<meta property="og:type" content="<?php 
        if (is_single() || is_page()) {
            echo "article";
        } else {
            echo "website";
        }
        ?>
"
		/>
		<meta property="og:site_name" content="<?php 
        bloginfo('name');
        ?>
"/>
		<meta property="og:author" content="<?php 
        if (coauthors() == "") {
            the_author();
        } elseif (coauthors() != "") {
            coauthors();
        } else {
            echo "";
        }
        ?>
"/>
		<!-- End Open Graph Meta Tags !-->
		<?php 
    }
}
예제 #13
0
    function widget($args, $instance)
    {
        global $post;
        $query_args = array('posts_per_page' => 5, 'meta_key' => 'luot_xem', 'order' => 'DESC', 'orderby' => 'meta_value_num');
        $query = new WP_Query($query_args);
        ?>
        <?php 
        echo $args['before_widget'];
        ?>
        <?php 
        echo $args['before_title'] . 'Top 5' . $args['after_title'];
        ?>
        <ul>
            <?php 
        foreach ($query->get_posts() as $post) {
            setup_postdata($post);
            ?>

                <li>
                    <a href="<?php 
            the_permalink();
            ?>
">
                        <?php 
            the_post_thumbnail(array(90, 60), array("class" => "posts-widget-featured-image alignleft", "style" => "margin-right: 5px "));
            ?>
                    </a>
                    <a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a>

                    <div class="posts-widget-meta">
                        <?php 
            print 'Lượt xem: ' . get_post_meta(get_the_ID(), 'luot_xem', true) . ' ,Bởi: ';
            the_author();
            ?>
                    </div>
                    <div class="posts-widget-entry">
                        <?php 
            echo limit_post_word(get_the_content(), 30);
            ?>
                    </div>
                    <div style="clear: left"></div>
                </li>


            <?php 
        }
        wp_reset_postdata();
        ?>
        </ul>
        <?php 
        echo $args['after_widget'];
    }
예제 #14
0
/**
 * @desc Output of  the Author
 * @author Georg Leciejewski
 */
function c_widget_author($args, $number = 1)
{
    $options = get_option('c_widget_author');
    $before_widget = stripslashes($options[$number]['before_widget']);
    $after_widget = stripslashes($options[$number]['after_widget']);
    echo $before_widget . "\n";
    the_author();
    echo $after_widget . "\n";
}
function rb_portfolio_add_authors()
{
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (is_plugin_active('co-authors-plus/co-authors-plus.php')) {
        coauthors(', ', ' and ', '<span class="portfolio-authors">', '</span>');
    } else {
        the_author();
    }
}
예제 #16
0
function hsinsider_get_coauthors()
{
    if (function_exists('coauthors')) {
        $coauthors = coauthors_posts_links(null, null, null, null, false);
    } else {
        $coauthors = the_author();
    }
    return $coauthors;
}
예제 #17
0
function nm_home_tabs($cats, $width = 463, $height = 210)
{
    $cats = explode(',', $cats);
    $cat = get_category_by_slug($cats[0]);
    $cat = get_category($cat->category_parent);
    echo '<div id="tab-instance-' . $cat->slug . '" class="tabs" style="width: ' . $width . 'px;"><ul class="tabs-nav">';
    $class = ' class="tabs-nav-active"';
    //Generate the nav from the cats
    foreach ($cats as $cat) {
        $cat = get_category_by_slug($cat);
        echo '<li><a id="a-' . $cat->slug . '"' . $class . ' href="javascript:show_home_tab(\'a-' . $cat->slug . '\')">' . $cat->name . '</a></li>';
        $class = '';
    }
    echo '</ul><div class="tabs-content" style="height: ' . $height . 'px;">';
    foreach ($cats as $cat) {
        echo '<ul id="ul-' . $cat . '" class="tabs-content-ul">';
        //Check if is older then 3 days, if is then order by rand
        $orderby = '';
        query_posts('showposts=1&category_name=' . $cat);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $older = date('YMD');
                $days_since = floor((date('U') - get_the_time('U')) / 86400);
                if ($days_since >= 4) {
                    $orderby = '&orderby=rand';
                }
            }
        }
        query_posts('showposts=5&category_name=' . $cat . $orderby);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                global $post;
                echo '<li class="tabs-content-item">
					<h4><a href="' . get_permalink() . '">' . $post->post_title . '</a></h4>' . '<a href="' . get_permalink() . '">' . article_image($post->ID, 'small', true) . '</a>';
                echo '<p>';
                wswwpx_content_extract('', '15', '15', 2, '', '', TRUE, FALSE);
                echo '</p>';
                echo '<p class="tabs-content-meta">';
                echo '<a href="' . get_permalink() . '">';
                comments_number('No Comments', '1 Comment', '% Comments');
                echo '</a> | Posted: ';
                the_time('l, F jS, Y');
                echo ' | By: <a href="' . getProfileLink($post->post_author) . '">';
                the_author();
                echo '</a>';
                echo '</p>';
                echo '</li>';
            }
        }
        echo '</ul>';
    }
    echo '</div>
		</div>';
}
예제 #18
0
function ace_post_author()
{
    if (get_option('ace_blog_author')) {
        echo ' <span class="vcard author post-author" itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person">';
        echo _e('by', 'ace');
        echo ' <span class="fn" itemprop="name">';
        the_author();
        echo '</span></span>';
    }
}
function aps_news_author()
{
    $id = get_the_author_meta('ID');
    $link = bp_core_get_user_domain($id);
    if (isset($link)) {
        echo '<a href="' . $link . '">' . get_the_author() . '</a>';
    } else {
        the_author();
    }
}
예제 #20
0
function wcr_author_loop()
{
    $args = array('author' => get_the_author_meta('ID'), 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => '10');
    $loop = new WP_Query($args);
    if ($loop->have_posts()) {
        // loop through posts
        while ($loop->have_posts()) {
            $loop->the_post();
            ?>

			<article class="entry" itemprop="blogPost" itemtype="http://schema.org/BlogPosting" itemscope="itemscope">
                <header class="entry-header"> 
                <a href="<?php 
            echo get_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
">
                <h1 itemprop="headline">  <?php 
            the_title();
            ?>
 </h1>
                </a>
                <p class="entry-meta">

				<?php 
            the_time('l, F jS, Y');
            echo ' by ';
            the_author();
            ?>


                </header>
                    <div class="author-blog entry-content">
                  <?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('medium');
            }
            ?>
                  <?php 
            the_excerpt();
            ?>
                    </div>
                <footer>
                Categories: <?php 
            the_category(', ');
            ?>
                </footer>
            </article>
<?php 
        }
    }
    wp_reset_postdata();
}
예제 #21
0
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;
}
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;
}
예제 #23
0
function more_post_ajax()
{
    $offset = $_POST["offset"];
    $ppp = $_POST["ppp"];
    header("Content-Type: text/html");
    $args = array('post_type' => 'post', 'posts_per_page' => $ppp, 'offset' => $offset);
    $loop = new WP_Query($args);
    while ($loop->have_posts()) {
        $loop->the_post();
        ?>
    <div class="post">
		<a href="<?php 
        echo get_permalink();
        ?>
">
			<div class="img">
				<img src="<?php 
        echo wp_get_attachment_url(get_post_thumbnail_id($post->ID));
        ?>
" alt="">
			</div>
			<div class="post-overlay">
				<h2 class="post-title"> <?php 
        the_title();
        ?>
 </h2>
				<p class="post-author">By <?php 
        the_author();
        ?>
 - <?php 
        echo get_the_date();
        ?>
</p>
				<p class="post-excerpt"><?php 
        echo get_the_excerpt();
        ?>
</p>
				<a href="<?php 
        echo get_permalink();
        ?>
" class="read-more">Read More</a>
			</div>
		</a>
	</div>
	<?php 
    }
    exit;
}
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;
    }
}
예제 #25
0
    $prevpage = $currentpage - 1;
    echo '<link rel="previous" href="' . get_bloginfo('url') . $category_name . '/feed/atom?paged=' . $prevpage . '" ></link>' . "\n";
}
if ($currentpage != $total_pages) {
    $nextpage = $currentpage + 1;
    echo '<link rel ="next" href="' . get_bloginfo('url') . $category_name . '/feed/atom?paged=' . $nextpage . '" ></link>' . "\n";
    echo '<link rel ="last" href="' . get_bloginfo('url') . $category_name . '/feed/atom?paged=' . $total_pages . '" ></link>' . "\n";
}
do_action('atom_head');
while (have_posts()) {
    the_post();
    ?>
	<entry>
		<author>
			<name><?php 
    the_author();
    ?>
</name>
			<?php 
    $author_url = get_the_author_meta('url');
    if (!empty($author_url)) {
        ?>
			<uri><?php 
        the_author_meta('url');
        ?>
</uri>
			<?php 
    }
    do_action('atom_author');
    ?>
		</author>
예제 #26
0
function dsq_export_wp()
{
    global $wpdb, $posts, $post, $wp_version;
    global $dsq_api;
    $filename = dsq_get_temp_dir() . 'disqus-wordpress.' . date('Y-m-d') . '.xml';
    $fp = fopen($filename, 'w');
    ob_start();
    $where = '';
    if (isset($_GET['author']) && $_GET['author'] != 'all') {
        $author_id = (int) $_GET['author'];
        $where = " WHERE post_author = '{$author_id}' ";
    }
    $posts = $wpdb->get_results("SELECT * FROM {$wpdb->posts} {$where} ORDER BY post_date_gmt ASC");
    function wxr_site_url()
    {
        global $current_site;
        // mu: the base url
        if (isset($current_site->domain)) {
            return 'http://' . $current_site->domain . $current_site->path;
        } else {
            return get_bloginfo_rss('url');
        }
    }
    function wxr_cdata($str)
    {
        if (seems_utf8($str) == false) {
            $str = utf8_encode($str);
        }
        // $str = ent2ncr(wp_specialchars($str));
        $str = "<![CDATA[{$str}" . (substr($str, -1) == ']' ? ' ' : '') . "]]>";
        return $str;
    }
    function wxr_cat_name($c)
    {
        if (empty($c->cat_name)) {
            return;
        }
        echo '<wp:cat_name>' . wxr_cdata($c->cat_name) . '</wp:cat_name>';
    }
    function wxr_category_description($c)
    {
        if (empty($c->category_description)) {
            return;
        }
        echo '<wp:category_description>' . wxr_cdata($c->category_description) . '</wp:category_description>';
    }
    print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
    ?>

	<!--
		This is a WordPress eXtended RSS file generated by WordPress as an export of
		your blog. It contains information about your blog's posts, comments, and
		categories. You may use this file to transfer that content from one site to
		another. This file is not intended to serve as a complete backup of your
		blog.

		To import this information into a WordPress blog follow these steps:

		1.	Log into that blog as an administrator.
		2.	Go to Manage > Import in the blog's admin.
		3.	Choose "WordPress" from the list of importers.
		4.	Upload this file using the form provided on that page.
		5.	You will first be asked to map the authors in this export file to users
			on the blog. For each author, you may choose to map an existing user on
			the blog or to create a new user.
		6.	WordPress will then import each of the posts, comments, and categories
			contained in this file onto your blog.
	-->

	<!-- generator="wordpress/<?php 
    bloginfo_rss('version');
    ?>
" created="<?php 
    echo date('Y-m-d H:i');
    ?>
"-->
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:wp="http://wordpress.org/export/<?php 
    echo WXR_VERSION;
    ?>
/"
	>

	<channel>
		<title><?php 
    bloginfo_rss('name');
    ?>
</title>
		<link><?php 
    bloginfo_rss('url');
    ?>
</link>
		<description><?php 
    bloginfo_rss("description");
    ?>
</description>
		<pubDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
    ?>
</pubDate>
		<generator>http://wordpress.org/?v=<?php 
    bloginfo_rss('version');
    ?>
</generator>
		<language><?php 
    echo get_option('rss_language');
    ?>
</language>
		<wp:wxr_version><?php 
    echo WXR_VERSION;
    ?>
</wp:wxr_version>
		<wp:base_site_url><?php 
    echo wxr_site_url();
    ?>
</wp:base_site_url>
		<wp:base_blog_url><?php 
    bloginfo_rss('url');
    ?>
</wp:base_blog_url>

	<?php 
    $contents = ob_get_clean();
    fwrite($fp, $contents);
    ?>

	<?php 
    if ($cats) {
        foreach ($cats as $c) {
            ?>
	<?php 
            ob_start();
            ?>
		<wp:category><wp:category_nicename><?php 
            echo $c->category_nicename;
            ?>
</wp:category_nicename><wp:category_parent><?php 
            echo $c->category_parent ? $cats[$c->category_parent]->cat_name : '';
            ?>
</wp:category_parent><wp:posts_private><?php 
            echo $c->posts_private ? '1' : '0';
            ?>
</wp:posts_private><wp:links_private><?php 
            echo $c->links_private ? '1' : '0';
            ?>
</wp:links_private><?php 
            wxr_cat_name($c);
            wxr_category_description($c);
            ?>
</wp:category>
	<?php 
            $contents = ob_get_clean();
            fwrite($fp, $contents);
            ?>
	<?php 
        }
    }
    ?>
		<?php 
    do_action('rss2_head');
    ?>
		<?php 
    if ($posts) {
        foreach ($posts as $post) {
            ob_start();
            start_wp();
            ?>
	<item>
	<title><?php 
            the_title_rss();
            ?>
</title>
	<link><?php 
            permalink_single_rss();
            ?>
</link>
	<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
            ?>
</pubDate>
	<dc:creator><?php 
            the_author();
            ?>
</dc:creator>
	<?php 
            the_category_rss();
            ?>

	<guid isPermaLink="false"><?php 
            the_guid();
            ?>
</guid>
	<description></description>
	<content:encoded><![CDATA[<?php 
            echo $post->post_content;
            ?>
]]></content:encoded>
	<wp:post_id><?php 
            echo $post->ID;
            ?>
</wp:post_id>
	<wp:post_date><?php 
            echo $post->post_date;
            ?>
</wp:post_date>
	<wp:post_date_gmt><?php 
            echo $post->post_date_gmt;
            ?>
</wp:post_date_gmt>
	<wp:comment_status><?php 
            echo $post->comment_status;
            ?>
</wp:comment_status>
	<wp:ping_status><?php 
            echo $post->ping_status;
            ?>
</wp:ping_status>
	<wp:post_name><?php 
            echo $post->post_name;
            ?>
</wp:post_name>
	<wp:status><?php 
            echo $post->post_status;
            ?>
</wp:status>
	<wp:post_parent><?php 
            echo $post->post_parent;
            ?>
</wp:post_parent>
	<wp:menu_order><?php 
            echo $post->menu_order;
            ?>
</wp:menu_order>
	<wp:post_type><?php 
            echo $post->post_type;
            ?>
</wp:post_type>
	<?php 
            $postmeta = $wpdb->get_results("SELECT * FROM {$wpdb->postmeta} WHERE post_id = {$post->ID}");
            if ($postmeta) {
                ?>
	<?php 
                foreach ($postmeta as $meta) {
                    ?>
	<wp:postmeta>
	<wp:meta_key><?php 
                    echo $meta->meta_key;
                    ?>
</wp:meta_key>
	<wp:meta_value><?php 
                    echo $meta->meta_value;
                    ?>
</wp:meta_value>
	</wp:postmeta>
	<?php 
                }
                ?>
	<?php 
            }
            ?>
	<?php 
            $contents = ob_get_clean();
            fwrite($fp, $contents);
            ?>
	<?php 
            $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = {$post->ID} AND comment_agent NOT LIKE 'Disqus/%'");
            ob_start();
            if ($comments) {
                foreach ($comments as $c) {
                    ?>
	<wp:comment>
	<wp:comment_id><?php 
                    echo $c->comment_ID;
                    ?>
</wp:comment_id>
	<wp:comment_author><?php 
                    echo $c->comment_author;
                    ?>
</wp:comment_author>
	<wp:comment_author_email><?php 
                    echo $c->comment_author_email;
                    ?>
</wp:comment_author_email>
	<wp:comment_author_url><?php 
                    echo $c->comment_author_url;
                    ?>
</wp:comment_author_url>
	<wp:comment_author_IP><?php 
                    echo $c->comment_author_IP;
                    ?>
</wp:comment_author_IP>
	<wp:comment_date><?php 
                    echo $c->comment_date;
                    ?>
</wp:comment_date>
	<wp:comment_date_gmt><?php 
                    echo $c->comment_date_gmt;
                    ?>
</wp:comment_date_gmt>
	<wp:comment_content><?php 
                    echo $c->comment_content;
                    ?>
</wp:comment_content>
	<wp:comment_approved><?php 
                    echo $c->comment_approved;
                    ?>
</wp:comment_approved>
	<wp:comment_type><?php 
                    echo $c->comment_type;
                    ?>
</wp:comment_type>
	<wp:comment_parent><?php 
                    echo $c->comment_parent;
                    ?>
</wp:comment_parent>
	</wp:comment>
	<?php 
                }
            }
            ?>
		</item>
	<?php 
            $contents = ob_get_clean();
            fwrite($fp, $contents);
            ?>
	<?php 
        }
    }
    ?>
	<?php 
    ob_start();
    ?>
	</channel>
	</rss>
<?php 
    $contents = ob_get_clean();
    fwrite($fp, $contents);
    $response = $dsq_api->import_wordpress_comments($filename);
    $import_id = $response;
    unlink($filename);
    if ($response < 0) {
        dsq_manage_dialog("There was an error exporting your comments. If your API key has changed, you may need to reinstall DISQUS (deactivate the plugin and then reactivate it). If you are still having issues, refer to the <a href='http://disqus.com/comments/wordpress'>WordPress help page</a>.", true);
    } else {
        update_option('disqus_last_import_id', $import_id);
        dsq_manage_dialog('Your comments have been queued for importing to DISQUS. You may check the advanced options tab for a status update.');
    }
}
function page_rows($parent = 0, $level = 0, $pages = 0)
{
    global $wpdb, $class, $user_level, $post;
    if (!$pages) {
        $pages = $wpdb->get_results("SELECT * FROM {$wpdb->posts} WHERE post_status = 'static' ORDER BY menu_order");
    }
    if ($pages) {
        foreach ($pages as $post) {
            start_wp();
            if ($post->post_parent == $parent) {
                $post->post_title = wp_specialchars($post->post_title);
                $pad = str_repeat('&#8212; ', $level);
                $id = $post->ID;
                $class = 'alternate' == $class ? '' : 'alternate';
                ?>
<tr class='<?php 
                echo $class;
                ?>
'>
	<th scope="row"><?php 
                echo $post->ID;
                ?>
</th>
	<td>
	<?php 
                echo $pad;
                the_title();
                ?>
	</td>
	<td><?php 
                the_author();
                ?>
</td>
	<td><?php 
                echo mysql2date('Y-m-d g:i a', $post->post_modified);
                ?>
</td>
	<td><a href="<?php 
                the_permalink();
                ?>
" rel="permalink" class="edit"><?php 
                _e('View');
                ?>
</a></td>
	<td><?php 
                if ($user_level > $authordata->user_level or $user_login == $authordata->user_login) {
                    echo "<a href='post.php?action=edit&amp;post={$id}' class='edit'>" . __('Edit') . "</a>";
                }
                ?>
</td>
	<td><?php 
                if ($user_level > $authordata->user_level or $user_login == $authordata->user_login) {
                    echo "<a href='post.php?action=delete&amp;post={$id}' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \\'%s\\'\\n  \\'OK\\' to delete, \\'Cancel\\' to stop."), the_title('', '', 0)) . "')\">" . __('Delete') . "</a>";
                }
                ?>
</td>
</tr>

<?php 
                page_rows($id, $level + 1, $pages);
            }
        }
    } else {
        return false;
    }
}
    function widget($args, $instance)
    {
        extract($args);
        $title = $instance['title'];
        $postscount = $instance['posts'];
        echo $before_widget;
        // Before and after widget arguments are defined by themes
        if ($title) {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        ?>
		<ul class="widget-posts">
			<?php 
        /*
         * SHOW the posts
         */
        $args = array('posts_per_page' => $postscount, 'post_type' => 'post', 'orderby' => 'comment_count', 'ignore_sticky_posts' => 1, 'post_status' => 'publish');
        $pc = new WP_Query($args);
        while ($pc->have_posts()) {
            $pc->the_post();
            ?>
				<li class="clearfix">
					<div class="widget-posts-image">
						<a href="<?php 
            the_permalink();
            ?>
" target="_self">
							<?php 
            the_post_thumbnail('medium', array('class' => "img-responsive"));
            ?>
						</a>
					</div><!-- End .widget-posts-image -->
					<div class="widget-posts-body">
						<h6 class="widget-posts-title font-alt">
							<a href="<?php 
            the_permalink();
            ?>
" target="_self">
								<?php 
            the_title();
            ?>
							</a>
						</h6><!-- End .widget-posts-title -->
						<div class="widget-posts-meta">
							<?php 
            _e('By ', 'vestalite');
            ?>
							<?php 
            the_author();
            ?>
							<?php 
            echo ',&nbsp;';
            ?>
							<?php 
            echo the_time('M j');
            ?>
						</div><!-- End .widget-posts-meta -->
					</div><!-- End .widget-posts-body -->
				</li><!-- End .clearfix -->
			<?php 
        }
        ?>
		</ul>
		<?php 
        echo $after_widget;
    }
예제 #29
0
파일: index.php 프로젝트: nudgeD/Liquorice
<?php

  get_header();

  if (have_posts()): ?>
	
  <ol id="posts">
  <?php while (have_posts()) : the_post(); ?>

    <li id="post-<?php the_ID(); ?>" <?php post_class('postWrapper'); ?>>
   

      <h2 class="postTitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
      
      <p class="date"><small><?php the_time('F j, Y'); ?> by <?php the_author(); ?></small></p>
	
      <div class="post">
      <?php the_post_thumbnail(); ?>

	  <?php the_content(__('(more...)')); ?></div>
      <?php wp_link_pages('before=<p class="page-link">&after=</p>&next_or_number=number&pagelink=page %'); ?>
      <p class="postMeta">Category <?php the_category(', ') ?> | Tags: <?php the_tags(', '); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
	
      <hr class="noCss" />
    </li>

    <?php comments_template(); // Get wp-comments.php template ?>

    <?php endwhile; ?>

  </ol>
    /**
     * widget function.
     *
     * @see WP_Widget
     * @access public
     * @param array $args
     * @param array $instance
     * @return void
     */
    function widget($args, $instance)
    {
        if ($this->get_cached_widget($args)) {
            return;
        }
        $descriptor = isset($instance['descriptor']) ? esc_attr($instance['descriptor']) : false;
        $biography = isset($instance['biography']) && 1 == $instance['biography'] ? true : false;
        global $post;
        extract($args);
        ob_start();
        echo $before_widget;
        ?>

		<div class="job_listing-author">
			<div class="job_listing-author-avatar">
				<?php 
        echo get_avatar(get_the_author_meta('ID'), 210);
        ?>
			</div>

			<div class="job_listing-author-info">
				<?php 
        the_author();
        ?>

				<small class="job_listing-author-descriptor"><?php 
        echo $descriptor;
        ?>
</small>

				<?php 
        if ('preview' != $post->post_status) {
            ?>
				<div class="job_listing-author-info-more">
					<a href="#job_listing-author-apply" data-mfp-src=".job_application" class="popup-trigger"><span class="ion-email"></span></a>

					<?php 
            if (!is_position_filled() && $post->post_status == 'publish') {
                get_job_manager_template('job-application.php');
            }
            ?>

					<a href="<?php 
            echo get_author_posts_url(get_the_author_meta('ID'));
            ?>
"><span class="ion-information-circled"></span></a>
				</div>
				<?php 
        }
        ?>
			</div>

			<?php 
        if ($biography && ($bio = get_the_author_meta('description', get_the_author_meta('ID')))) {
            ?>
				<div class="job_listing-author-biography">
					<?php 
            echo $bio;
            ?>
				</div>
			<?php 
        }
        ?>

            <?php 
        do_action('listify_widget_job_listing_author_after');
        ?>
		</div>

		<?php 
        echo $after_widget;
        $content = ob_get_clean();
        echo apply_filters($this->widget_id, $content);
        $this->cache_widget($args, $content);
    }