and should not appear
// on non-paginated pages
function portage_display_nav() {
$portage_num_posts = wp_count_posts()->publish;
$portage_posts_per_page = get_option('posts_per_page ');
if ( $portage_num_posts > $portage_posts_per_page) {
echo '
' . get_posts_nav_link(' • ','« Newer Posts','Older Posts;') . '
';
}
}
// Determine whether to display the comments box
function portage_comment_display() {
$var = get_comments_number();
if ( comments_open() || $var > 0 ) {
comments_template();
} else { echo '
';
}
}
// Display the time
// Included here if we need to change it later
function portage_date() {
return get_the_time(get_option('date_format'));
}
// Display publication info as a translatable string in 'content-entry-meta.php'
function portage_pub() {
$portage_author_link = get_author_posts_url( get_the_author_meta( 'ID' ) );
$portage_author_href = '
' . get_the_author() . '';
echo '
';
printf( __( 'Published on: %1$s by %2$s', 'portage' ), portage_date(), $portage_author_href );
echo '';
}
// Display category info as a translatable string in 'content-entry-meta.php'
function portage_cat() {
$gbcat = get_the_category_list( ', ' );
printf( __( 'Categorized under: %s', 'portage'), $gbcat );
}
// Display tags info as a translatable string in 'content-entry-meta.php'
function portage_tags() {
$tags_array = has_tag();
if (!empty($tags_array)) {
printf( __( 'Tagged with: %s', 'portage'), get_the_tag_list('', ', ', '' ) );
} else {
_e( 'This post has no tags.', 'portage' );
}
}
// Display next post link only if a newer post exists
function portage_next_post_link() {
$portage_npl = get_next_post_link();
if ( empty ( $portage_npl ) ) {
echo '
' . __( 'You are reading the newest post.', 'portage' ) . '
';
} else {
echo '
' . __( 'Read a newer post:', 'portage' ) . '
';
next_post_link();
}
}
// Display previous post link only if an older post exists
function portage_prev_post_link() {
$portage_ppl = get_previous_post_link();
if ( empty ( $portage_ppl ) ) {
echo '
>' . __( 'You are reading the oldest post.', 'portage' ) . '
';
} else {
echo '
' . __( 'Read an older post:', 'portage' ) . '
';
previous_post_link();
}
}
// Add the URL information when printing
function portage_print_url() {
echo '
';
printf(__( 'Link for this article:', 'portage' ) );
echo '
' . get_the_permalink() . '
';
}
// Add a "Read More" box on excerpts
function portage_read_more() {
echo '
';
printf(__( 'Read the complete article…', 'portage' ) );
echo '
';
}
// Take care of wp_link_pages
function portage_link_pages() {
$defaults = array(
'before' => '
' . __( 'This post has multiple pages:', 'portage' ),
'after' => '
',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'separator' => ' ',
'nextpagelink' => __( 'Next page', 'portage' ),
'previouspagelink' => __( 'Previous page', 'portage' ),
'pagelink' => '%',
'echo' => 1
);
wp_link_pages( $defaults );
}
// Print options
function portage_print_options() {
if ( get_theme_mod( 'portage_print_copyright' ) == '1' ) {
echo '
' .
get_theme_mod( 'portage_copyright', 'This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.' ) .
'';
}
if ( get_theme_mod( 'portage_print_url' ) == '1' ) {
echo '
';
printf(__( 'Permalink for this article:', 'portage' ) );
echo '
' . get_the_permalink() . '';
}
}
// Edit post link, if user is logged in
function portage_edit_post() {
if ( get_theme_mod( 'portage_edit_post_link' ) == '1' && is_user_logged_in() ) : {
edit_post_link('Edit this post', '', '
');
}
endif;
}
// Footer options
function portage_display_footer_copyright() {
if ( get_theme_mod( 'portage_display_copyright' ) == '1' ) : {
echo '';
}
endif;
}
function portage_display_footer_credits() {
if ( get_theme_mod( 'portage_display_credits') == '1' ) : {
$afwp = 'ClassicPress';
$afaf = 'Portage Theme';
echo '';
printf(__( 'Powered by %1$s and the %2$s.', 'portage' ), $afwp, $afaf );
echo '
';
}
endif;
}
// Custom CSS Option
function portage_custom_css_head() {
$afcss = get_theme_mod( 'portage_ccss' );
if ( !empty( $afcss ) ) {
echo '';
}
}
// Social Media
function portage_social_media_display() {
if ( get_theme_mod( 'portage_rss' ) == '1' ) {
echo '';
}
$aftw = get_theme_mod( 'portage_twitter' );
if ( !empty( $aftw ) ) {
echo '';
}
$aft2 = get_theme_mod( 'portage_twitter2' );
if ( !empty( $aft2 ) ) {
echo '';
}
$affb = get_theme_mod( 'portage_facebook' );
if ( !empty( $affb ) ) {
echo '';
}
$afig = get_theme_mod( 'portage_instagram' );
if ( !empty( $afig ) ) {
echo '';
}
$afyt = get_theme_mod( 'portage_youtube' );
if ( !empty( $afyt ) ) {
echo '';
}
$afyt = get_theme_mod( 'portage_pinterest' );
if ( !empty( $afyt ) ) {
echo '';
}
$afam = get_theme_mod( 'portage_amazon' );
if ( !empty( $afam ) ) {
echo '';
}
$afpa = get_theme_mod( 'portage_patreon' );
if ( !empty( $afpa ) ) {
echo '';
}
$afpp = get_theme_mod( 'portage_paypal' );
if ( !empty( $afpp ) ) {
echo '';
}
}
// Mobile Top Link Options
function portage_footer_top_link() {
if ( get_theme_mod( 'portage_footer_top_link' ) == 1 ) {
echo '';
_e( 'Return to Top', 'portage' );
echo '';
} else {
return;
}
}
function portage_post_top_link() {
if ( get_theme_mod( 'portage_post_top_link' ) == 1 ) {
echo '';
_e( 'Return to Top', 'portage' );
echo '';
} else {
return;
}
}