Server : nginx/1.20.1 System : Linux ccpf-production-2021 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 User : forge ( 1000) PHP Version : 7.4.21 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /home/forge/gcc-ccpf.com/wp-content/themes/labora/ |
<?php
/**
* Display an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index
* views, or a div element when on single views.
*
*/
if ( ! function_exists( 'labora_post_metadata' ) ) {
/**
* Print HTML with meta information for the current post-date/time and author.
*/
function labora_post_metadata() {
if ( is_sticky() && is_home() && ! is_paged() ) {
echo '<span class="iva-pm-featured featured-post"><i class="fa fa-bookmark-o fa-fw"></i></span>';
}
echo '<span class="iva-pm-poston">' . get_the_date() . '</span>';
// Set up and print post meta information.
echo '<span class="iva-pm-byauthor">' . esc_html__( 'Posted by: ', 'labora' ) . ' <a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>';
if ( get_the_category_list() ) {
echo '<span class="iva-pm-postin">' . esc_html__( 'Category: ', 'labora' ) . ' ' . wp_kses_post( get_the_category_list( esc_html__( ' • ', 'labora' ) ) ) . '</span>';
}
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="iva-pm-comments">';
comments_popup_link( esc_html__( 'No Comments', 'labora' ), esc_html__( '1 Comment', 'labora' ), esc_html__( '% Comments', 'labora' ) );
echo '</span>';
}
echo '<span class="meta-likes">' . wp_kses_post( labora_post_like( 'iva_like' ) ) . '</span>';
}
}
if ( ! function_exists( 'labora_pagination' ) ) :
/**
* Display navigation to next/previous set of posts when applicable.
*
* @since hopes 1.0
*/
function labora_pagination() {
// Don't print empty markup if there's only one page.
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$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/' : '';
$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';
// Set up paginated links.
$links = paginate_links( array(
'base' => $pagenum_link,
'format' => $format,
'total' => $GLOBALS['wp_query']->max_num_pages,
'current' => $paged,
'mid_size' => 1,
'add_args' => array_map( 'urlencode', $query_args ),
'prev_text' => '<i class="fa fa-chevron-left"></i>',
'next_text' => '<i class="fa fa-chevron-right"></i>',
) );
if ( $links ) {
$out = '<nav class="navigation paging-navigation">';
$out .= '<div class="pagination loop-pagination">';
$out .= $links;
$out .= '</div>';
$out .= '</nav>';
}
echo wp_kses_post( $out );
}
endif;
if ( ! function_exists( 'labora_body_class' ) ) {
function labora_body_class( $classes ) {
if (
is_tag() ||
is_search() ||
is_404() ||
is_home()
) {
$labora_frontpageid = '';
} else {
if ( class_exists( 'woocommerce' ) ) {
if ( is_shop() ) {
$labora_frontpageid = get_option( 'woocommerce_shop_page_id' );
} elseif ( is_cart( get_option( 'woocommerce_cart_page_id' ) ) ) {
$labora_frontpageid = get_option( 'woocommerce_cart_page_id' );
} else {
$labora_frontpageid = get_the_ID();
}
} else {
$labora_frontpageid = get_the_ID();
}
}
$labora_pageslider = get_post_meta( $labora_frontpageid, 'page_slider', true );
$labora_sidebar_layout = labora_generator( 'labora_sidebar_option', $labora_frontpageid );
$labora_page_layout = get_post_meta( $labora_frontpageid, 'labora_page_layout', true );
if ( '' !== $labora_pageslider ) {
$sliderclass = 'iva-page_slider';
} else {
$sliderclass = '';
}
$classes[] = $labora_sidebar_layout;
$classes[] = $sliderclass;
$headerstyle = get_option('labora_headerstyle','default');
if( ($headerstyle == 'verticalleftmenu') || is_page(3490) ) {
$classes[]= 'vertical_leftmenu';
}
if( $labora_page_layout === 'on' ) {
$classes[]= 'boxed';
} else {
$classes[]= get_option( 'labora_layoutoption' ) ? get_option( 'labora_layoutoption' ) : 'stretched';
}
return $classes;
}
}
add_filter( 'body_class', 'labora_body_class' );
// post class
function labora_post_classes( $classes, $class, $post_id ) {
if ( is_single() ) {
$classes[] = 'singlepost';
}
if ( is_singular( 'gallery' ) ) {
$classes[] = 'custompost-single';
}
if ( is_singular( 'slider' ) ) {
$classes[] = 'post';
}
return $classes;
}
add_filter( 'post_class', 'labora_post_classes', 10, 3 );
/**
* Gallery Image lightbox
*/
if ( ! function_exists( 'labora_gallery_add_rel_attribute' ) ) {
function labora_gallery_add_rel_attribute( $link ) {
global $post;
return str_replace( '<a href', '<a data-rel="prettyPhoto[pp_default]" href', $link );
}
add_filter( 'wp_get_attachment_link', 'labora_gallery_add_rel_attribute' );
}
/**
* Sociables
*/
if ( ! function_exists( 'labora_sociables' ) ) {
function labora_sociables( $color ) {
$out = '';
if ( get_option( 'labora_social_bookmark' ) != '' ) {
$labora_social_bookmark_icons = explode( '#;', get_option( 'labora_social_bookmark' ) );
$out = '<div class="iva_socials">';
for ( $i = 0; $i < count( $labora_social_bookmark_icons ); $i++ ) {
$labora_social_icon = explode( '#|', $labora_social_bookmark_icons[ $i ] );
if ( $labora_social_icon[1] == '' ) {
$labora_social_icon[1] = '#';
}
if ( $color == 'black' ) {
$icon_color = '_bio';
} else {
$icon_color = '';
}
if ( $color == 'black' ) {
$out .= '<a class="at-social-link" href="' . esc_url( $labora_social_icon[2] ) . '" target="_blank">';
$out .= '<i class="fa fa-' . $labora_social_icon[1] . ' fa-fw" title="' . $labora_social_icon[0] . '"></i><span class="ttip">' . ucfirst( $labora_social_icon[1] ) . '</span></a>';
} else {
$out .= '<a class="at-social-link" href="' . esc_url( $labora_social_icon[2] ) . '" target="_blank">';
$out .= '<i class="fa fa-' . $labora_social_icon[1] . ' fa-fw white" title="' . $labora_social_icon[0] . '"></i><span class="ttip">' . ucfirst( $labora_social_icon[1] ) . '</span></a></li>';
}
} //End for
$out .= '</div>';
}
return $out;
}
}