* @copyright Copyright (c) 2019, AeonWP
* @link https://aeonwp.com/aeonblog
* @license http://www.gnu.org/licenses/gpl-2.0.html
*/
if ( ! function_exists( 'aeonblog_about_user' ) ) {
/**
* Displays the About section.
*/
function aeonblog_about_user() {
global $aeonblog_theme_options;
$enable_about = absint( $aeonblog_theme_options['aeonblog-enable-about'] );
if ( $enable_about === 1 ) {
$about_users = absint( $aeonblog_theme_options['aeonblog_about_user'] );
$aeonblog_featured_user = get_user_by( 'ID', $about_users );
if ( ! empty( $aeonblog_featured_user ) && is_front_page() && ! is_paged() ) {
echo '';
}
}
}
if ( ! function_exists( 'aeonblog_header_image' ) ) {
/**
* Displays the custom header image below the navigation menu.
*/
function aeonblog_header_image() {
$has_header_image = has_header_image();
if ( ! empty( $has_header_image ) ) {
?>
";
global $wp_query;
$big = 999999999; // Need an unlikely integer.
echo paginate_links(
array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $wp_query->max_num_pages,
'prev_text' => __( '« Prev', 'aeonblog' ),
'next_text' => __( 'Next »', 'aeonblog' ),
)
);
echo '';
}
}
}
add_action( 'aeonblog_action_navigation', 'aeonblog_posts_navigation', 10 );
if ( ! function_exists( 'aeonblog_related_post' ) ) {
/**
* Display related posts from same category
*
* @since AeonBlog 1.0.0
*
* @param int $post_id
* @return void
*/
function aeonblog_related_post( $post_id ) {
global $aeonblog_theme_options;
if ( 0 == $aeonblog_theme_options['aeonblog-related-post'] ) {
return;
}
$categories = get_the_category( $post_id );
if ( $categories ) {
$category_ids = array();
$category = get_category( $category_ids );
$categories = get_the_category( $post_id );
foreach ( $categories as $category ) {
$category_ids[] = $category->term_id;
}
$count = $category->category_count;
if ( $count > 1 ) {
?>
manager->get_control( $setting->id )->choices;
// If the input is a valid key, return it; otherwise, return the default.
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
}