',
'' . get_the_title() . ' ',
'';
}
/* ----------------------------------------------------------------------------------
BLOG CONTENT
---------------------------------------------------------------------------------- */
// Input post thumbnail / featured media
function astronomy_input_blogimage() {
global $post;
$size = NULL;
$link = NULL;
$media = NULL;
$output = NULL;
$blog_lightbox = NULL;
$blog_link = NULL;
$blog_overlay = NULL;
// Set image size for blog thumbnail
$size = 'column1-1/3';
$featured_id = get_post_thumbnail_id( $post->ID );
$featured_img = wp_get_attachment_image_src($featured_id,'full', true);
// Determine featured media to input
$link = $featured_img[0];
$media = get_the_post_thumbnail( $post->ID, $size );
// Determine which links to show on hover
$blog_lightbox = ' ';
$blog_link = ' ';
$blog_overlay .= '
';
$blog_overlay .= '
';
$blog_overlay .= $blog_lightbox;
$blog_overlay .= $blog_link;
$blog_overlay .= '
';
$blog_overlay .= '
';
// Output media on blog page
if ( ! empty( $featured_id ) ) {
$output .= '';
$output .= '
' . $media . ' ';
$output .= $blog_overlay;
$output .= '
';
}
return $output;
}
// Input post excerpt / content to blog page
function astronomy_input_blogtext() {
global $post;
// Get theme options values.
$astronomy_blog_postswitch = astronomy_var ( 'astronomy_blog_postswitch' );
// Output full content - EDD plugin compatibility
if( function_exists( 'EDD' ) and is_post_type_archive( 'download' ) ) {
the_content();
return;
}
// Output post content
if ( is_search() ) {
the_excerpt();
} else if ( ! is_search() ) {
if ( ( empty( $astronomy_blog_postswitch ) or $astronomy_blog_postswitch == 'option1' ) ) {
if( ! is_numeric( strpos( $post->post_content, '' ) ) ) {
the_excerpt();
} else {
the_content();
wp_link_pages( array( 'before' => '' . __( 'Pages:', 'astronomy' ), 'after' => '
', ) );
}
} else if ( $astronomy_blog_postswitch == 'option2' ) {
the_content();
wp_link_pages( array( 'before' => '' . __( 'Pages:', 'astronomy' ), 'after' => '
', ) );
}
}
}
/* ----------------------------------------------------------------------------------
BLOG META CONTENT & POST META CONTENT
---------------------------------------------------------------------------------- */
// Input sticky post
function astronomy_input_sticky() {
printf( '' . __( 'Sticky', 'astronomy' ) . ' ',
esc_url( get_permalink() ),
esc_attr( get_the_title() )
);
}
// Input blog date
function astronomy_input_blogdate() {
printf( __( '%4$s ', 'astronomy' ),
esc_url( get_permalink() ),
esc_attr( get_the_title() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date( 'M j, Y' ) )
);
}
// Input blog comments
function astronomy_input_blogcomment() {
if ( '0' != get_comments_number() ) {
echo '';
}
}
// Input blog categories
function astronomy_input_blogcategory() {
$categories_list = get_the_category_list( __( ', ', 'astronomy' ) );
if ( $categories_list && astronomy_input_categorizedblog() ) {
echo ' ';
printf( '%1$s', $categories_list );
echo ' ';
};
}
// Input blog tags
function astronomy_input_blogtag() {
$tags_list = get_the_tag_list( '', __( ', ', 'astronomy' ) );
if ( $tags_list ) {
echo ' ';
printf( '%1$s', $tags_list );
echo ' ';
};
}
// Input blog author
function astronomy_input_blogauthor() {
printf( __( '%3$s ', 'astronomy' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'astronomy' ), get_the_author() ) ),
get_the_author()
);
}
//----------------------------------------------------------------------------------
// CUSTOM READ MORE BUTTON.
//----------------------------------------------------------------------------------
// Input 'Read more' link
function astronomy_input_readmore() {
global $post;
printf( '' . __( 'READ MORE', 'astronomy') . '
', esc_url( get_permalink( $post->ID ) ) );
}
/* ----------------------------------------------------------------------------------
INPUT BLOG META CONTENT
---------------------------------------------------------------------------------- */
// Blog meta content - Blog style 1
function astronomy_input_blogmeta1() {
echo '';
if ( is_sticky() && is_home() && ! is_paged() ) { astronomy_input_sticky(); }
astronomy_input_blogdate();
astronomy_input_blogauthor();
astronomy_input_blogcomment();
astronomy_input_blogcategory();
astronomy_input_blogtag();
echo '
';
}
/* ----------------------------------------------------------------------------------
INPUT POST META CONTENT
---------------------------------------------------------------------------------- */
function astronomy_input_postmedia() {
global $post;
// Set output variable to avoid php errors
$output = NULL;
if ( get_post_format() == 'image' ) {
$output .= '' . get_the_post_thumbnail( $post->ID, 'column1-1/4' ) . '
';
}
// Output featured items if set
if ( ! empty( $output ) ) {
echo $output;
}
}
function astronomy_input_postmeta() {
echo '';
}
/* ----------------------------------------------------------------------------------
TEMPLATE FOR COMMENTS AND PINGBACKS (PREVIOUSLY IN TEMPLATE-TAGS).
---------------------------------------------------------------------------------- */
/* Display comments - Style 1 */
function astronomy_input_allowcomments1() {
// Get theme options values.
$astronomy_post_commentstyle = astronomy_var ( 'astronomy_post_commentstyle' );
if ( empty( $astronomy_post_commentstyle ) or $astronomy_post_commentstyle == 'option1' ) {
if ( comments_open() || '0' != get_comments_number() )
comments_template( '/comments.php', true );
}
}
/* Display comments - Style 2 */
function astronomy_input_allowcomments2() {
// Get theme options values.
$astronomy_post_commentstyle = astronomy_var ( 'astronomy_post_commentstyle' );
// ADD CONDITION TO ONLY SHOW IF COMMENT STYLE 2 IS SELECTED - ALSO ADD OPTION TO BLOG PAGE OPTIONS PANEL
if ( $astronomy_post_commentstyle == 'option2' ) {
if ( comments_open() || '0' != get_comments_number() )
comments_template( '/comments.php', true );
}
}
/* Display comments class - Style 2 */
function astronomy_input_commentsstyle() {
// Get theme options values.
$astronomy_post_commentstyle = astronomy_var ( 'astronomy_post_commentstyle' );
if ( $astronomy_post_commentstyle == 'option2' ) {
echo ' class="style2"';
}
}
/* ----------------------------------------------------------------------------------
TEMPLATE FOR COMMENTS AND PINGBACKS (PREVIOUSLY IN TEMPLATE-TAGS).
---------------------------------------------------------------------------------- */
function astronomy_input_commenttemplate( $comment, $args, $depth ) {
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
id="li-comment-">
'astronomy_input_commenttemplate',
);
wp_list_comments( $args );
}
?>