Ejemplo n.º 1
0
function theme_author_box()
{
    $authinfo = "<div class=\"postauthor vcard\">\r\n";
    $authinfo .= "<span class=\"sourceavatar\">" . get_avatar(get_the_author_id(), 300) . "</span>";
    $authinfo .= "<h4> About the source: " . "<span class=\"fn\">" . get_the_author_meta('display_name') . "</span>" . "</h4>\r\n";
    $authinfo .= "<p><span class=\"note\">" . get_the_author_meta('description') . "</span></p>\r\n";
    $facebook = get_the_author_meta('facebook');
    $twitter = get_the_author_meta('twitter');
    $gplus = get_the_author_meta('gplus');
    $blog_title = get_the_author_meta('user_url');
    $flength = strlen($facebook);
    $tlength = strlen($twitter);
    $glength = strlen($gplus);
    $llength = strlen($blog_title);
    $authsocial = "<div class=\"postauthor-bottom\"> <p>\r\n";
    if ($flength > 1) {
        $authsocial .= "<i class=\"fa fa-facebook-official\"></i><a class=\"author-fb url\" href=\"http://facebook.com/" . $facebook . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " on Facebook\">Facebook</a>";
    }
    if ($glength > 1) {
        $authsocial .= "<i class=\"fa fa-google-plus-square\"></i><a class=\"author-gplus url\" href=\"" . $gplus . "\" rel=\"me\" target=\"_blank\" title=\"" . get_the_author_meta('display_name') . " on Google+\">Google+</a>";
    }
    if ($tlength > 1) {
        $authsocial .= "<i class=\"fa fa-twitter-square\"></i><a class=\"author-twitter url\" href=\"http://twitter.com/" . $twitter . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " on Twitter\">Twitter</a>";
    }
    if ($llength > 1) {
        $authsocial .= "<i class=\"fa fa-wordpress\"></i><a class=\"author-blog url\" href=\"" . $blog_title . "\" target=\"_blank\" rel=\"nofollow\" title=\"" . get_the_author_meta('display_name') . " Personal Blog\">Website</a>";
    }
    $authsocial .= "</p>\r\n";
    $authsocial .= "</div></div>\r\n";
    if (is_single() || is_author()) {
        echo $authinfo;
        echo $authsocial;
    }
}
Ejemplo n.º 2
0
function wsm_author_box_pattern($pattern)
{
    $gravatar = get_avatar(get_the_author_id(), 76);
    $description = get_the_author_meta('description');
    $pattern = '<div class="author-box"><h3>By ' . get_the_author_meta('display_name') . '</h3>' . $gravatar . ' <p class="author-description">' . $description . '</p></div>';
    return $pattern;
}
Ejemplo n.º 3
0
function authorWidget()
{
    $settings = get_option("widget_authorwidget");
    $title = $settings['title'];
    if ($title == "") {
        $title = __('Author Info', 'woothemes');
    }
    if (is_single()) {
        ?>

<div id="author" class="widget">
	<h3 class="widget_title"><img src="<?php 
        bloginfo('template_directory');
        ?>
/images/ico-author.png" alt="" /><?php 
        echo $title;
        ?>
</h3>
	<div class="wrap">
		<div class="fl"><?php 
        echo get_avatar(get_the_author_id(), '48');
        ?>
</div>
        <span class="author-info"><?php 
        _e('This post was written by', 'woothemes');
        ?>
 <?php 
        the_author_posts_link();
        ?>
 <?php 
        _e('who has written', 'woothemes');
        ?>
 <?php 
        the_author_posts();
        ?>
 <?php 
        _e('posts on', 'woothemes');
        ?>
 <a href="<?php 
        echo get_option('home');
        ?>
/"><?php 
        bloginfo('name');
        ?>
</a>.</span>
		<br class="fix"></br>
		<p class="author-desc"><?php 
        the_author_description();
        ?>
</p>
	</div>
</div>

<?php 
    }
}
Ejemplo n.º 4
0
function uppsite_get_member()
{
    $avatar = null;
    if (function_exists('get_the_author_meta')) {
        $avatar = get_avatar(get_the_author_meta('user_email'));
    } elseif (function_exists('get_the_author_id')) {
        $avatar = get_avatar(get_the_author_id());
    }
    return array('name' => get_the_author(), 'link' => get_the_author_link(), 'avatar' => uppsite_extract_src_url($avatar));
}
Ejemplo n.º 5
0
 public function Sync_post($select, $where, $refguid, $limit)
 {
     global $wp, $wpdb;
     $where .= " AND {$wpdb->posts}.ID < " . $refguid;
     $querystr = $select . $where . " ORDER BY {$wpdb->posts}.ID ASC LIMIT " . $limit;
     $posts_list = $wpdb->get_results($querystr);
     error_log("Sync - " . $querystr);
     $struct = array();
     if (!$posts_list) {
         return $struct;
     }
     foreach ($posts_list as $post) {
         //error_log("post id ".$post['ID']);
         $post = get_object_vars($post);
         // Do we have permission to read this post?
         if (!json_check_post_permission($post, 'read')) {
             continue;
         }
         $post_data["guid"] = $post['ID'];
         $post_data["title"] = $post['post_title'];
         $post_data["description"] = strip_tags($post['post_content']);
         $authorid = get_the_author_id($post);
         $post_data["iconurl"] = get_avatar_url($authorid);
         //$post_data["icontime"] = $post['post_title'];
         $post_data["time"] = get_post_modified_time('U', false, $post, false);
         if (is_wp_error($post_data)) {
             continue;
         }
         //error_log("ajaay".serialize($post));
         $struct[] = $post_data;
     }
     return $struct;
 }
Ejemplo n.º 6
0
/**
 * Display the ID of the author of the current post.
 *
 * @link http://codex.wordpress.org/Template_Tags/the_author_ID
 * @since 0.71
 * @uses get_the_author_ID()
 */
function the_author_ID()
{
    echo get_the_author_id();
}
Ejemplo n.º 7
0
        ?>
</a></h1>
								</section>
							</div>
							<div class="page-main">
								<section class="layout">
																
										<div class="profile-page">
																			
											<div id="tabs" class="science-tabs">
													
															
													<ul>
														<div class="author-info">
															<?php 
        $author_id = get_the_author_id();
        $author = get_userdata($author_id);
        if (SCIENCE_ID) {
            if (get_option('permalink_structure') == '/%postname%/') {
                $sb_url = get_the_permalink(SCIENCE_ID) . '/' . $author->user_nicename;
            } else {
                $sb_url = add_query_arg(array('sb' => $author->user_nicename), get_the_permalink(SCIENCE_ID));
            }
        }
        if ($sb_url !== null) {
            echo '<div class="author-pic"><a href="' . $sb_url . '"><img src="' . get_user_meta($author_id, '_naiau_user_picture', 1) . '" alt="' . $author->display_name . '" title="' . $author->display_name . '"/></a></div>';
        } else {
            echo '<span class="author-name">' . get_the_author() . '</span>';
        }
        ?>
														</div>
Ejemplo n.º 8
0
    ?>
" target="_blank">x</a>
									<?php 
}
if (get_field('user_yt', 'user_' . get_the_author_id())) {
    ?>
									<a class="socicon" href="<?php 
    the_field('user_yt', 'user_' . get_the_author_id());
    ?>
" target="_blank">r</a>
									<?php 
}
if (get_field('user_pin', 'user_' . get_the_author_id())) {
    ?>
									<a class="socicon" href="<?php 
    the_field('user_pin', 'user_' . get_the_author_id());
    ?>
" target="_blank">d</a>
									<?php 
}
?>
								</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>

		<?php 
if (have_posts()) {
Ejemplo n.º 9
0
</strong>.
            <h3>About Author</h3>
            <p class="gravatar"><?php 
echo get_avatar(get_the_author_id(), $size = '96');
?>
</p>
            <p class="nickname loud"><strong><?php 
the_author_meta('display_name', get_the_author_id());
?>
</strong></p>
            <p class="author_url">
            <a href="<?php 
the_author_meta('user_url', get_the_author_id());
?>
"><?php 
the_author_meta('user_url', get_the_author_id());
?>
</a></p>
            <p>Read more about <?php 
the_author_posts_link();
?>
 </p>
            <h3>Share The Love</h3>
            <p><a tagret="_blank" href="<?php 
echo 'http://www.twitter.com/?status=' . get_the_title() . ' ' . get_bloginfo('url');
?>
/?post_id=<?php 
echo $post->ID;
?>
" title="twitter"><img src="<?php 
bloginfo('template_url');
Ejemplo n.º 10
0
echo get_post_format();
?>
-format post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
			<header class="entry-header">
				<a href="<?php 
echo get_author_posts_url(get_the_author_meta('ID'));
?>
">
					<?php 
$author_image = get_field('profile_image', 'user_' . get_the_author_id());
?>
					<img src="<?php 
echo $author_image['sizes']['thumbnail'];
?>
" width="<?php 
echo $author_image['sizes']['thumbnail-width'];
?>
" height="<?php 
echo $author_image['sizes']['thumbnail-height'];
?>
">
				</a>
				<?php 
the_title('<h1 class="entry-title">', '</h1>');
?>
Ejemplo n.º 11
0
        $postcount++;
        $meta = get_post_meta(get_the_id());
        $key_1_values = get_post_meta(get_the_ID(), '', true);
        $field = get_field_object('budget');
        $field1 = get_field_object('genre');
        $field11 = get_field_object('production_stage');
        $field2 = get_field_object('compares');
        $field3 = get_field_object('tax_breaks');
        $field4 = get_field_object('team');
        $field5 = get_field_object('cast');
        $field6 = get_field_object('investor_info');
        $field7 = get_field_object('target');
        $field8 = get_field_object('invested');
        $field9 = get_field_object('soft');
        $field10 = get_field_object('investers');
        $user_ID = get_the_author_id();
        $select_financ = get_user_meta($user_ID, 'select_financ', true);
        $select_creative = get_user_meta($user_ID, 'select_creative', true);
        $finance_package = get_user_meta($user_ID, 'finance_package', true);
        $creative_package = get_user_meta($user_ID, 'creative_package', true);
        $add_image = get_user_meta($user_ID, 'add_image', true);
        $u_vid = false;
        $u_vid = userpro_profile_data('video', $user_ID);
        ?>
    <div class="col-sm-6 col-md-3 <?php 
        echo $user_ID;
        ?>
">
	<div class="pro-box">
	<div class="img-thumb">
	<h4><?php 
Ejemplo n.º 12
0
    while (have_posts()) {
        the_post();
        $author_feed_url = '';
        if (function_exists('get_author_feed_link')) {
            $author_feed_url = get_author_feed_link(get_the_author_ID());
        } else {
            $author_feed_url = get_author_rss_link(false, get_the_author_ID(), get_the_author_nickname());
        }
        ?>

<?php 
        if ($first_post === true) {
            ?>
	<h2>
		<?php 
            echo prologue_get_avatar(get_the_author_id(), get_the_author_email(), 48);
            ?>
		Updates from <?php 
            the_author_posts_link();
            ?>
		<a class="rss" href="<?php 
            echo $author_feed_url;
            ?>
">RSS</a>
	</h2>
<?php 
        }
        // first_post
        ?>

	<ul>
Ejemplo n.º 13
0
            edit_post_link(' Edit', '', ' |');
            if (function_exists('getILikeThis')) {
                getILikeThis('get');
            }
            ?>
 | <?php 
            comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;');
            ?>
</div>
			</div>
<?php 
        } else {
            ?>
			<div class="minimize">
				<div style="float: right;"><?php 
            echo get_avatar(get_the_author_id(), $size = '56', $default = '');
            ?>
</div>
				<h2><a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="Permanent Link to <?php 
            the_title_attribute();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
				<div>Posted by <?php 
            the_author_posts_link();
            $aff = get_the_author_meta('affiliation', get_the_author_meta('ID'));
Ejemplo n.º 14
0
	<article class="item  title-template">
		<h1>
			El archivo <em>author.php</em> es el archivo que toma por defecto WordPress para mostrar la página de perfil del autor (usuario) actual.
		</h1>
	</article>	
';
$template_author = '
	<ul class="item  author-info">
		<li>Autor: <b>%s</b></li>
		<li>ID Autor: <b>%s</b></li>
		<li>Correo: <b>%s</b></li>
		<li>Login: <b>%s</b></li>
		<li>Password: <b>%s</b></li>
		<li>Nicename: <b>%s</b></li>
		<li>URL Autor: <b>%s</b></li>
		<li>URL Página Autor: <b>%s</b></li>
		<li>Fecha y Hora de Registro: <b>%s</b></li>
		<li>Rol: <b>%s</b></li
		<li>Nombre para mostrar: <b>%s</b></li>
		<li>Alias: <b>%s</b></li>
		<li>Nombre: <b>%s</b></li>
		<li>Apellido: <b>%s</b></li>
		<li>Descripción: <b>%s</b></li>
		<li>Número de Publicaciones: <b>%s</b></li>
		<li>Avatar: %s</li>
	</ul>
';
printf($template_author, get_the_author(), get_the_author_id(), get_the_author_meta('user_email'), get_the_author_meta('user_login'), get_the_author_meta('user_pass'), get_the_author_meta('user_nicename'), get_the_author_meta('user_url'), get_author_posts_url(get_the_author_id()), get_the_author_meta('user_registered'), get_the_author_meta('roles')[0], get_the_author_meta('display_name'), get_the_author_meta('nickname'), get_the_author_meta('first_name'), get_the_author_meta('last_name'), get_the_author_meta('description'), get_the_author_posts(), get_avatar(get_the_author_id(), 50));
get_template_part('content');
get_sidebar();
get_footer();
Ejemplo n.º 15
0
	<section id="primary" class="content-area">
		<main id="main" class="site-main list-page" role="main">

		<?php 
$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
if (have_posts()) {
    ?>

			<header class="page-header">
				<?php 
    $title = sprintf(__('Posts by %s'), '<span class="vcard">' . get_the_author() . '</span>');
    echo '<h1 class="page-title">' . $title . '</h1>';
    the_archive_description('<div class="taxonomy-description">', '</div>');
    echo do_shortcode("[user id=" . $curauth->ID . "]");
    if ($curauth->caps['contributor'] == "1") {
        echo '<p><a class="btn" href="/student-voices/contact?blogger=' . get_the_author_meta('user_nicename', get_the_author_id()) . '">Ask ' . get_the_author() . ' a question</a></p>';
    }
    ?>
			</header><!-- .page-header -->

			<?php 
    // Start the Loop.
    while (have_posts()) {
        the_post();
        /*
         * Include the Post-Format-specific template for the content.
         * If you want to override this in a child theme, then include a file
         * called content-___.php (where ___ is the Post Format name) and that will be used instead.
         *
        get_template_part( 'content', get_post_format() );
        */
Ejemplo n.º 16
0
$author = 1;
$monthAndYear = 2;
$the_query = new WP_Query(array('category_name' => 'News'));
if ($the_query->have_posts()) {
    while ($the_query->have_posts()) {
        $the_query->the_post();
        $posttags = get_the_tags();
        if ($posttags) {
            foreach ($posttags as $tag) {
                $post_info[$topics][$tag->name] = $tag->name;
            }
        }
        $year = get_the_date('Y', '', '', false);
        $month = get_the_date('m', '', '', false);
        $writtenMonth = get_the_date('M', '', '', false);
        $post_info[$author][get_the_author()] = get_the_author_id();
        $post_info[$monthAndYear][$writtenMonth . ' ' . $year] = $year . '-' . $month;
    }
} else {
}
wp_reset_postdata();
?>

<?php 
include 'header.php';
?>

<!-- end inlude header --> 
<?php 
get_template_part('banner', 'interior');
?>
 function get_single_page_values($fields = [])
 {
     // extraction des champs/valeurs d'une table
     if (count($fields) == 0) {
         $fields = ['id', 'title', 'content', 'author-id', 'author-name'];
     }
     global $post;
     $id = $post->ID;
     $data = array();
     if (array_search('id', $fields) !== false) {
         $data['id'] = $id;
     }
     if (array_search('title', $fields) !== false) {
         $data['title'] = get_the_title();
     }
     if (array_search('content', $fields) !== false) {
         $base = get_the_content();
         // pb : pas de paragraphes :/
         $data['content'] = wpautop($base, true);
         // et hop paragraphes à la wordpress !
     }
     if (array_search('author-id', $fields) !== false) {
         $data['author-id'] = get_the_author_id();
     }
     if (array_search('author-name', $fields) !== false) {
         $data['author-name'] = get_the_author();
     }
     // + de détails sur l'auteur : status, level, etc
     // https://codex.wordpress.org/Function_Reference/get_the_author_meta
     return $data;
 }
Ejemplo n.º 18
0

					<p><?php 
    the_content('Read more...');
    ?>
</p>



				</article>



			</div> 



			<div class="content-footer"> </div>	



			<?php 
}
?>
 



				<!-- eof featured -->

/**
 * Shortcode function for displaying the current post author ID
 * Uses the get_the_author_id() function
 * @link http://codex.wordpress.org/Template_Tags/the_author_ID
 *
 * @since 0.1
 */
function shortcode_the_author_ID()
{
    return get_the_author_id();
}
Ejemplo n.º 20
0
?>
		<?php 
if ($link_audio != '') {
    ?>
			<div class="audio-player">
				<iframe height="166" scrolling="no" frameborder="no" src="<?php 
    echo esc_url(get_post_meta(get_the_ID(), "_cmb_link_audio", true));
    ?>
&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_artwork=true"></iframe>
			</div>
		<?php 
}
?>
		<div class="blog-text-wrap">
			<?php 
echo get_avatar(get_the_author_id(), '70');
?>
			<div class="blog-text-name"><?php 
the_author_posts_link();
?>
</div>
			<h3><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h3>
			<div class="blog-text-date"><?php 
the_time('d.m.Y.');
?>
Ejemplo n.º 21
0
						<?php 
        the_time('d-M-Y g:i a');
        ?>
					</small>
				</p>
				<p>Categorías:</p>
				<?php 
        the_category();
        ?>
				<p><?php 
        the_tags();
        ?>
</p>
				<p>
					<a href="<?php 
        print get_author_posts_url(get_the_author_id());
        ?>
">
						<i class="fa  fa-user"></i>
						<?php 
        the_author();
        ?>
					</a>
				</p>
				<?php 
        if (is_page() || is_single()) {
            print '<div class="content-section">';
            the_content();
            print '</div>';
        }
        if (is_single()) {
Ejemplo n.º 22
0
</h1>
<!-- end Title -->

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

<table cellpadding="0" cellspacing="0" class="post <?php 
        the_ID();
        ?>
">
		<tr><!-- Author Avatar -->
			<td class="avatar">
			<a href="<?php 
        echo get_author_posts_url(get_the_author_id());
        ?>
" title="<?php 
        the_author();
        ?>
" alt="<?php 
        the_author();
        ?>
"><?php 
        echo get_avatar(get_the_author_email(), '50');
        ?>
</a>
			</td> 
			
			<td class="posted">
				<div class="author"><!-- Author  name --><?php 
Ejemplo n.º 23
0
/**
 * Template for displaying Author Archive pages
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
get_header();
?>

		<section id="primary">
			<div id="content" role="main">

				<?php 
$ctheory_author_id = get_the_author_id();
echo "<h1 id=\"author-header\">Articles by " . get_the_author() . "</h1>";
$args = array('posts_per_page' => '-1', 'author' => $ctheory_author_id);
$the_query = new WP_Query($args);
while ($the_query->have_posts()) {
    $the_query->the_post();
    get_template_part('content', 'author');
}
wp_reset_postdata();
// end
?>
				
		</div><!-- #content -->
		</section><!-- #primary -->

<?php 
function get_single_element_values($fields)
{
    // extraction des champs/valeurs d'un élément
    global $post;
    $id = $post->ID;
    $data = array();
    // source : page-atlas2.php
    if (array_search('id', $fields) !== false) {
        $data['id'] = $id;
    }
    if (array_search('date', $fields) !== false) {
        $data['date'] = get_field('annee', $id);
    }
    if (array_search('title', $fields) !== false) {
        $data['title'] = get_the_title();
    }
    if (array_search('legende', $fields) !== false) {
        $data['legende'] = fabriqueLegende($id);
    }
    if (array_search('abrege', $fields) !== false) {
        $data['abrege'] = get_field('abrege', $id);
    }
    if (array_search('large-image', $fields) !== false) {
        $image_data = get_field('image', $id);
        $data['image'] = $this->get_image_path('large');
        // large pour le panel
    }
    if (array_search('thumb-image', $fields) !== false) {
        $image_data = get_field('image', $id);
        $data['miniature'] = $this->get_image_path('thumbnail');
        // la miniature
    }
    if (array_search('classes', $fields) !== false) {
        $data['classesA'] = get_field('classification_a', $id);
        $data['classesB'] = implodeIf(' ', get_field('classification_b', $id));
    }
    if (array_search('coords', $fields) !== false) {
        $coord = explode(",", get_post_meta($post->ID, 'coord', true));
        $data['x'] = $coord[0];
        $data['y'] = $coord[1];
    }
    if (array_search('author-id', $fields) !== false) {
        $data['author-id'] = get_the_author_id();
    }
    if (array_search('author-name', $fields) !== false) {
        $data['author-name'] = get_the_author();
    }
    if (array_search('tables-ids', $fields) !== false) {
        $data['tables'] = get_element_tables(false);
    }
    return $data;
}
Ejemplo n.º 25
0
</div>

		<?php 
    tz_printLikes(get_the_ID());
    ?>

	</section>

	<footer class="author">

		<h2>About The Author</h2> 

		<div class="au_div">         

          	<?php 
    echo get_avatar(get_the_author_id(), 80);
    ?>
         

          	<h3><?php 
    the_author();
    ?>
</h3>   

          	<p><?php 
    the_author_description();
    ?>
</p>

		</div>
Ejemplo n.º 26
0
Archivo: page.php Proyecto: alx/Tetalab
        ?>
 -->
		<?php 
        arras_postfooter();
        ?>

        <?php 
        if (arras_get_option('display_author')) {
            ?>
        <div class="about-author clearfix">
        	<h4><?php 
            _e('About the Author', 'arras');
            ?>
</h4>
            <?php 
            echo get_avatar(get_the_author_id(), 48);
            ?>
            <?php 
            the_author_description();
            ?>
        </div>
        <?php 
        }
        ?>
    </div>
    
	<?php 
        arras_below_post();
        ?>
	<a name="comments"></a>
    <?php 
Ejemplo n.º 27
0
							</div>
							<div style="clear:both"></div>
						</div>
						<div class="post_cont">
							<?php 
        str_replace("\n", "<br />", the_content());
        ?>
						</div>
						<div class="post_author" style="display:block;">
							Post&eacute; par <a href="<?php 
        the_author_meta('user_url');
        ?>
" target="_blank"><?php 
        the_author();
        echo "</a>";
        echo get_avatar(get_the_author_id(), $size = '36');
        ?>
						</div>

						<?php 
        //VARS FOR COMS / Tracks
        $coms_nb = get_comment_type_count('comment', get_the_ID());
        $tracks_nb = get_comment_type_count('ping', get_the_ID());
        ?>

						<!-- COMS and Tracks -->
						<div class="comments_tracks_div">
							<div class="tabs_div">
								<div class="coms_tracks_tab tab_off" id="coms_off">
									<a href="javascript:show_tab('coms');">Commentaires (<?php 
        print $coms_nb;
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     $items = intval($instance['items']);
     $thumbnails = $instance['thumbnails'];
     $freshness = $instance['freshness'];
     $more = $instance['more'];
     $excerpt = $instance['excerpt'];
     $tdate = date('Y-m-d') . " 00:00";
     $freshness = "-" . $freshness . " day";
     $tdate = date('F jS, Y', strtotime($freshness . $tdate));
     $acf_key = "widget_" . $this->id_base . "-" . $this->number . "_pin_posts";
     $top_slot = get_option($acf_key);
     $num_top_slots = 0;
     if (is_array($top_slot)) {
         $num_top_slots = count($top_slot);
     }
     $to_fill = $items - $num_top_slots;
     $k = -1;
     $alreadydone = array();
     $titledone = 0;
     if ($num_top_slots > 0) {
         if ($title) {
             echo $before_widget;
             echo $before_title . $title . $after_title;
         }
         echo "<div class='widget-area widget-blogposts'>";
         $titledone = 1;
         $cquery = array('post_type' => 'blog', 'posts_per_page' => -1, 'post__in' => $top_slot);
         $news = new WP_Query($cquery);
         if ($news->have_posts()) {
             while ($news->have_posts()) {
                 $news->the_post();
                 $k++;
                 $alreadydone[] = get_the_id();
                 $thistitle = get_the_title();
                 $edate = get_the_date($post->ID);
                 $edate = date(get_option('date_format'), strtotime($edate));
                 $thisURL = get_permalink();
                 echo "<div class='media'>";
                 if ($thumbnails == 'on') {
                     $image_uri = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
                     if (!$image_uri) {
                         $image_uri = get_avatar(get_the_author_id(), 72);
                         $image_uri = str_replace("alignleft", "alignleft tinyblogthumb", $image_uri);
                         echo "<a class='pull-left' href='" . get_permalink(get_the_id()) . "'>{$image_uri}</a>";
                     } else {
                         echo "<a class='pull-left' href='" . get_permalink(get_the_id()) . "'><img class='tinyblogthumb alignleft' src='{$image_uri[0]}' alt='" . $thistitle . "' /></a>";
                     }
                 }
                 echo "<div class='media-body'><a href='{$thisURL}'>" . $thistitle . "</a>";
                 echo "<br><span class='news_date'>" . $edate . " by ";
                 echo get_the_author();
                 echo "</span>";
                 echo " <span class='badge'>" . __('Featured', 'govintranet') . "</span>";
                 if (get_comments_number()) {
                     echo " <a href='" . $thisURL . "#comments'>";
                     printf(_n('<span class="badge">1 comment</span>', '<span class="badge">%d comments</span>', get_comments_number(), 'govintranet'), get_comments_number());
                     echo "</a>";
                 }
                 if ($excerpt == 'on') {
                     the_excerpt();
                 }
                 echo "</div></div>";
             }
         }
     }
     //fetch fresh blogposts
     $cquery = array('post_type' => 'blog', 'posts_per_page' => $to_fill, 'post__not_in' => $alreadydone, 'date_query' => array(array('after' => $tdate, 'inclusive' => true)));
     $news = new WP_Query($cquery);
     if ($news->post_count != 0 && !$titledone) {
         if ($title) {
             echo $before_widget;
             echo $before_title . $title . $after_title;
         }
         echo "<div class='widget-area widget-blogposts'>";
     }
     $k = 0;
     while ($news->have_posts()) {
         $news->the_post();
         $k++;
         if ($k > $to_fill) {
             break;
         }
         global $post;
         //required for access within widget
         $thistitle = get_the_title($post->ID);
         $edate = $post->post_date;
         $edate = date(get_option('date_format'), strtotime($edate));
         $thisURL = get_permalink($ID);
         echo "<div class='media'>";
         if ($thumbnails == 'on') {
             $image_uri = wp_get_attachment_image_src(get_post_thumbnail_id($ID), 'thumbnail');
             if (!$image_uri) {
                 $image_uri = get_avatar($post->post_author, 72);
                 $image_uri = str_replace("alignleft", "alignleft tinyblogthumb", $image_uri);
                 echo "<a class='pull-left' href='" . get_permalink($post->ID) . "'>{$image_uri}</a>";
             } else {
                 echo "<a class='pull-left' href='" . get_permalink($post->ID) . "'><img class='tinyblogthumb alignleft' src='{$image_uri[0]}' alt='" . $thistitle . "' /></a>";
             }
         }
         echo "<div class='media-body'><a href='{$thisURL}'>" . $thistitle . "</a>";
         echo "<br><span class='news_date'>" . $edate . " by ";
         echo get_the_author();
         echo "</span>";
         if (get_comments_number()) {
             echo " <a href='" . $thisURL . "#comments'>";
             printf(_n('<span class="badge">1 comment</span>', '<span class="badge">%d comments</span>', get_comments_number(), 'govintranet'), get_comments_number());
             echo "</a>";
         }
         if ($excerpt == 'on') {
             the_excerpt();
         }
         echo "</div></div>";
     }
     if ($news->have_posts() && $more) {
         $landingpage = get_option('options_module_blog_page');
         if (!$landingpage) {
             $landingpage_link_text = 'blogposts';
             $landingpage = site_url() . '/blogposts/';
         } else {
             $landingpage_link_text = get_the_title($landingpage[0]);
             $landingpage = get_permalink($landingpage[0]);
         }
         echo '<hr><p><strong><a title="{$landingpage_link_text}" class="small" href="' . $landingpage . '">' . $landingpage_link_text . '</a></strong> <span class="dashicons dashicons-arrow-right-alt2"></span></p>';
     }
     if ($news->have_posts() || $num_top_slots > 0) {
         echo '</div>';
         echo $after_widget;
     }
     wp_reset_query();
 }
Ejemplo n.º 29
0
							<div class="bottom">
								<?php 
        $category = get_the_category();
        $cat_id = $category[0]->cat_ID;
        $cat_name = $category[0]->cat_name;
        $cat_slug = $category[0]->category_nicename;
        ?>
								<span class="category category-<?php 
        echo $cat_slug;
        ?>
"><?php 
        echo $cat_name;
        ?>
</span>
								<?php 
        echo get_avatar(get_the_author_id(), 15);
        ?>
								<span><?php 
        echo the_author_nickname();
        ?>
</span>
							</div>
						</li>
					</a>
				<?php 
    }
    ?>
				<?php 
}
?>
				<?php 
Ejemplo n.º 30
0
<?php

header('Access-Control-Allow-Origin: *');
header('Cache-Control: max-age=2592000');
require dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/wp-load.php';
$id = $_GET['id'];
error_log("ID   =  " . $id);
$post = get_post($id);
$authorid = get_the_author_id($post);
$iconurl = get_avatar_url($authorid);
?>

<ons-page   style="background-color: #f9f9f9;" >
    <ons-toolbar>
        <div class="left" style="color: #1284ff;" onclick="handle_go_back()"><ons-icon icon="ion-android-arrow-back"></ons-icon>Back</div>
<div class="center"><?php 
echo $post->post_title;
?>
</div>
        <div class="right" style="margin-right:15px;">
            <ons-icon icon="ion-android-share" onclick='load_page("sharepage");'></ons-icon>
        </div>
    </ons-toolbar>
<div >
<img src="<?php 
echo $iconurl;
?>
" width='100px' alt='entry photo' />
<?php 
echo "<h3>" . $post->post_title;
?>