'; echo '
'; get_sidebar(); echo '
'; echo ''; } } } /* * Generate pagination */ if ( ! function_exists( 'amy_xmas_pagination' ) ) { function amy_xmas_pagination( $args = array() ) { if ( is_front_page() || is_home() ) { $paged = (get_query_var( 'paged' )) ? intval( get_query_var( 'paged' ) ) : intval( get_query_var( 'page' ) ); } else if ( is_single() ) { $paged = (get_query_var( 'paged' )) ? intval( get_query_var( 'paged' ) ) : intval( get_query_var( 'page' ) ); } else { $paged = intval( get_query_var( 'paged' ) ); } $paged = $paged ? $paged : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) { $pagenum_link = $args['current_url']; } $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; if ( is_single() ) { $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( '%#%', 'paged' ) : '?paged=%#%'; } else { $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; } if ( is_single() && $paged > 1 ) { $page_arr = explode( '/', $pagenum_link ); $str_p = count( $page_arr ) - 2; unset( $page_arr[ str_p ] ); $pagenum_link = implode( '/', $page_arr ); } $links = paginate_links(array( 'base' => $pagenum_link, 'format' => $format, 'total' => $args['max_pages'], 'current' => $paged, 'mid_size' => 1, 'type' => 'array', 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => esc_html__( 'Prev', 'amy-xmas' ), 'next_text' => esc_html__( 'Next', 'amy-xmas' ), )); if ( $links ) { $output = '
'; $output .= ''; } return $output; } } /** * Breadcrumb. */ if ( ! function_exists( 'amy_xmas_breadcrumb' ) ) { function amy_xmas_breadcrumb() { if ( function_exists( 'bcn_display' ) ) { echo '
'; echo bcn_display( true ); echo '
'; } } }