Esempio n. 1
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 
    }
}
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();
    }
}
Esempio n. 3
0
function jdh_toc_list_posts($posts)
{
    global $post;
    foreach ($posts as $post) {
        setup_postdata($post);
        echo '<p><a href="' . get_permalink() . '">' . $post->post_title . '</a><br>';
        if (function_exists('coauthors')) {
            coauthors(',<br>');
        } else {
            echo the_author_meta('first_name') . ' ' . the_author_meta('last_name');
        }
        echo '</p>';
    }
}
/**
* Set replacement values for specific tokens with Post Author Box
*/
function pabx_add_replace_values($tokens)
{
    global $coauthors_plus;
    if (!function_exists('coauthors')) {
        return $tokens;
    }
    $coauthor = array_shift(get_coauthors());
    // Co-Authors Plus specific tokens
    $tokens['%coauthors%'] = coauthors(null, null, null, null, false);
    $tokens['%coauthors_posts_links%'] = coauthors_posts_links(null, null, null, null, false);
    $tokens['%coauthors_firstnames%'] = coauthors_firstnames(null, null, null, null, false);
    // Modify these tokens too, because they might be guest authors
    $tokens['%display_name%'] = $coauthor->display_name;
    $tokens['%first_name%'] = $coauthor->first_name;
    $tokens['%last_name%'] = $coauthor->last_name;
    $tokens['%description%'] = $coauthor->description;
    $tokens['%email%'] = $coauthor->email;
    $tokens['%jabber%'] = $coauthor->jabber;
    $tokens['%aim%'] = $coauthor->aim;
    $tokens['%avatar%'] = get_avatar($coauthor->user_email);
    return $tokens;
}
Esempio n. 5
0
" <?php 
        post_class();
        ?>
>
<div class="post-entry">
<h2 class="entry-title post-title grid-col-220"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark"><?php 
        the_title();
        ?>
</a></h2>
<div class="post-meta">
<span class="byline">By</span> <span class="author vcard"><?php 
        if (function_exists('coauthors')) {
            coauthors();
        } else {
            get_the_author();
        }
        ?>
</span> | <i class="fa fa-calendar"></i> <?php 
        the_time('F j, Y');
        ?>
</div>

					<?php 
        if (has_post_thumbnail()) {
            ?>
					<div class="pbd-thumb"><a href="<?php 
            the_permalink();
            ?>
Esempio n. 6
0
                <div class="intro-post six columns omega">
            <?php 
        }
        ?>
                <h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
                <?php 
        if (function_exists('coauthors')) {
            ?>
                    <h4 class="author-name"><?php 
            coauthors(',<br>');
            ?>
</h4>
                <?php 
        } else {
            ?>
                    <h4 class="author-name"><?php 
            echo the_author_meta('first_name');
            ?>
 <?php 
            echo the_author_meta('last_name');
            ?>
</h4>
                <?php 
        }
        ?>
Esempio n. 7
0
            ?>
						<?php 
            if (coauthors(null, null, null, null, false) === "Staff Reports") {
                ?>
							<span class="author" itemprop="author">Staff Reports</span>
						<?php 
            } elseif (coauthors(null, null, null, null, false) === "The Editorial Board") {
                ?>
							<a href="<?php 
                bloginfo('wpurl');
                ?>
/opinion/editorial/" title="More Pipe Dream editorials">
								<span class="author" itemprop="author">The Editorial Board</span>
							</a>
						<?php 
            } elseif (coauthors(null, null, null, null, false) === "archives") {
                ?>
							<span class="author" itemprop="author">
								<?php 
                if (isset($archive['_author'])) {
                    echo $archive['_author'];
                } else {
                    if (strpos(get_the_title(), 'to the editor') !== 0) {
                        // new posts are often misattributed to "archives"
                        // causing all sorts of issues.
                        echo "Guest Author";
                    }
                }
                ?>
							</span>
						<?php 
Esempio n. 8
0
<div class="interior-content">
    <div id="mainColumn">
        <h1>Latest News</h1>

        <div class="wide" id="news">
        <?php
        function fake_is_home($args) {
            // Really doesn't filter posts_results.
            // Set is_home = 1 to allow sticky posts to be honored.
            global $wp_query;
            $wp_query->is_home = 1;
            return $args;
        }
        add_filter('posts_results', 'fake_is_home');
        query_posts("cat=3,-11&posts_per_page=10&paged=&order=DESC&paged=" . get_query_var('paged'));
        while (have_posts()) :the_post(); ?>
            <div class="news-story">
                <h2><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h2>
                <span class="date">By <?php coauthors(); ?>, <?php the_time("F j, Y"); ?><br><?php the_category(", "); ?></span>
                <p><?php excerpt(30) ?></p>
            </div>
        <?php endwhile; ?>
        <?php wp_pagenavi() ?>
        </div>
    </div>
    <div id="sideColumn">
    <?php get_sidebar(); ?>
    </div>
</div>
<?php get_footer(); ?>
 function filter_the_author()
 {
     return coauthors(null, null, null, null, false);
 }
$thumbnail_id = get_post_thumbnail_id();
// Post featured image as FB IA cover image.
if (!$has_article_cover && $thumbnail_id) {
    Simple_FB_Instant_Articles::instance()->render_image_markup($thumbnail_id);
}
the_title('<h1>', '</h1>');
if (function_exists('the_subheading')) {
    the_subheading('<h2>', '</h2>');
}
?>

	<?php 
if (function_exists('coauthors')) {
    ?>
		<?php 
    coauthors('</address>, <address>', ' </address> and <address> ', '<address>', '</address>');
    ?>
	<?php 
} else {
    ?>
		<address><?php 
    the_author();
    ?>
</address>
	<?php 
}
?>

	<!-- The published and last modified time stamps -->
	<time class="op-published" dateTime="<?php 
echo esc_attr(get_the_time('c'));
        esc_html(the_title_rss());
        ?>
</title>
				<link><?php 
        the_permalink_rss();
        ?>
</link>
				<pubDate><?php 
        echo esc_html(mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false));
        ?>
</pubDate>
				<?php 
        if (function_exists('coauthors')) {
            ?>
					<?php 
            coauthors('</dc:creator><dc:creator>', '</dc:creator><dc:creator>', '<dc:creator>', '</dc:creator>');
            ?>
				<?php 
        } else {
            ?>
					<dc:creator><?php 
            the_author();
            ?>
</dc:creator>
				<?php 
        }
        ?>
				<guid isPermaLink="false"><?php 
        esc_html(the_guid());
        ?>
</guid>
Esempio n. 12
0
/** gets co-authors link if co-aurhors plugin is installed. 
 *  otherwise, gets the link mannually. 
 *  
 *  @used by: Home-guest-article; apn_guest_authors_meta();
 */
function apn_guest_authors_link()
{
    if (function_exists('coauthors_posts_links')) {
        $poster = get_the_author();
        $author = coauthors(null, null, null, null, false);
        if ($poster != $author) {
            $before = "<span class=\"glyphicon glyphicon-user\"> </span> ";
            return coauthors_posts_links(null, null, $before, null, false);
        } else {
            return false;
        }
    } else {
        return "WP Co-Authors Plus Plugin missing. See https://wordpress.org/plugins/co-authors-plus/";
    }
}