feat: initial ACRIB WordPress deployment

- WordPress 6.9.4 (es_ES) with Kadence theme
- Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto
- Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold
- Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI)
- Plugins: Kadence Blocks, Polylang, Contact Form 7
- Custom CSS with full brand styling and responsive layout
- HTTPS enforced via wp-config.php proxy detection
This commit is contained in:
Malin
2026-05-19 19:25:59 +02:00
commit f3ff7b7186
6119 changed files with 1984255 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
/**
* The main archive template file for inner content.
*
* @package kadence
*/
namespace Kadence;
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<div id="main" class="site-main">
<?php
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_main_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
if ( have_posts() ) {
?>
<ul id="archive-container" class="<?php echo esc_attr( implode( ' ', get_archive_container_classes() ) ); ?>"<?php echo get_archive_infinite_attributes() ? " data-infinite-scroll='" . esc_attr( get_archive_infinite_attributes() ) . "'" : ''; ?>>
<?php
while ( have_posts() ) {
the_post();
/**
* Hook in loop entry template.
*/
do_action( 'kadence_loop_entry' );
}
?>
</ul>
<?php
get_template_part( 'template-parts/content/pagination' );
} else {
get_template_part( 'template-parts/content/error' );
}
/**
* Hook for anything after main content
*/
do_action( 'kadence_after_main_content' );
?>
</div><!-- #main -->
<?php
get_sidebar();
?>
</div>
</div><!-- #primary -->

View File

@@ -0,0 +1,34 @@
<?php
/**
* Template part for displaying the page header of the currently displayed page
*
* @package kadence
*/
namespace Kadence;
$slug = ( is_search() && ! is_post_type_archive( 'product' ) ? 'search' : get_post_type() );
if ( empty( $slug ) ) {
$queried_object = get_queried_object();
if ( is_object( $queried_object ) && property_exists( $queried_object, 'taxonomy' ) ) {
$current_tax = get_taxonomy( $queried_object->taxonomy );
if ( is_object( $current_tax ) && property_exists( $current_tax, 'object_type' ) ) {
$post_types = $current_tax->object_type;
$slug = $post_types[0];
}
}
}
?>
<header class="<?php echo esc_attr( implode( ' ', get_archive_title_classes() ) ); ?>">
<?php
do_action( 'kadence_archive_before_entry_header' );
/**
* Kadence Entry Header
*
* Hooked kadence_entry_header 10
*/
do_action( 'kadence_entry_archive_header', $slug . '_archive', 'normal' );
do_action( 'kadence_archive_after_entry_header' );
?>
</header><!-- .entry-header -->

View File

@@ -0,0 +1,38 @@
<?php
/**
* Template part for displaying a post's Hero header
*
* @package kadence
*/
namespace Kadence;
$slug = ( is_search() && ! is_post_type_archive( 'product' ) ? 'search' : get_post_type() );
if ( empty( $slug ) ) {
$queried_object = get_queried_object();
if ( is_object( $queried_object ) && property_exists( $queried_object, 'taxonomy' ) ) {
$current_tax = get_taxonomy( $queried_object->taxonomy );
if ( property_exists( $current_tax, 'object_type' ) ) {
$post_types = $current_tax->object_type;
$slug = $post_types[0];
}
}
}
?>
<section class="<?php echo esc_attr( implode( ' ', get_archive_hero_classes() ) ); ?>">
<div class="entry-hero-container-inner">
<div class="hero-section-overlay"></div>
<div class="hero-container site-container">
<header class="<?php echo esc_attr( implode( ' ', get_archive_title_classes() ) ); ?>">
<?php
/**
* Kadence Entry Hero
*
* Hooked kadence_entry_archive_header 10
*/
do_action( 'kadence_entry_archive_hero', $slug . '_archive', 'above' );
?>
</header><!-- .entry-header -->
</div>
</div>
</section><!-- .entry-hero -->

View File

@@ -0,0 +1,40 @@
<?php
/**
* Template part for displaying comments list.
*
* @package kadence
*/
namespace Kadence;
?>
<?php
if ( have_comments() ) {
do_action( 'kadence_before_comments_list' );
$title_output = '<h2 class="comments-title">';
$comment_count = (int) get_comments_number();
if ( 1 === $comment_count ) {
$title_output .= esc_html__( 'One Comment', 'kadence' );
} else {
$title_output .= sprintf(
/* translators: 1: comment count number */
esc_html( _nx( '%1$s Comment', '%1$s Comments', $comment_count, 'comments title', 'kadence' ) ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
number_format_i18n( $comment_count )
);
}
$title_output .= '</h2><!-- .comments-title -->';
echo wp_kses_post( apply_filters( 'kadence_single_post_comments_title', $title_output ) );
the_comments_navigation();
kadence()->the_comments();
if ( ! comments_open() ) {
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'kadence' ); ?></p>
<?php
}
do_action( 'kadence_after_comments_list' );
}

View File

@@ -0,0 +1,137 @@
<?php
/**
* Template part for displaying a post of post type 'attachment'
*
* @package kadence
*/
namespace Kadence;
if ( ! is_singular( 'attachment' ) ) {
?>
<article <?php post_class( 'entry content-bg loop-entry' ); ?>>
<?php
$defaults = array(
'enabled' => true,
'ratio' => '2-3',
'size' => 'medium_large',
'imageLink' => true,
);
$slug = ( is_search() ? 'search' : get_post_type() );
$feature_element = kadence()->option( $slug . '_archive_element_feature', $defaults );
if ( isset( $feature_element ) && is_array( $feature_element ) && true === $feature_element['enabled'] ) {
$feature_element = wp_parse_args( $feature_element, $defaults );
$ratio = ( isset( $feature_element['ratio'] ) && ! empty( $feature_element['ratio'] ) ? $feature_element['ratio'] : '2-3' );
$size = ( isset( $feature_element['size'] ) && ! empty( $feature_element['size'] ) ? $feature_element['size'] : 'medium_large' );
if ( isset( $feature_element['imageLink'] ) && ! $feature_element['imageLink'] ) {
?>
<div class="post-thumbnail kadence-thumbnail-ratio-<?php echo esc_attr( $ratio ); ?>">
<div class="post-thumbnail-inner">
<?php
echo wp_get_attachment_image(
get_the_ID(),
$size,
false,
array(
'alt' => the_title_attribute(
array(
'echo' => false,
)
),
)
);
?>
</div>
</div><!-- .post-thumbnail -->
<?php
} else {
?>
<a class="post-thumbnail kadence-thumbnail-ratio-<?php echo esc_attr( $ratio ); ?>" href="<?php the_permalink(); ?>">
<div class="post-thumbnail-inner">
<?php
echo wp_get_attachment_image(
get_the_ID(),
$size,
false,
array(
'alt' => the_title_attribute(
array(
'echo' => false,
)
),
)
);
?>
</div>
</a><!-- .post-thumbnail -->
<?php
}
}
?>
<div class="entry-content-wrap">
<?php
/**
* Hook for entry content.
*
* @hooked Kadence\loop_entry_header - 10
* @hooked Kadence\loop_entry_summary - 20
* @hooked Kadence\loop_entry_footer - 30
*/
do_action( 'kadence_loop_entry_content' );
?>
</div>
</article>
<?php
}
if ( is_singular( 'attachment' ) ) {
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'entry' ); ?>>
<?php get_template_part( 'template-parts/content/entry_header', get_post_type() ); ?>
<?php get_template_part( 'template-parts/content/entry_content', get_post_type() ); ?>
<?php get_template_part( 'template-parts/content/entry_footer', get_post_type() ); ?>
</article><!-- #post-<?php the_ID(); ?> -->
<?php
}
if ( is_singular( get_post_type() ) ) {
// Show attachment navigation only when the attachment has a parent.
if ( ! empty( $post->post_parent ) ) {
// TODO: There should be a WordPress core function for this, similar to `the_post_navigation()`.
$attachment_navigation = '';
ob_start();
previous_image_link( false );
$prev_link = ob_get_clean();
if ( ! empty( $prev_link ) ) {
$attachment_navigation .= '<div class="nav-previous">';
$attachment_navigation .= '<div class="post-navigation-sub"><span>' . esc_html__( 'Previous:', 'kadence' ) . '</span></div>';
$attachment_navigation .= $prev_link;
$attachment_navigation .= '</div>';
}
ob_start();
next_image_link( false );
$next_link = ob_get_clean();
if ( ! empty( $next_link ) ) {
$attachment_navigation .= '<div class="nav-next">';
$attachment_navigation .= '<div class="post-navigation-sub"><span>' . esc_html__( 'Next:', 'kadence' ) . '</span></div>';
$attachment_navigation .= $next_link;
$attachment_navigation .= '</div>';
}
if ( ! empty( $attachment_navigation ) ) {
echo _navigation_markup( $attachment_navigation, $class = 'post-navigation', __( 'Post navigation', 'kadence' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
// Show comments only when the post type supports it and when comments are open or at least one comment exists.
if ( post_type_supports( get_post_type(), 'comments' ) && ( comments_open() || get_comments_number() ) ) {
comments_template();
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* Template part for displaying a post
*
* @package kadence
*/
namespace Kadence;
?>
<article <?php post_class( 'entry content-bg loop-entry' ); ?>>
<?php
/**
* Hook for entry thumbnail.
*
* @hooked Kadence\loop_entry_thumbnail
*/
do_action( 'kadence_loop_entry_thumbnail' );
?>
<div class="entry-content-wrap">
<?php
/**
* Hook for entry content.
*
* @hooked Kadence\loop_entry_header - 10
* @hooked Kadence\loop_entry_summary - 20
* @hooked Kadence\loop_entry_footer - 30
*/
do_action( 'kadence_loop_entry_content' );
?>
</div>
</article>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Template part for displaying a post
*
* @package kadence
*/
namespace Kadence;
?>
<li class="entry-list-item">
<article <?php post_class( 'entry content-bg loop-entry' ); ?>>
<?php
/**
* Hook for entry thumbnail.
*
* @hooked Kadence\loop_entry_thumbnail
*/
do_action( 'kadence_loop_entry_thumbnail' );
?>
<div class="entry-content-wrap">
<?php
/**
* Hook for entry content.
*
* @hooked Kadence\loop_entry_header - 10
* @hooked Kadence\loop_entry_summary - 20
* @hooked Kadence\loop_entry_footer - 30
*/
do_action( 'kadence_loop_entry_content' );
?>
</div>
</article>
</li>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Template part for displaying a post's comment and edit links
*
* @package kadence
*/
namespace Kadence;
$slug = ( is_search() ? 'search' : get_post_type() );
$readmore_element = kadence()->option( $slug . '_archive_element_readmore', array(
'enabled' => true,
'label' => esc_html__( 'Read More', 'kadence' ),
) );
if ( isset( $readmore_element ) && is_array( $readmore_element ) && true === $readmore_element['enabled'] ) {
?>
<div class="entry-actions">
<p class="more-link-wrap">
<a href="<?php the_permalink(); ?>" class="post-more-link">
<?php
echo esc_html( isset( $readmore_element['label'] ) && ! empty( $readmore_element['label'] ) ? $readmore_element['label'] : __( 'Read More', 'kadence' ) );
echo wp_kses(
'<span class="screen-reader-text"> ' . get_the_title() . '</span>',
array(
'span' => array(
'class' => array(),
),
)
);
kadence()->print_icon( 'arrow-right-alt' );
?>
</a>
</p>
</div><!-- .entry-actions -->
<?php
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* Template part for displaying a post's footer
*
* @package kadence
*/
namespace Kadence;
use function Kadence\kadence;
use function get_the_author;
use function get_avatar;
use function get_the_author_meta;
use function the_author_meta;
use function get_the_author_posts_link;
kadence()->print_styles( 'kadence-author-box' );
$social_links_open_new_tab = kadence()->option( 'social_links_open_new_tab' );
?>
<div class="entry-author entry-author-style-<?php echo esc_attr( kadence()->option( 'post_author_box_style' ) ); ?><?php echo kadence()->option( 'post_footer_area_boxed' ) ? ' content-bg entry-content-wrap entry' : ''; ?>">
<div class="entry-author-profile author-profile vcard">
<div class="entry-author-avatar">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 80 ); ?>
</div>
<b class="entry-author-name author-name fn"><?php echo wp_kses_post( kadence()->option( 'post_author_box_link' ) ? get_the_author_posts_link() : get_the_author() ); ?></b>
<?php if ( get_the_author_meta( 'occupation' ) ) { ?>
<p class="entry-author-occupation author-occupation"><?php the_author_meta( 'occupation' ); ?></p>
<?php } ?>
<div class="entry-author-description author-bio">
<?php the_author_meta( 'description' ); ?>
</div>
<div class="entry-author-follow author-follow">
<?php
foreach ( [ 'facebook', 'twitter', 'instagram', 'threads', 'youtube', 'flickr', 'vimeo', 'linkedin', 'pinterest', 'dribbble', 'amazon', 'medium', 'goodreads', 'bookbub' ] as $social ) {
if ( get_the_author_meta( $social ) ) {
$url = get_the_author_meta( $social );
$name = 'twitter' === $social ? 'x formerly Twitter' : $social;
$icon = 'twitter' === $social ? 'twitterAlt2' : $social;
$icon = 'instagram' === $social ? 'instagramAlt' : $icon;
// Might need some special parsing if rank math is active.
if ( defined( 'RANK_MATH_VERSION' ) && ! str_contains( $url, '.com' ) ) {
if ( 'twitter' == $social ) {
$url = 'https://twitter.com/' . $url;
}
}
?>
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $social ); ?>-link social-button" target="<?php echo esc_attr( $social_links_open_new_tab ? '_blank' : '_self' ); ?>" rel="noopener" title="<?php /* translators: 1: Author Name, 2: Social Media Name */ printf( esc_attr__( 'Follow %1$s on %2$s', 'kadence' ), esc_attr( get_the_author_meta( 'display_name' ) ), esc_attr( ucfirst( $name ) ) ); ?>">
<?php kadence()->print_icon( $icon, '', false ); ?>
</a>
<?php
}
}
?>
</div><!--.author-follow-->
</div>
</div><!-- .entry-author -->

View File

@@ -0,0 +1,39 @@
<?php
/**
* Template part for displaying a post's content
*
* @package kadence
*/
namespace Kadence;
?>
<div class="<?php echo esc_attr( apply_filters( 'kadence_entry_content_class', 'entry-content single-content' ) ); ?>">
<?php
do_action( 'kadence_single_before_entry_content' );
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'kadence' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
)
);
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'kadence' ),
'after' => '</div>',
)
);
do_action( 'kadence_single_after_entry_content' );
?>
</div><!-- .entry-content -->

View File

@@ -0,0 +1,17 @@
<?php
/**
* Template part for displaying a post's footer
*
* @package kadence
*/
namespace Kadence;
?>
<footer class="entry-footer">
<?php
if ( 'post' === get_post_type() && kadence()->option( 'post_tags' ) ) {
get_template_part( 'template-parts/content/entry_tags', get_post_type() );
}
?>
</footer><!-- .entry-footer -->

View File

@@ -0,0 +1,31 @@
<?php
/**
* Template part for displaying a post's header
*
* @package kadence
*/
namespace Kadence;
$classes = array();
$classes[] = 'entry-header';
if ( is_singular( get_post_type() ) ) {
$classes[] = get_post_type() . '-title';
$classes[] = 'title-align-' . ( kadence()->sub_option( get_post_type() . '_title_align', 'desktop' ) ? kadence()->sub_option( get_post_type() . '_title_align', 'desktop' ) : 'inherit' );
$classes[] = 'title-tablet-align-' . ( kadence()->sub_option( get_post_type() . '_title_align', 'tablet' ) ? kadence()->sub_option( get_post_type() . '_title_align', 'tablet' ) : 'inherit' );
$classes[] = 'title-mobile-align-' . ( kadence()->sub_option( get_post_type() . '_title_align', 'mobile' ) ? kadence()->sub_option( get_post_type() . '_title_align', 'mobile' ) : 'inherit' );
}
?>
<header class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<?php
do_action( 'kadence_single_before_entry_header' );
/**
* Kadence Entry Header
*
* Hooked kadence_entry_header 10
*/
do_action( 'kadence_entry_header', get_post_type(), 'normal' );
do_action( 'kadence_single_after_entry_header' );
?>
</header><!-- .entry-header -->

View File

@@ -0,0 +1,35 @@
<?php
/**
* Template part for displaying a post's Hero header
*
* @package kadence
*/
namespace Kadence;
$classes = array();
$classes[] = 'entry-header';
if ( is_singular( get_post_type() ) ) {
$classes[] = get_post_type() . '-title';
$classes[] = 'title-align-' . ( kadence()->sub_option( get_post_type() . '_title_align', 'desktop' ) ? kadence()->sub_option( get_post_type() . '_title_align', 'desktop' ) : 'inherit' );
$classes[] = 'title-tablet-align-' . ( kadence()->sub_option( get_post_type() . '_title_align', 'tablet' ) ? kadence()->sub_option( get_post_type() . '_title_align', 'tablet' ) : 'inherit' );
$classes[] = 'title-mobile-align-' . ( kadence()->sub_option( get_post_type() . '_title_align', 'mobile' ) ? kadence()->sub_option( get_post_type() . '_title_align', 'mobile' ) : 'inherit' );
}
?>
<section class="entry-hero <?php echo esc_attr( get_post_type() ) . '-hero-section'; ?> <?php echo esc_attr( 'entry-hero-layout-' . kadence()->option( get_post_type() . '_title_inner_layout' ) ); ?>">
<div class="entry-hero-container-inner">
<div class="hero-section-overlay"></div>
<div class="hero-container site-container">
<header class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<?php
/**
* Kadence Entry Hero
*
* Hooked kadence_entry_header 10
*/
do_action( 'kadence_entry_hero', get_post_type(), 'above' );
?>
</header><!-- .entry-header -->
</div>
</div>
</section><!-- .entry-hero -->

View File

@@ -0,0 +1,15 @@
<?php
/**
* Template part for displaying a post's footer
*
* @package kadence
*/
namespace Kadence;
?>
<footer class="entry-footer">
<?php
get_template_part( 'template-parts/content/entry_actions', get_post_type() );
?>
</footer><!-- .entry-footer -->

View File

@@ -0,0 +1,23 @@
<?php
/**
* Template part for displaying a post's header
*
* @package kadence
*/
namespace Kadence;
?>
<header class="entry-header">
<?php
/**
* Hook for entry header.
*
* @hooked Kadence\loop_entry_taxonomies - 10
* @hooked Kadence\loop_entry_title - 20
* @hooked Kadence\loop_entry_meta - 30
*/
do_action( 'kadence_loop_entry_header' );
?>
</header><!-- .entry-header -->

View File

@@ -0,0 +1,330 @@
<?php
/**
* Template part for displaying a post's metadata
*
* @package kadence
*/
namespace Kadence;
global $post;
$defaults = array(
'id' => 'meta',
'enabled' => false,
'divider' => 'dot',
'author' => true,
'authorLink' => true,
'authorImage' => true,
'authorImageSize' => 25,
'authorEnableLabel' => true,
'authorLabel' => '',
'date' => true,
'dateTime' => false,
'dateEnableLabel' => false,
'dateLabel' => '',
'dateUpdated' => false,
'dateUpdatedTime' => false,
'dateUpdatedDifferent' => false,
'dateUpdatedEnableLabel' => false,
'dateUpdatedLabel' => '',
'categories' => false,
'categoriesEnableLabel' => false,
'categoriesLabel' => '',
'comments' => false,
'commentsCondition' => false,
);
$slug = ( is_search() ? 'search' : get_post_type() );
$elements = kadence()->option( $slug . '_archive_element_meta', $defaults );
$title_meta = array();
$meta_labels = array();
$meta_divider = 'dot';
$author_image = false;
$author_link = true;
$author_image_size = 25;
if ( isset( $elements ) && is_array( $elements ) && isset( $elements['enabled'] ) && false === $elements['enabled'] ) {
return;
}
if ( isset( $elements ) && is_array( $elements ) ) {
$elements = wp_parse_args( $elements, $defaults );
if ( isset( $elements['divider'] ) && $elements['divider'] ) {
$meta_divider = $elements['divider'];
}
if ( isset( $elements['author'] ) && $elements['author'] ) {
$title_meta[] = 'author';
if ( isset( $elements['authorEnableLabel'] ) && $elements['authorEnableLabel'] ) {
$meta_labels['author'] = ( isset( $elements['authorLabel'] ) && ! empty( $elements['authorLabel'] ) ? $elements['authorLabel'] : __( 'By', 'kadence' ) );
}
if ( isset( $elements['authorImage'] ) && $elements['authorImage'] ) {
$author_image = true;
}
if ( isset( $elements['authorLink'] ) && ! $elements['authorLink'] ) {
$author_link = false;
}
if ( isset( $elements['authorImageSize'] ) && $elements['authorImageSize'] ) {
$author_image_size = absint( $elements['authorImageSize'] );
}
}
if ( isset( $elements['date'] ) && $elements['date'] ) {
if ( isset( $elements['dateTime'] ) && $elements['dateTime'] ) {
$title_meta[] = 'dateTime';
} else {
$title_meta[] = 'date';
}
if ( isset( $elements['dateEnableLabel'] ) && $elements['dateEnableLabel'] ) {
$meta_labels['date'] = ( isset( $elements['dateLabel'] ) && ! empty( $elements['dateLabel'] ) ? $elements['dateLabel'] : __( 'Posted on', 'kadence' ) );
}
}
if ( isset( $elements['dateUpdated'] ) && $elements['dateUpdated'] ) {
if ( isset( $elements['dateUpdatedTime'] ) && $elements['dateUpdatedTime'] ) {
$title_meta[] = 'dateUpdatedTime';
} else {
$title_meta[] = 'dateUpdated';
}
if ( isset( $elements['dateUpdatedEnableLabel'] ) && $elements['dateUpdatedEnableLabel'] ) {
$meta_labels['dateUpdated'] = ( isset( $elements['dateUpdatedLabel'] ) && ! empty( $elements['dateUpdatedLabel'] ) ? $elements['dateUpdatedLabel'] : __( 'Updated on', 'kadence' ) );
}
}
if ( isset( $elements['categories'] ) && $elements['categories'] ) {
$title_meta[] = 'categories';
if ( isset( $elements['categoriesEnableLabel'] ) && $elements['categoriesEnableLabel'] ) {
$meta_labels['categories'] = ( isset( $elements['categoriesLabel'] ) && ! empty( $elements['categoriesLabel'] ) ? $elements['categoriesLabel'] : __( 'Posted in', 'kadence' ) );
}
}
if ( isset( $elements['comments'] ) && $elements['comments'] ) {
$title_meta[] = 'comments';
}
}
if ( empty( $title_meta ) ) {
return;
}
$item_id = get_the_ID();
$post_type_obj = get_post_type_object( get_post_type() );
?>
<div class="entry-meta entry-meta-divider-<?php echo esc_attr( $meta_divider ); ?>">
<?php
do_action( 'kadence_before_loop_entry_meta' );
foreach ( $title_meta as $title_meta_item ) {
switch ( $title_meta_item ) {
case 'author':
$author_string = '';
// Show author only if the post type supports it.
if ( post_type_supports( $post_type_obj->name, 'author' ) ) {
$author_id = get_post_field( 'post_author', get_the_ID() );
if ( $author_link ) {
if ( get_the_author_meta( 'url' ) && apply_filters( 'kadence_author_use_profile_link', true ) ) {
$author_string = sprintf(
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_the_author_meta( 'url', $author_id ) ),
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
} else {
$author_string = sprintf(
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_author_posts_url( $author_id ) ),
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
}
} else {
$author_string = sprintf(
'<span class="author vcard"><span class="fn n">%1$s</span></span>',
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
}
}
if ( ! empty( $author_string ) ) {
$author_output = '<span class="posted-by">';
if ( $author_image ) {
$author_output .= '<span class="author-avatar"' . ( $author_image_size && 25 !== $author_image_size ? ' style="width:' . esc_attr( $author_image_size ) . 'px; height:' . esc_attr( $author_image_size ) . 'px;"' : '' ) .'>';
if ( $author_link ) {
if ( get_the_author_meta( 'url' ) && apply_filters( 'kadence_author_use_profile_link', true ) ) {
$author_output .= sprintf(
'<a class="author-image" href="%1$s" aria-label="%2$s">%3$s</a>',
esc_url( get_the_author_meta( 'url', $author_id ) ),
esc_attr__( 'Author image', 'kadence' ),
get_avatar( $author_id, ( 2 * $author_image_size ) )
);
} else {
$author_output .= sprintf(
'<a class="author-image" href="%1$s" aria-label="%2$s">%3$s</a>',
esc_url( get_author_posts_url( $author_id ) ),
esc_attr__( 'Author image', 'kadence' ),
get_avatar( $author_id, $author_image_size )
);
}
} else {
$author_output .= sprintf(
'<span class="author-image">%1$s</span>',
get_avatar( $author_id, $author_image_size )
);
}
$author_output .= '<span class="image-size-ratio"></span>';
$author_output .= '</span>';
}
if ( isset( $meta_labels['author'] ) ) {
$author_output .= '<span class="meta-label">' . esc_html( $meta_labels['author'] ) . '</span>';
}
$author_output .= $author_string;
$author_output .= '</span>';
echo apply_filters( 'kadence_author_meta_output', $author_output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
break;
case 'date':
$time_string = '<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time><time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
if ( ! empty( $time_string ) ) {
?>
<span class="posted-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['date'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['date'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'dateTime':
$time_string = '<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s %3$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s %3$s</time><time class="updated" datetime="%4$s" itemprop="dateModified">%5$s %6$s</time>';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_html( get_the_time() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() ),
esc_html( get_the_modified_time() )
);
if ( ! empty( $time_string ) ) {
?>
<span class="posted-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['date'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['date'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'dateUpdated':
if ( isset( $elements['dateUpdatedDifferent'] ) && $elements['dateUpdatedDifferent'] && get_the_date() === get_the_modified_date() ) {
$time_string = '';
} else {
$time_string = sprintf(
'<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s</time>',
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
}
if ( ! empty( $time_string ) ) {
?>
<span class="updated-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['dateUpdated'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['dateUpdated'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'dateUpdatedTime':
$publish_time = get_the_time( 'U' ) + ( 60 * 5 );
if ( isset( $elements['dateUpdatedDifferent'] ) && $elements['dateUpdatedDifferent'] && $publish_time > get_the_modified_time( 'U' ) ) {
$time_string = '';
} else {
$time_string = sprintf(
'<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s %3$s</time>',
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() ),
esc_html( get_the_modified_time() )
);
}
if ( ! empty( $time_string ) ) {
?>
<span class="updated-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['dateUpdated'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['dateUpdated'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'categories':
if ( has_term( '', 'category' ) ) {
/* translators: separator between taxonomy terms */
$separator = _x( ', ', 'list item separator', 'kadence' );
?>
<span class="category-links">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'folder', '', false );
}
if ( isset( $meta_labels['categories'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['categories'] ) . '</span>';
}
echo '<span class="category-link-items">' . get_the_category_list( esc_html( $separator ), '', get_the_ID() ) . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'comments':
$show = true;
if ( isset( $elements['commentsCondition'] ) && $elements['commentsCondition'] && 0 == get_comments_number() ) {
$show = false;
}
if ( $show ) {
echo '<div class="meta-comments">';
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'commentsAlt', '', false );
}
echo '<a class="meta-comments-link anchor-scroll" href="' . esc_url( get_the_permalink() ) . '#comments">';
if ( '1' === get_comments_number() ) {
echo esc_html( get_comments_number() ) . ' ' . esc_html__( 'Comment', 'kadence' );
} else {
echo esc_html( get_comments_number() ) . ' ' . esc_html__( 'Comments', 'kadence' );
}
echo '</a>';
echo '</div>';
}
break;
}
}
do_action( 'kadence_after_loop_entry_meta' );
?>
</div><!-- .entry-meta -->
<?php

View File

@@ -0,0 +1,87 @@
<?php
/**
* Template part for displaying a post's category terms
*
* @package kadence
*/
namespace Kadence;
$slug = ( is_search() ? 'search' : get_post_type() );
$elements = kadence()->option( $slug . '_archive_element_categories' );
if ( isset( $elements ) && is_array( $elements ) && true === $elements['enabled'] ) {
$tax_slug = ( isset( $elements['taxonomy'] ) && ! empty( $elements['taxonomy'] ) ? $elements['taxonomy'] : 'category' );
if ( has_term( '', $tax_slug ) ) {
$divider = ( isset( $elements['divider'] ) && ! empty( $elements['divider'] ) ? $elements['divider'] : 'vline' );
$style = ( isset( $elements['style'] ) && ! empty( $elements['style'] ) ? $elements['style'] : 'normal' );
switch ( $divider ) {
case 'dot':
$separator = ' &middot; ';
break;
case 'slash':
/* translators: separator between taxonomy terms */
$separator = _x( ' / ', 'list item separator', 'kadence' );
break;
case 'dash':
/* translators: separator between taxonomy terms */
$separator = _x( ' - ', 'list item separator', 'kadence' );
break;
default:
/* translators: separator between taxonomy terms */
$separator = _x( ' | ', 'list item separator', 'kadence' );
break;
}
if ('pill' === $style ) {
$separator = ' ';
}
?>
<div class="entry-taxonomies">
<span class="category-links term-links category-style-<?php echo esc_attr( $style ); ?>">
<?php
if ( $tax_slug === 'category' ) {
$categories = get_the_terms(get_the_ID(), $tax_slug); // get_the_categories()
if( ! empty( $categories ) ) {
$category_html = '';
foreach ( $categories as $key => $category ) {
$color = get_term_meta( $category->term_id, 'archive_category_color', true );
$hover_color = get_term_meta( $category->term_id, 'archive_category_hover_color', true );
if ($color !== '' || $hover_color !== '') {
$category_html .= '<style>';
if ( $color !== '') {
$category_html .=
'.loop-entry.type-post .entry-taxonomies a.category-link-' . esc_attr( $category->slug ) . ' {
' . ( $style === 'pill' ? 'background-color' : 'color') . ': ' . esc_attr( $color ) . ';
}'
;
}
if ( $hover_color !== '') {
$category_html .=
'.loop-entry.type-post .entry-taxonomies a.category-link-' . esc_attr( $category->slug ) . ':hover {
' . ( $style === 'pill' ? 'background-color' : 'color') . ': ' . esc_attr( $hover_color ) . ';
}'
;
}
$category_html .= '</style>';
}
$category_html .= '<a href="' . esc_url( get_term_link( $category->term_id ) ) . '" class="category-link-' . esc_attr( $category->slug ) . '" rel="tag">' . esc_attr__( $category->name) . '</a>';
if ( $key < count($categories) - 1 ) {
$category_html .= esc_html( $separator );
}
}
echo $category_html;
}
} else {
echo get_the_term_list(get_the_ID(), $tax_slug, '', esc_html($separator), ''); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</span>
</div><!-- .entry-taxonomies -->
<?php
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* Template part for displaying a post's featured image
*
* @package kadence
*/
namespace Kadence;
if ( post_password_required() || ! post_type_supports( get_post_type(), 'thumbnail' ) || ! has_post_thumbnail() ) {
return;
}
$defaults = [
'enabled' => true,
'ratio' => '2-3',
'size' => 'medium_large',
'imageLink' => true,
];
$slug = ( is_search() ? 'search' : get_post_type() );
$feature_element = kadence()->option( $slug . '_archive_element_feature', $defaults );
if ( isset( $feature_element ) && is_array( $feature_element ) && true === $feature_element['enabled'] ) {
$feature_element = wp_parse_args( $feature_element, $defaults );
$ratio = ( isset( $feature_element['ratio'] ) && ! empty( $feature_element['ratio'] ) ? $feature_element['ratio'] : '2-3' );
$size = ( isset( $feature_element['size'] ) && ! empty( $feature_element['size'] ) ? $feature_element['size'] : 'medium_large' );
$thumbnail_id = get_post_thumbnail_id();
$alt = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
if ( isset( $feature_element['imageLink'] ) && ! $feature_element['imageLink'] ) {
?>
<div class="post-thumbnail kadence-thumbnail-ratio-<?php echo esc_attr( $ratio ); ?>">
<div class="post-thumbnail-inner">
<?php
the_post_thumbnail(
$size,
[
'alt' => ! empty( $alt ) ? $alt : the_title_attribute(
[
'echo' => false,
]
),
]
);
?>
</div>
</div><!-- .post-thumbnail -->
<?php
} else {
?>
<a aria-hidden="true" tabindex="-1" role="presentation" class="post-thumbnail kadence-thumbnail-ratio-<?php echo esc_attr( $ratio ); ?>" aria-label="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>">
<div class="post-thumbnail-inner">
<?php
the_post_thumbnail(
$size,
[
'alt' => ! empty( $alt ) ? $alt : the_title_attribute(
[
'echo' => false,
]
),
]
);
?>
</div>
</a><!-- .post-thumbnail -->
<?php
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Template part for displaying a post's title
*
* @package kadence
*/
namespace Kadence;
$slug = ( is_search() ? 'search' : get_post_type() );
$title_element = kadence()->option(
$slug . '_archive_element_title',
[
'enabled' => true,
]
);
if ( isset( $title_element ) && is_array( $title_element ) && true === $title_element['enabled'] ) {
if ( is_search() || is_archive() || is_home() ) {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
} else {
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
}
}

View File

@@ -0,0 +1,302 @@
<?php
/**
* Template part for displaying a post's metadata
*
* @package kadence
*/
namespace Kadence;
global $post;
$item_type = get_post_type();
$elements = kadence()->option( $item_type . '_title_element_meta' );
$title_meta = array();
$meta_labels = array();
$meta_divider = 'dot';
$author_image = false;
$author_link = true;
$author_image_size = 25;
if ( isset( $elements ) && is_array( $elements ) ) {
if ( isset( $elements['divider'] ) && $elements['divider'] ) {
$meta_divider = $elements['divider'];
}
if ( isset( $elements['author'] ) && $elements['author'] ) {
$title_meta[] = 'author';
if ( isset( $elements['authorEnableLabel'] ) && $elements['authorEnableLabel'] ) {
$meta_labels['author'] = ( isset( $elements['authorLabel'] ) && ! empty( $elements['authorLabel'] ) ? $elements['authorLabel'] : __( 'By', 'kadence' ) );
}
if ( isset( $elements['authorImage'] ) && $elements['authorImage'] ) {
$author_image = true;
}
if ( isset( $elements['authorLink'] ) && ! $elements['authorLink'] ) {
$author_link = false;
}
if ( isset( $elements['authorImageSize'] ) && $elements['authorImageSize'] ) {
$author_image_size = absint( $elements['authorImageSize'] );
}
}
if ( isset( $elements['date'] ) && $elements['date'] ) {
if ( isset( $elements['dateTime'] ) && $elements['dateTime'] ) {
$title_meta[] = 'dateTime';
} else {
$title_meta[] = 'date';
}
if ( isset( $elements['dateEnableLabel'] ) && $elements['dateEnableLabel'] ) {
$meta_labels['date'] = ( isset( $elements['dateLabel'] ) && ! empty( $elements['dateLabel'] ) ? $elements['dateLabel'] : __( 'Posted on', 'kadence' ) );
}
}
if ( isset( $elements['dateUpdated'] ) && $elements['dateUpdated'] ) {
if ( isset( $elements['dateUpdatedTime'] ) && $elements['dateUpdatedTime'] ) {
$title_meta[] = 'dateUpdatedTime';
} else {
$title_meta[] = 'dateUpdated';
}
if ( isset( $elements['dateUpdatedEnableLabel'] ) && $elements['dateUpdatedEnableLabel'] ) {
$meta_labels['dateUpdated'] = ( isset( $elements['dateUpdatedLabel'] ) && ! empty( $elements['dateUpdatedLabel'] ) ? $elements['dateUpdatedLabel'] : __( 'Updated on', 'kadence' ) );
}
}
if ( isset( $elements['categories'] ) && $elements['categories'] ) {
$title_meta[] = 'categories';
if ( isset( $elements['categoriesEnableLabel'] ) && $elements['categoriesEnableLabel'] ) {
$meta_labels['categories'] = ( isset( $elements['categoriesLabel'] ) && ! empty( $elements['categoriesLabel'] ) ? $elements['categoriesLabel'] : __( 'Posted in', 'kadence' ) );
}
}
if ( isset( $elements['comments'] ) && $elements['comments'] ) {
$title_meta[] = 'comments';
}
}
if ( empty( $title_meta ) ) {
return;
}
$item_id = get_the_ID();
$post_type_obj = get_post_type_object( get_post_type() );
?>
<div class="entry-meta entry-meta-divider-<?php echo esc_attr( $meta_divider ); ?>">
<?php
do_action( 'kadence_before_entry_meta' );
foreach ( $title_meta as $title_meta_item ) {
switch ( $title_meta_item ) {
case 'author':
$author_string = '';
// Show author only if the post type supports it.
if ( post_type_supports( $post_type_obj->name, 'author' ) ) {
$author_id = get_post_field( 'post_author', get_the_ID() );
if ( $author_link ) {
if ( get_the_author_meta( 'url' ) && apply_filters( 'kadence_author_use_profile_link', true ) ) {
$author_string = sprintf(
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_the_author_meta( 'url', $author_id ) ),
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
} else {
$author_string = sprintf(
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_author_posts_url( $author_id ) ),
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
}
} else {
$author_string = sprintf(
'<span class="author vcard"><span class="fn n">%1$s</span></span>',
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
}
}
if ( ! empty( $author_string ) ) {
$author_output = '<span class="posted-by">';
if ( $author_image ) {
$author_output .= '<span class="author-avatar"' . ( $author_image_size && 25 !== $author_image_size ? ' style="width:' . esc_attr( $author_image_size ) . 'px; height:' . esc_attr( $author_image_size ) . 'px;"' : '' ) . '>';
if ( $author_link ) {
if ( get_the_author_meta( 'url' ) && apply_filters( 'kadence_author_use_profile_link', true ) ) {
$author_output .= sprintf(
'<a class="author-image" href="%1$s" aria-label="%2$s">%3$s</a>',
esc_url( get_the_author_meta( 'url', $author_id ) ),
esc_attr__( 'Author image', 'kadence' ),
get_avatar( $author_id, ( 2 * $author_image_size ) )
);
} else {
$author_output .= sprintf(
'<a class="author-image" href="%1$s" aria-label="%2$s">%3$s</a>',
esc_url( get_author_posts_url( $author_id ) ),
esc_attr__( 'Author image', 'kadence' ),
get_avatar( $author_id, ( 2 * $author_image_size ) )
);
}
} else {
$author_output .= sprintf(
'<span class="author-image">%1$s</span>',
get_avatar( $author_id, ( 2 * $author_image_size ) )
);
}
$author_output .= '<span class="image-size-ratio"></span>';
$author_output .= '</span>';
}
if ( isset( $meta_labels['author'] ) ) {
$author_output .= '<span class="meta-label">' . esc_html( $meta_labels['author'] ) . '</span>';
}
$author_output .= $author_string;
$author_output .= '</span>';
echo apply_filters( 'kadence_author_meta_output', $author_output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
break;
case 'date':
$time_string = '<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time><time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
if ( ! empty( $time_string ) ) {
?>
<span class="posted-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['date'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['date'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'dateTime':
$time_string = '<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s %3$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s %3$s</time><time class="updated" datetime="%4$s" itemprop="dateModified">%5$s %6$s</time>';
}
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_html( get_the_time() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() ),
esc_html( get_the_modified_time() )
);
if ( ! empty( $time_string ) ) {
?>
<span class="posted-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['date'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['date'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'dateUpdated':
if ( isset( $elements['dateUpdatedDifferent'] ) && $elements['dateUpdatedDifferent'] && get_the_date() === get_the_modified_date() ) {
$time_string = '';
} else {
$time_string = sprintf(
'<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s</time>',
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
}
if ( ! empty( $time_string ) ) {
?>
<span class="updated-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['dateUpdated'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['dateUpdated'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'dateUpdatedTime':
$publish_time = get_the_time( 'U' ) + ( 60 * 5 );
if ( isset( $elements['dateUpdatedDifferent'] ) && $elements['dateUpdatedDifferent'] && $publish_time > get_the_modified_time( 'U' ) ) {
$time_string = '';
} else {
$time_string = sprintf(
'<time class="entry-date published updated" datetime="%1$s" itemprop="dateModified">%2$s %3$s</time>',
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() ),
esc_html( get_the_modified_time() )
);
}
if ( ! empty( $time_string ) ) {
?>
<span class="updated-on">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'hoursAlt', '', false );
}
if ( isset( $meta_labels['dateUpdated'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['dateUpdated'] ) . '</span>';
}
echo $time_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'categories':
if ( has_term( '', 'category' ) ) {
/* translators: separator between taxonomy terms */
$separator = _x( ', ', 'list item separator', 'kadence' );
?>
<span class="category-links">
<?php
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'folder', '', false );
}
if ( isset( $meta_labels['categories'] ) ) {
echo '<span class="meta-label">' . esc_html( $meta_labels['categories'] ) . '</span>';
}
echo '<span class="category-link-items">' . get_the_category_list( esc_html( $separator ), '', get_the_ID() ) . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</span>
<?php
}
break;
case 'comments':
$show = true;
if ( isset( $elements['commentsCondition'] ) && $elements['commentsCondition'] && 0 == get_comments_number() ) {
$show = false;
}
if ( $show ) {
echo '<div class="meta-comments">';
if ( 'customicon' === $meta_divider ) {
kadence()->print_icon( 'commentsAlt', '', false );
}
echo '<a class="meta-comments-link anchor-scroll" href="#comments">';
if ( '1' === get_comments_number() ) {
echo esc_html( get_comments_number() ) . ' ' . esc_html__( 'Comment', 'kadence' );
} else {
echo esc_html( get_comments_number() ) . ' ' . esc_html__( 'Comments', 'kadence' );
}
echo '</a>';
echo '</div>';
}
break;
}
}
do_action( 'kadence_after_entry_meta' );
?>
</div><!-- .entry-meta -->
<?php

View File

@@ -0,0 +1,56 @@
<?php
/**
* Template part for displaying a post's footer
*
* @package kadence
*/
namespace Kadence;
use WP_Query;
use function apply_filters;
use function Kadence\kadence;
use function get_template_part;
kadence()->print_styles( 'kadence-related-posts' );
kadence()->print_styles( 'kad-splide' );
wp_enqueue_script( 'kadence-slide-init' );
$args = get_related_posts_args( $post->ID );
$cols = get_related_posts_columns();
$columns_class = apply_filters( 'kadence_related_posts_columns_class', ( 2 === $cols['xxl'] ? 'grid-sm-col-2 grid-lg-col-2' : 'grid-sm-col-2 grid-lg-col-3' ) );
$bpc = new WP_Query( apply_filters( 'kadence_related_posts_carousel_args', $args ) );
if ( $bpc ) :
$num = $bpc->post_count;
if ( $num > 0 ) {
?>
<div class="entry-related alignfull entry-related-style-<?php echo esc_attr( kadence()->option( 'post_related_style' ) ); ?>">
<div class="entry-related-inner content-container site-container">
<div class="entry-related-inner-content alignwide">
<?php
$related_title_option = esc_html( do_shortcode( kadence()->option( 'post_related_title' ) ) );
$related_title = $related_title_option ? $related_title_option : esc_html__( 'Similar Posts', 'kadence' );
echo wp_kses_post( apply_filters( 'kadence_single_post_similar_posts_title', '<h2 class="entry-related-title" id="related-posts-title">' . $related_title . '</h2>' ) );
?>
<div class="entry-related-carousel kadence-slide-init splide" aria-labelledby="related-posts-title" data-columns-xxl="<?php echo esc_attr( $cols['xxl'] ); ?>" data-columns-xl="<?php echo esc_attr( $cols['xl'] ); ?>" data-columns-md="<?php echo esc_attr( $cols['md'] ); ?>" data-columns-sm="<?php echo esc_attr( $cols['sm'] ); ?>" data-columns-xs="<?php echo esc_attr( $cols['xs'] ); ?>" data-columns-ss="<?php echo esc_attr( $cols['ss'] ); ?>" data-slider-anim-speed="400" data-slider-scroll="1" data-slider-dots="<?php echo esc_attr( kadence()->option( 'post_related_carousel_dots' ) ? 'true' : 'false' ); ?>" data-slider-arrows="true" data-slider-hover-pause="false" data-slider-auto="<?php echo esc_attr( apply_filters( 'kadence_single_post_similar_posts_carousel_autoplay', false ) ? 'true' : 'false' ); ?>" data-slider-speed="7000" data-slider-gutter="40" data-slider-loop="<?php echo esc_attr( kadence()->option( 'post_related_carousel_loop' ) ? 'true' : 'false' ); ?>" data-slider-next-label="<?php echo esc_attr__( 'Next', 'kadence' ); ?>" data-slider-slide-label="<?php echo esc_attr__( 'Posts', 'kadence' ); ?>" data-slider-prev-label="<?php echo esc_attr__( 'Previous', 'kadence' ); ?>">
<div class="splide__track">
<ul class="splide__list kadence-posts-list grid-cols <?php echo esc_attr( $columns_class ); ?>">
<?php
while ( $bpc->have_posts() ) :
$bpc->the_post();
echo '<li class="entry-list-item carousel-item splide__slide">';
get_template_part( 'template-parts/content/entry-related', get_post_type() );
echo '</li>';
endwhile;
?>
</ul>
</div>
</div>
</div>
</div>
</div><!-- .entry-author -->
<?php
}
endif;
wp_reset_postdata();

View File

@@ -0,0 +1,41 @@
<?php
/**
* Template part for displaying a post's summary
*
* @package kadence
*/
namespace Kadence;
use function get_post_type;
use function the_content;
use function the_excerpt;
$slug = ( is_search() ? 'search' : get_post_type() );
$excerpt_element = kadence()->option( $slug . '_archive_element_excerpt' );
if ( isset( $excerpt_element ) && is_array( $excerpt_element ) && true === $excerpt_element['enabled'] ) {
?>
<div class="entry-summary">
<?php
if ( true === kadence()->sub_option( $slug . '_archive_element_excerpt', 'fullContent' ) ) {
global $more; $more = 0;
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Read More<span class="screen-reader-text"> "%s"</span>', 'kadence' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
)
);
} else {
the_excerpt();
}
?>
</div><!-- .entry-summary -->
<?php
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* Template part for displaying a post's footer
*
* @package kadence
*/
namespace Kadence;
$tags = get_the_tags();
if ( ! is_array( $tags ) ) {
return;
}
?>
<div class="entry-tags">
<span class="tags-links">
<span class="tags-label screen-reader-text">
<?php echo esc_html__( 'Post Tags:', 'kadence' ); ?>
</span>
<?php
foreach ( $tags as $tag_item ) {
$tag_link = get_tag_link( $tag_item->term_id );
echo '<a href=' . esc_url( $tag_link ) . ' title="' . esc_attr( $tag_item->name ) . '" class="tag-link tag-item-' . esc_attr( $tag_item->slug ) . '" rel="tag"><span class="tag-hash">#</span>' . esc_html( $tag_item->name ) . '</a>';
}
?>
</span>
</div><!-- .entry-tags -->

View File

@@ -0,0 +1,44 @@
<?php
/**
* Template part for displaying a post's category terms
*
* @package kadence
*/
namespace Kadence;
$elements = kadence()->option( get_post_type() . '_title_element_categories' );
if ( isset( $elements ) && is_array( $elements ) && true === $elements['enabled'] ) {
$tax_slug = ( isset( $elements['taxonomy'] ) && ! empty( $elements['taxonomy'] ) ? $elements['taxonomy'] : 'category' );
if ( has_term( '', $tax_slug ) ) {
$divider = ( isset( $elements['divider'] ) && ! empty( $elements['divider'] ) ? $elements['divider'] : 'vline' );
$style = ( isset( $elements['style'] ) && ! empty( $elements['style'] ) ? $elements['style'] : 'normal' );
switch ( $divider ) {
case 'dot':
$separator = ' &middot; ';
break;
case 'slash':
/* translators: separator between taxonomy terms */
$separator = _x( ' / ', 'list item separator', 'kadence' );
break;
case 'dash':
/* translators: separator between taxonomy terms */
$separator = _x( ' - ', 'list item separator', 'kadence' );
break;
default:
/* translators: separator between taxonomy terms */
$separator = _x( ' | ', 'list item separator', 'kadence' );
break;
}
if ( 'pill' === $style ) {
$separator = ' ';
}
?>
<div class="entry-taxonomies">
<span class="category-links term-links category-style-<?php echo esc_attr( $style ); ?>">
<?php echo get_the_term_list( get_the_ID(), $tax_slug, '', esc_html( $separator ), '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</span>
</div><!-- .entry-taxonomies -->
<?php
}
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* Template part for displaying a post's featured image
*
* @package kadence
*/
namespace Kadence;
// Audio or video attachments can have featured images, so they need to be specifically checked.
$support_slug = get_post_type();
if ( 'attachment' === $support_slug ) {
if ( wp_attachment_is( 'audio' ) ) {
$support_slug .= ':audio';
} elseif ( wp_attachment_is( 'video' ) ) {
$support_slug .= ':video';
}
}
if ( post_password_required() || ! post_type_supports( $support_slug, 'thumbnail' ) || ! has_post_thumbnail() ) {
return;
}
if ( is_singular( get_post_type() ) ) {
?>
<div class="post-thumbnail article-post-thumbnail kadence-thumbnail-position-<?php echo esc_attr( kadence()->get_feature_position() ); ?><?php echo ( 'behind' === kadence()->get_feature_position() ? ' align' . esc_attr( kadence()->option( 'post_feature_width', 'wide' ) ) : '' ); ?> kadence-thumbnail-ratio-<?php echo esc_attr( kadence()->option( $support_slug . '_feature_ratio', '2-3' ) ); ?>">
<div class="post-thumbnail-inner">
<?php the_post_thumbnail( apply_filters( 'kadence_single_featured_image_size', 'full' ), array( 'class' => 'post-top-featured') ); ?>
</div>
</div><!-- .post-thumbnail -->
<?php
if ( 'behind' !== kadence()->get_feature_position() && kadence()->option( $support_slug . '_feature_caption', false ) ) {
$caption = get_the_post_thumbnail_caption();
if ( ! empty( $caption ) ) {
echo '<div class="article-post-thumbnail-caption content-bg">' . wp_kses_post( $caption ) . '</div>';
}
}
?>
<?php do_action( 'kadence_single_after_featured_image' ); ?>
<?php
} else {
?>
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
<div class="post-thumbnail-inner">
<?php
global $wp_query;
$thumbnail_id = get_post_thumbnail_id();
$alt = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
if ( 0 === $wp_query->current_post ) {
the_post_thumbnail(
'post-thumbnail',
array(
'class' => 'post-top-featured',
'alt' => ! empty( $alt ) ? $alt : the_title_attribute(
array(
'echo' => false,
)
),
)
);
} else {
the_post_thumbnail(
'post-thumbnail',
array(
'alt' => ! empty( $alt ) ? $alt : the_title_attribute(
array(
'echo' => false,
)
),
)
);
}
?>
</div>
</a><!-- .post-thumbnail -->
<?php do_action( 'kadence_loop_after_featured_image' ); ?>
<?php
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Template part for displaying a post's title
*
* @package kadence
*/
namespace Kadence;
do_action( 'kadence_single_before_entry_title' );
the_title( '<h1 class="entry-title">', '</h1>' );
do_action( 'kadence_single_after_entry_title' );

View File

@@ -0,0 +1,32 @@
<?php
/**
* Template part for displaying the page content when a 404 error has occurred
*
* @package kadence
*/
namespace Kadence;
?>
<section class="error">
<div class="page-content entry content-bg">
<div class="entry-content-wrap">
<?php
do_action( 'kadence_404_before_inner_content' );
get_template_part( 'template-parts/content/page_header' ); ?>
<p>
<?php esc_html_e( 'It looks like nothing was found at this location. Maybe try a search?', 'kadence' ); ?>
</p>
<?php
get_search_form();
do_action( 'kadence_404_after_inner_content' );
?>
</div>
</div><!-- .page-content -->
</section><!-- .error -->

View File

@@ -0,0 +1,32 @@
<?php
/**
* Template part for displaying the page content when a 500 error has occurred
*
* @package kadence
*/
namespace Kadence;
?>
<section class="error">
<div class="page-content entry content-bg">
<div class="entry-content-wrap">
<header class="page-header">
<h1 class="page-title">
<?php esc_html_e( 'Oops! Something went wrong.', 'kadence' ); ?>
</h1>
</header><!-- .page-header -->
<?php
if ( function_exists( 'wp_service_worker_error_message_placeholder' ) ) {
wp_service_worker_error_message_placeholder();
}
if ( function_exists( 'wp_service_worker_error_details_template' ) ) {
wp_service_worker_error_details_template();
}
?>
</div><!-- .entry-content-wrap -->
</div><!-- .page-content -->
</section><!-- .error -->

View File

@@ -0,0 +1,25 @@
<?php
/**
* Template part for displaying the page content when an offline error has occurred
*
* @package kadence
*/
namespace Kadence;
?>
<section class="error">
<header class="page-header">
<h1 class="page-title">
<?php esc_html_e( 'Oops! It looks like you&#8217;re offline.', 'kadence' ); ?>
</h1>
</header><!-- .page-header -->
<div class="page-content">
<?php
if ( function_exists( 'wp_service_worker_error_message_placeholder' ) ) {
wp_service_worker_error_message_placeholder();
}
?>
</div><!-- .page-content -->
</section><!-- .error -->

View File

@@ -0,0 +1,50 @@
<?php
/**
* Template part for displaying the page content when an error has occurred
*
* @package kadence
*/
namespace Kadence;
?>
<section class="error">
<div class="page-content">
<?php
if ( is_home() && current_user_can( 'publish_posts' ) ) {
?>
<p>
<?php
printf(
wp_kses(
/* translators: 1: link to WP admin new post page. */
__( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'kadence' ),
array(
'a' => array(
'href' => array(),
),
)
),
esc_url( admin_url( 'post-new.php' ) )
);
?>
</p>
<?php
} elseif ( is_search() ) {
?>
<p>
<?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'kadence' ); ?>
</p>
<?php
} else {
?>
<p>
<?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'kadence' ); ?>
</p>
<?php
}
get_search_form();
?>
</div><!-- .page-content -->
</section><!-- .error -->

View File

@@ -0,0 +1,57 @@
<?php
/**
* Template part for displaying the page header of the currently displayed page
*
* @package kadence
*/
namespace Kadence;
if ( is_404() ) {
?>
<header class="page-header">
<h1 class="page-title">
<?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'kadence' ); ?>
</h1>
</header><!-- .page-header -->
<?php
} elseif ( is_home() && ! have_posts() ) {
?>
<header class="page-header">
<h1 class="page-title">
<?php esc_html_e( 'Nothing Found', 'kadence' ); ?>
</h1>
</header><!-- .page-header -->
<?php
} elseif ( is_home() && ! is_front_page() ) {
?>
<header class="page-header">
<h1 class="page-title">
<?php single_post_title(); ?>
</h1>
</header><!-- .page-header -->
<?php
} elseif ( is_search() ) {
?>
<header class="page-header">
<h1 class="page-title">
<?php
printf(
/* translators: %s: search query */
esc_html__( 'Search Results for: %s', 'kadence' ),
'<span>' . get_search_query() . '</span>'
);
?>
</h1>
</header><!-- .page-header -->
<?php
} elseif ( is_archive() ) {
?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* Template part for displaying a pagination
*
* @package kadence
*/
namespace Kadence;
the_posts_pagination(
apply_filters(
'kadence_pagination_args',
array(
'mid_size' => 2,
'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Page', 'kadence' ) . '</span>' . kadence()->get_icon( 'arrow-left', _x( 'Previous', 'previous set of archive results', 'kadence' ) ),
'next_text' => '<span class="screen-reader-text">' . __( 'Next Page', 'kadence' ) . '</span>' . kadence()->get_icon( 'arrow-right', _x( 'Next', 'next set of archive results', 'kadence' ) ),
'screen_reader_text' => __( 'Page navigation', 'kadence' ),
)
)
);

View File

@@ -0,0 +1,73 @@
<?php
/**
* Template part for displaying a post or page.
*
* @package kadence
*/
namespace Kadence;
?>
<?php
if ( kadence()->show_feature_above() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'entry content-bg single-entry' . ( kadence()->option( 'post_footer_area_boxed' ) ? ' post-footer-area-boxed' : '' ) ); ?>>
<div class="entry-content-wrap">
<?php
do_action( 'kadence_single_before_inner_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/entry_header', get_post_type() );
}
if ( kadence()->show_feature_below() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
get_template_part( 'template-parts/content/entry_content', get_post_type() );
if ( 'post' === get_post_type() && kadence()->option( 'post_tags' ) ) {
get_template_part( 'template-parts/content/entry_footer', get_post_type() );
}
do_action( 'kadence_single_after_inner_content' );
?>
</div>
</article><!-- #post-<?php the_ID(); ?> -->
<?php
/**
* Hook for anything after single content
*/
do_action( 'kadence_single_after_content' );
if ( is_singular( get_post_type() ) ) {
if ( 'post' === get_post_type() && kadence()->option( 'post_author_box' ) ) {
get_template_part( 'template-parts/content/entry_author', get_post_type() );
}
// Show post navigation only when the post type is 'post' or has an archive.
if ( ( 'post' === get_post_type() || get_post_type_object( get_post_type() )->has_archive ) && kadence()->show_post_navigation() ) {
if ( kadence()->option( 'post_footer_area_boxed' ) ) {
echo '<div class="post-navigation-wrap content-bg entry-content-wrap entry">';
}
the_post_navigation(
apply_filters(
'kadence_post_navigation_args',
array(
'prev_text' => '<div class="post-navigation-sub"><small>' . kadence()->get_icon( 'arrow-left-alt' ) . esc_html__( 'Previous', 'kadence' ) . '</small></div>%title',
'next_text' => '<div class="post-navigation-sub"><small>' . esc_html__( 'Next', 'kadence' ) . kadence()->get_icon( 'arrow-right-alt' ) . '</small></div>%title',
)
)
);
if ( kadence()->option( 'post_footer_area_boxed' ) ) {
echo '</div>';
}
}
if ( 'post' === get_post_type() && kadence()->option( 'post_related' ) ) {
get_template_part( 'template-parts/content/entry_related', get_post_type() );
}
// Show comments only when the post type supports it and when comments are open or at least one comment exists.
if ( kadence()->show_comments() ) {
comments_template();
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* The main single item template file.
*
* @package kadence
*/
namespace Kadence;
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<div id="main" class="site-main">
<?php
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_main_content' );
?>
<div class="content-wrap">
<?php
if ( is_404() ) {
do_action( 'kadence_404_content' );
} elseif ( have_posts() ) {
while ( have_posts() ) {
the_post();
/**
* Hook in content single entry template.
*/
do_action( 'kadence_single_content' );
}
} else {
get_template_part( 'template-parts/content/error' );
}
?>
</div>
<?php
/**
* Hook for anything after main content
*/
do_action( 'kadence_after_main_content' );
?>
</div><!-- #main -->
<?php
get_sidebar();
?>
</div>
</div><!-- #primary -->