first commit

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-08 12:19:53 -04:00
commit 7c8c8b1c76
4586 changed files with 2050693 additions and 0 deletions
@@ -0,0 +1,101 @@
<?php
/**
* Template for displaying archive layout for easy digital downloads
*
* @package OceanWP WordPress theme
*/
global $post;
do_action( 'ocean_before_archive_download_item' );
?>
<div <?php post_class(); ?>>
<div class="edd_download_inner">
<?php
// Get elements.
$elements = oceanwp_edd_archive_elements_positioning();
// Loop through elements.
foreach ( $elements as $element ) {
// Image.
if ( 'image' === $element ) {
do_action( 'ocean_before_archive_download_image' );
edd_get_template_part( 'shortcode', 'content-image' );
do_action( 'ocean_after_archive_download_image' );
}
// Category.
if ( 'category' === $element ) {
do_action( 'ocean_before_archive_download_categories' );
echo '<div class="edd_download_categories">';
echo oceanwp_edd_terms_list( 'download_category' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '</div>';
do_action( 'ocean_after_archive_download_categories' );
}
// Title.
if ( 'title' === $element ) {
do_action( 'ocean_before_archive_download_title' );
edd_get_template_part( 'shortcode', 'content-title' );
do_action( 'ocean_after_archive_download_title' );
}
// Price.
if ( 'price' === $element ) {
do_action( 'ocean_before_archive_download_price' );
edd_get_template_part( 'shortcode', 'content-price' );
do_action( 'ocean_before_archive_download_price' );
}
// Description.
if ( 'description' === $element ) {
do_action( 'ocean_before_archive_download_description' );
edd_get_template_part( 'shortcode', 'content-excerpt' );
do_action( 'ocean_after_archive_download_description' );
}
// Add to cart button.
if ( 'button' === $element ) {
do_action( 'ocean_before_archive_download_add_to_cart' );
echo oceanwp_edd_add_to_cart_link(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'ocean_after_archive_download_add_to_cart' );
}
}
?>
</div>
</div>
<?php
do_action( 'ocean_after_archive_download_item' );
@@ -0,0 +1,3 @@
<div class="edd_download_buy_button">
<?php echo oceanwp_edd_add_to_cart_link(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -0,0 +1,11 @@
<?php $excerpt_length = get_theme_mod( 'ocean_edd_archive_excerpt_length', 5 ) ?>
<?php $item_prop = edd_add_schema_microdata() ? ' itemprop="description"' : ''; ?>
<?php if ( has_excerpt() ) : ?>
<div<?php echo $item_prop; ?> class="edd_download_excerpt">
<?php echo apply_filters( 'edd_downloads_excerpt', wp_trim_words( get_post_field( 'post_excerpt', get_the_ID() ), $excerpt_length ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php elseif ( get_the_content() ) : ?>
<div<?php echo $item_prop; ?> class="edd_download_excerpt">
<?php echo apply_filters( 'edd_downloads_excerpt', wp_trim_words( get_post_field( 'post_content', get_the_ID() ), $excerpt_length ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php endif; ?>
@@ -0,0 +1,41 @@
<div class="edd_download_image">
<a href="<?php the_permalink(); ?>">
<?php
if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( get_the_ID() ) ) :
?>
<?php
$img_width = get_theme_mod( 'ocean_edd_archive_image_width', 450 );
$img_height = get_theme_mod( 'ocean_edd_archive_image_height', 450 );
// Images attr.
$img_id = get_post_thumbnail_id( get_the_ID(), 'full' );
$img_url = wp_get_attachment_image_src( $img_id, 'full', true );
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_image_attributes' ) ) {
$img_atts = ocean_extra_image_attributes( $img_url[1], $img_url[2], $img_width, $img_height );
}
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_resize' )
&& ! empty( $img_atts ) ) {
?>
<img src="<?php echo ocean_extra_resize( $img_url[0], $img_atts['width'], $img_atts['height'], $img_atts['crop'], true, $img_atts['upscale'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" alt="<?php the_title_attribute(); ?>" width="<?php echo esc_attr( $img_width ); ?>" height="<?php echo esc_attr( $img_height ); ?>"<?php oceanwp_schema_markup( 'image' ); ?> />
<?php
} else {
// Display post thumbnail.
the_post_thumbnail( 'full' );
}
?>
<?php
else :
echo '<img src="' . get_template_directory_uri() . '/assets/img/placeholder.png">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
endif;
?>
</a>
</div>
@@ -0,0 +1,12 @@
<?php $item_props = edd_add_schema_microdata() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : ''; ?>
<div<?php echo $item_props; ?>>
<div itemprop="price" class="edd_price">
<?php
if ( ! edd_has_variable_prices( get_the_ID() ) ) :
edd_price( get_the_ID() );
else :
echo edd_price_range( get_the_ID() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
endif;
?>
</div>
</div>
@@ -0,0 +1,75 @@
<?php
/**
* Template for displaying single layout for easy digital downloads
*
* @package OceanWP WordPress theme
*/
global $post;
do_action( 'ocean_before_single_download_item' ); ?>
<div <?php post_class(); ?>>
<div class="edd_download_inner">
<h2 class="edd_download_title">
<?php the_title(); ?>
</h2>
<?php
if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( get_the_ID() ) ) :
?>
<div class="edd_download_image">
<?php do_action( 'ocean_before_single_download_image' ); ?>
<?php echo get_the_post_thumbnail( get_the_ID(), 'full' ); ?>
<?php do_action( 'ocean_after_single_download_image' ); ?>
</div>
<?php endif; ?>
<div class="edd_download_content">
<?php do_action( 'ocean_before_single_download_content' ); ?>
<?php the_content(); ?>
<?php do_action( 'ocean_after_single_download_content' ); ?>
</div>
<?php
if ( get_theme_mod( 'ocean_edd_display_navigation', true ) ) :
?>
<div class="edd_download_navigation">
<?php
// Term.
$term_tax = get_theme_mod( 'ocean_edd_next_prev_taxonomy', 'download_tag' );
$term_tax = $term_tax ? $term_tax : 'download_tag';
// Args.
$args = array(
'prev_text' => '<span class="title"><i class="fa fa-long-arrow-left" aria-hidden="true"></i>' . esc_html__( 'Previous', 'oceanwp' ) . '</span><span class="post-title">%title</span>',
'next_text' => '<span class="title"><i class="fa fa-long-arrow-right" aria-hidden="true"></i>' . esc_html__( 'Next', 'oceanwp' ) . '</span><span class="post-title">%title</span>',
'in_same_term' => true,
'taxonomy' => $term_tax,
'screen_reader_text' => esc_html__( 'Continue Reading', 'oceanwp' ),
);
// Args.
$args = apply_filters( 'ocean_single_post_next_prev_args', $args );
?>
<?php do_action( 'ocean_before_single_post_next_prev' ); ?>
<?php the_post_navigation( $args ); ?>
<?php do_action( 'ocean_after_single_post_next_prev' ); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php
do_action( 'ocean_after_single_download_item' ); ?>
@@ -0,0 +1,43 @@
<?php
/**
* Displays post entry content
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<?php do_action( 'ocean_before_blog_entry_content' ); ?>
<div class="blog-entry-summary clr"<?php oceanwp_schema_markup( 'entry_content' ); ?>>
<?php
// Display excerpt.
if ( '500' !== get_theme_mod( 'ocean_blog_entry_excerpt_length', '30' ) ) :
?>
<p>
<?php
// Display custom excerpt.
echo oceanwp_excerpt( get_theme_mod( 'ocean_blog_entry_excerpt_length', '30' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</p>
<?php
// If excerpts are disabled, display full content.
else :
the_content( '', '&hellip;' );
endif;
?>
</div><!-- .blog-entry-summary -->
<?php do_action( 'ocean_after_blog_entry_content' ); ?>
@@ -0,0 +1,26 @@
<?php
/**
* Displays the post entry header
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Heading tag.
$heading = get_theme_mod( 'ocean_blog_entries_heading_tag', 'h2' );
$heading = $heading ? $heading : 'h2';
$heading = apply_filters( 'ocean_blog_entries_heading', $heading ); ?>
<?php do_action( 'ocean_before_blog_entry_title' ); ?>
<header class="blog-entry-header clr">
<<?php echo esc_attr( $heading ); ?> class="blog-entry-title entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
</<?php echo esc_attr( $heading ); ?>><!-- .blog-entry-title -->
</header><!-- .blog-entry-header -->
<?php do_action( 'ocean_after_blog_entry_title' ); ?>
@@ -0,0 +1,91 @@
<?php
/**
* Default post entry layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get post format.
$format = get_post_format();
// Blog style.
$style = get_theme_mod( 'ocean_blog_style', 'large-entry' );
// Quote format is completely different.
if ( 'quote' === $format ) {
// Get quote entry content.
get_template_part( 'partials/entry/quote' );
return;
}
// If thumbnail style.
if ( 'thumbnail-entry' === $style ) {
get_template_part( 'partials/entry/thumbnail-style/layout' );
} else {
// Add classes to the blog entry post class.
$classes = oceanwp_post_entry_classes(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
<div class="blog-entry-inner clr">
<?php
// Get elements.
$elements = oceanwp_blog_entry_elements_positioning();
// Loop through elements.
foreach ( $elements as $element ) {
// Featured Image.
if ( 'featured_image' === $element ) {
get_template_part( 'partials/entry/media/blog-entry', $format );
}
// Title.
if ( 'title' === $element ) {
get_template_part( 'partials/entry/header' );
}
// Meta.
if ( 'meta' === $element ) {
get_template_part( 'partials/entry/meta' );
}
// Content.
if ( 'content' === $element ) {
get_template_part( 'partials/entry/content' );
}
// Read more button.
if ( 'read_more' === $element ) {
get_template_part( 'partials/entry/readmore' );
}
}
?>
</div><!-- .blog-entry-inner -->
</article><!-- #post-## -->
<?php
}
?>
@@ -0,0 +1,35 @@
<?php
/**
* Blog entry audio format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
?>
<?php $audio = oceanwp_get_post_audio_html(); ?>
<?php if ( $audio ) : ?>
<div class="thumbnail"><?php echo $audio; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<?php
else :
// Else display post thumbnail.
?>
<?php get_template_part( 'partials/entry/media/blog-entry' ); ?>
<?php endif; ?>
@@ -0,0 +1,111 @@
<?php
/**
* Blog entry gallery format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
// Get attachments.
$attachments = oceanwp_get_gallery_ids( get_the_ID() );
// Return standard entry style if password protected or there aren't any attachments.
if ( post_password_required() || empty( $attachments ) ) {
get_template_part( 'partials/entry/media/blog-entry' );
return;
}
// Add images size if blog grid.
if ( 'grid-entry' === oceanwp_blog_entry_style() ) {
$size = oceanwp_blog_entry_images_size();
} else {
$size = 'full';
}
?>
<div class="thumbnail">
<div class="gallery-format clr">
<?php
// Loop through each attachment ID.
foreach ( $attachments as $attachment ) :
// Get attachment data.
$attachment_title = get_the_title( $attachment );
$attachment_alt = get_post_meta( $attachment, '_wp_attachment_image_alt', true );
$attachment_alt = $attachment_alt ? $attachment_alt : $attachment_title;
// Image width.
$img_width = apply_filters( 'ocean_blog_entry_image_width', absint( get_theme_mod( 'ocean_blog_entry_image_width' ) ) );
$img_height = apply_filters( 'ocean_blog_entry_image_height', absint( get_theme_mod( 'ocean_blog_entry_image_height' ) ) );
// Images url.
$img_url = wp_get_attachment_image_src( $attachment, 'full', true );
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_image_attributes' ) ) {
$img_atts = ocean_extra_image_attributes( $img_url[1], $img_url[2], $img_width, $img_height );
}
// If Ocean Extra is active and has a custom size.
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_resize' )
&& ! empty( $img_atts ) ) {
$attachment_html = '<img src="' . ocean_extra_resize( $img_url[0], $img_atts['width'], $img_atts['height'], $img_atts['crop'], true, $img_atts['upscale'] ) . '" alt="' . $attachment_alt . '" width="' . $img_width . '" height="' . $img_height . '" itemprop="image" />';
} else {
// Image args.
$img_args = array(
'alt' => $attachment_alt,
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
}
// Get image output.
$attachment_html = wp_get_attachment_image( $attachment, $size, '', $img_args );
}
// Display with lightbox.
if ( oceanwp_gallery_is_lightbox_enabled() === 'on' ) {
?>
<a href="<?php echo esc_url( wp_get_attachment_url( $attachment ) ); ?>" title="<?php echo esc_attr( $attachment_alt ); ?>" class="gallery-lightbox">
<?php echo wp_kses_post( $attachment_html ); ?>
</a>
<?php
} else {
// Display single image.
?>
<a href="<?php the_permalink(); ?>" class="thumbnail-link">
<?php echo wp_kses_post( $attachment_html ); ?>
</a>
<?php
}
endforeach;
?>
</div>
</div>
@@ -0,0 +1,106 @@
<?php
/**
* Blog entry link format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if there isn't a thumbnail defined.
if ( ! has_post_thumbnail() ) {
return;
}
// Add images size if blog grid.
if ( 'grid-entry' === oceanwp_blog_entry_style() ) {
$size = oceanwp_blog_entry_images_size();
} else {
$size = 'full';
}
// Overlay class.
if ( is_customize_preview()
&& false === get_theme_mod( 'ocean_blog_image_overlay', true ) ) {
$class = 'no-overlay';
} else {
$class = 'overlay';
}
// Image args.
$img_args = array(
'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
}
// Caption.
$caption = get_the_post_thumbnail_caption();
?>
<div class="thumbnail">
<a href="<?php the_permalink(); ?>" class="thumbnail-link">
<?php
// Image width.
$img_width = apply_filters( 'ocean_blog_entry_image_width', absint( get_theme_mod( 'ocean_blog_entry_image_width' ) ) );
$img_height = apply_filters( 'ocean_blog_entry_image_height', absint( get_theme_mod( 'ocean_blog_entry_image_height' ) ) );
// Images attr.
$img_id = get_post_thumbnail_id( get_the_ID(), 'full' );
$img_url = wp_get_attachment_image_src( $img_id, 'full', true );
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_image_attributes' ) ) {
$img_atts = ocean_extra_image_attributes( $img_url[1], $img_url[2], $img_width, $img_height );
}
// If Ocean Extra is active and has a custom size.
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_resize' )
&& ! empty( $img_atts ) ) {
?>
<img src="<?php echo ocean_extra_resize( $img_url[0], $img_atts['width'], $img_atts['height'], $img_atts['crop'], true, $img_atts['upscale'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" alt="<?php the_title_attribute(); ?>" width="<?php echo esc_attr( $img_width ); ?>" height="<?php echo esc_attr( $img_height ); ?>"<?php oceanwp_schema_markup( 'image' ); ?> />
<?php
} else {
// Display post thumbnail.
the_post_thumbnail( $size, $img_args );
}
// If overlay.
if ( is_customize_preview()
|| true === get_theme_mod( 'ocean_blog_image_overlay', true ) ) {
?>
<span class="<?php echo esc_attr( $class ); ?>"></span>
<?php } ?>
</a>
<?php
// Caption.
if ( $caption ) {
?>
<div class="thumbnail-caption">
<?php echo wp_kses_post( $caption ); ?>
</div>
<?php
}
?>
<div class="link-entry clr">
<a href="<?php echo esc_url( get_post_meta( get_the_ID(), 'ocean_link_format', true ) ); ?>" target="_<?php echo esc_attr( get_post_meta( get_the_ID(), 'ocean_link_format_target', true ) ); ?>"><i class="icon-link"></i></a>
</div>
</div>
@@ -0,0 +1,47 @@
<?php
/**
* Blog entry video format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
// Get post video.
$video = oceanwp_get_post_video_html();
?>
<?php
// Display video if one exists and it's not a password protected post.
if ( $video && ! post_password_required() ) :
?>
<div class="blog-entry-media thumbnail clr">
<div class="blog-entry-video">
<?php echo $video; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div><!-- .blog-entry-video -->
</div><!-- .blog-entry-media -->
<?php
// Else display post thumbnail.
else :
?>
<?php get_template_part( 'partials/entry/media/blog-entry' ); ?>
<?php
endif;
?>
@@ -0,0 +1,102 @@
<?php
/**
* Displays the post entry thumbmnail
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if there isn't a thumbnail defined.
if ( ! has_post_thumbnail() ) {
return;
}
// Add images size if blog grid.
if ( 'grid-entry' === oceanwp_blog_entry_style() ) {
$size = oceanwp_blog_entry_images_size();
} else {
$size = 'full';
}
// Overlay class.
if ( is_customize_preview()
&& false === get_theme_mod( 'ocean_blog_image_overlay', true ) ) {
$class = 'no-overlay';
} else {
$class = 'overlay';
}
// Image args.
$img_args = array(
'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
}
// Caption.
$caption = get_the_post_thumbnail_caption();
?>
<div class="thumbnail">
<a href="<?php the_permalink(); ?>" class="thumbnail-link">
<?php
// Image width.
$img_width = apply_filters( 'ocean_blog_entry_image_width', absint( get_theme_mod( 'ocean_blog_entry_image_width' ) ) );
$img_height = apply_filters( 'ocean_blog_entry_image_height', absint( get_theme_mod( 'ocean_blog_entry_image_height' ) ) );
// Images attr.
$img_id = get_post_thumbnail_id( get_the_ID(), 'full' );
$img_url = wp_get_attachment_image_src( $img_id, 'full', true );
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_image_attributes' ) ) {
$img_atts = ocean_extra_image_attributes( $img_url[1], $img_url[2], $img_width, $img_height );
}
// If Ocean Extra is active and has a custom size.
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_resize' )
&& ! empty( $img_atts ) ) {
?>
<img src="<?php echo ocean_extra_resize( $img_url[0], $img_atts['width'], $img_atts['height'], $img_atts['crop'], true, $img_atts['upscale'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" alt="<?php the_title_attribute(); ?>" width="<?php echo esc_attr( $img_width ); ?>" height="<?php echo esc_attr( $img_height ); ?>"<?php oceanwp_schema_markup( 'image' ); ?> />
<?php
} else {
// Display post thumbnail.
the_post_thumbnail( $size, $img_args );
}
// If overlay.
if ( is_customize_preview()
|| true === get_theme_mod( 'ocean_blog_image_overlay', true ) ) {
?>
<span class="<?php echo esc_attr( $class ); ?>"></span>
<?php
}
?>
</a>
<?php
// Caption.
if ( $caption ) {
?>
<div class="thumbnail-caption">
<?php echo wp_kses_post( $caption ); ?>
</div>
<?php
}
?>
</div><!-- .thumbnail -->
@@ -0,0 +1,60 @@
<?php
/**
* The default template for displaying post meta.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get meta sections.
$sections = oceanwp_blog_entry_meta();
// Return if sections are empty.
if ( empty( $sections ) ) {
return;
}
?>
<?php do_action( 'ocean_before_blog_entry_meta' ); ?>
<ul class="meta clr" aria-label="<?php esc_attr_e( 'Post details:', 'oceanwp' ); ?>">
<?php
// Loop through meta sections.
foreach ( $sections as $section ) {
?>
<?php if ( 'author' === $section ) { ?>
<li class="meta-author"<?php oceanwp_schema_markup( 'author_name' ); ?>><span class="screen-reader-text"><?php esc_html_e( 'Post author:', 'oceanwp' ); ?></span><i class="icon-user" aria-hidden="true"></i><?php echo esc_html( the_author_posts_link() ); ?></li>
<?php } ?>
<?php if ( 'date' === $section ) { ?>
<li class="meta-date"<?php oceanwp_schema_markup( 'publish_date' ); ?>><span class="screen-reader-text"><?php esc_html_e( 'Post published:', 'oceanwp' ); ?></span><i class="icon-clock" aria-hidden="true"></i><?php echo get_the_date(); ?></li>
<?php } ?>
<?php if ( 'mod-date' === $section ) { ?>
<li class="meta-mod-date"<?php oceanwp_schema_markup( 'modified_date' ); ?>><span class="screen-reader-text"><?php esc_html_e( 'Post last modified:', 'oceanwp' ); ?></span><i class="icon-note" aria-hidden="true"></i><?php echo esc_html( get_the_modified_date() ); ?></li>
<?php } ?>
<?php if ( 'categories' === $section ) { ?>
<li class="meta-cat"><span class="screen-reader-text"><?php esc_html_e( 'Post category:', 'oceanwp' ); ?></span><i class="icon-folder" aria-hidden="true"></i><?php the_category( ' <span class="owp-sep">/</span> ', get_the_ID() ); ?></li>
<?php } ?>
<?php if ( 'reading-time' === $section ) { ?>
<li class="meta-cat"><span class="screen-reader-text"><?php esc_html_e( 'Reading time:', 'oceanwp' ); ?></span><i class="icon-cup" aria-hidden="true"></i><?php echo esc_attr( ocean_reading_time() ); ?></li>
<?php } ?>
<?php if ( 'comments' === $section && comments_open() && ! post_password_required() ) { ?>
<li class="meta-comments"><span class="screen-reader-text"><?php esc_html_e( 'Post comments:', 'oceanwp' ); ?></span><i class="icon-bubble" aria-hidden="true"></i><?php comments_popup_link( esc_html__( '0 Comments', 'oceanwp' ), esc_html__( '1 Comment', 'oceanwp' ), esc_html__( '% Comments', 'oceanwp' ), 'comments-link' ); ?></li>
<?php } ?>
<?php } ?>
</ul>
<?php do_action( 'ocean_after_blog_entry_meta' ); ?>
@@ -0,0 +1,38 @@
<?php
/**
* Blog entry quote format
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
// Quote link.
$link = get_post_meta( get_the_ID(), 'ocean_quote_format_link', true );
// Add post classes.
$classes = oceanwp_post_entry_classes(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
<div class="post-quote-wrap">
<?php if ( 'post' === $link ) { ?>
<a href="<?php the_permalink(); ?>" class="thumbnail-link">
<?php } ?>
<div class="post-quote-content">
<?php echo wp_kses_post( get_post_meta( get_the_ID(), 'ocean_quote_format', true ) ); ?>
<span class="post-quote-icon icon-speech"></span>
</div>
<div class="post-quote-author"><?php the_title(); ?></div>
<?php if ( 'post' === $link ) { ?>
</a>
<?php } ?>
</div>
</article>
@@ -0,0 +1,22 @@
<?php
/**
* Displays post entry read more
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<?php do_action( 'ocean_before_blog_entry_readmore' ); ?>
<div class="blog-entry-readmore clr">
<a href="<?php the_permalink(); ?>" title="<?php oceanwp_theme_strings( 'owp-string-post-continue-reading', 'oceanwp' ); ?>"><?php oceanwp_theme_strings( 'owp-string-post-continue-reading', 'oceanwp' ); ?><i class="fa fa-angle-right" aria-hidden="true"></i></a>
<span class="screen-reader-text"><?php the_title(); ?></span>
</div><!-- .blog-entry-readmore -->
<?php do_action( 'ocean_after_blog_entry_readmore' ); ?>
@@ -0,0 +1,22 @@
<?php
/**
* Category for the thumbnail style.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( 'post' === get_post_type() ) {
?>
<div class="blog-entry-category clr">
<?php the_category( ' / ', get_the_ID() ); ?>
</div>
<?php
}
?>
@@ -0,0 +1,22 @@
<?php
/**
* The default template for displaying post meta.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( 'post' === get_post_type() ) {
?>
<div class="blog-entry-comments clr">
<i class="icon-bubble"></i><?php comments_popup_link( esc_html__( '0 Comments', 'oceanwp' ), esc_html__( '1 Comment', 'oceanwp' ), esc_html__( '% Comments', 'oceanwp' ), 'comments-link' ); ?>
</div>
<?php
}
?>
@@ -0,0 +1,22 @@
<?php
/**
* Date for the thumbnail style.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( 'post' === get_post_type() ) {
?>
<div class="blog-entry-date clr">
<?php echo get_the_date(); ?>
</div>
<?php
}
?>
@@ -0,0 +1,88 @@
<?php
/**
* Thumbnail style layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get post format.
$format = get_post_format();
// Add classes to the blog entry post class.
$classes = oceanwp_post_entry_classes();
// Inner classes.
$inner_classes = array();
// Image position.
$position = get_theme_mod( 'ocean_blog_thumbnail_image_position', 'left' );
$position = $position ? $position : 'left';
$inner_classes[] = $position . '-position';
// Vertical postion.
$ver_position = get_theme_mod( 'ocean_blog_thumbnail_vertical_position', 'center' );
$ver_position = $ver_position ? $ver_position : 'center';
$inner_classes[] = $ver_position;
// Turn inner classes into space seperated string.
$inner_classes = implode( ' ', $inner_classes ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
<div class="blog-entry-inner clr <?php echo esc_attr( $inner_classes ); ?>">
<?php
// If image left.
if ( 'left' === $position ) {
// Featured Image.
get_template_part( 'partials/entry/media/blog-entry', $format );
}
?>
<div class="blog-entry-content">
<?php
// Category.
get_template_part( 'partials/entry/thumbnail-style/category' );
// Title.
get_template_part( 'partials/entry/header' );
// Content.
get_template_part( 'partials/entry/content' );
?>
<div class="blog-entry-bottom clr">
<?php
// Comments.
get_template_part( 'partials/entry/thumbnail-style/comments' );
// Date.
get_template_part( 'partials/entry/thumbnail-style/date' );
?>
</div><!-- .blog-entry-bottom -->
</div><!-- .blog-entry-content -->
<?php
// If image right.
if ( 'right' === $position ) {
// Featured Image.
get_template_part( 'partials/entry/media/blog-entry', $format );
}
?>
</div><!-- .blog-entry-inner -->
</article><!-- #post-## -->
@@ -0,0 +1,85 @@
<?php
/**
* The default template for displaying the footer copyright
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get copyright text.
$copy = get_theme_mod( 'ocean_footer_copyright_text', 'Copyright - OceanWP Theme by Nick' );
$copy = oceanwp_tm_translation( 'ocean_footer_copyright_text', $copy );
// Get footer menu location and apply filters for child theming.
$menu_location = 'footer_menu';
$menu_location = apply_filters( 'ocean_footer_menu_location', $menu_location );
// Visibility.
$visibility = get_theme_mod( 'ocean_bottom_footer_visibility', 'all-devices' );
// Inner classes.
$wrap_classes = array( 'clr' );
if ( ! has_nav_menu( $menu_location ) ) {
$wrap_classes[] = 'no-footer-nav';
}
if ( 'all-devices' !== $visibility ) {
$wrap_classes[] = $visibility;
}
$wrap_classes = implode( ' ', $wrap_classes ); ?>
<?php do_action( 'ocean_before_footer_bottom' ); ?>
<div id="footer-bottom" class="<?php echo esc_attr( $wrap_classes ); ?>">
<?php do_action( 'ocean_before_footer_bottom_inner' ); ?>
<div id="footer-bottom-inner" class="container clr">
<?php
// Display footer bottom menu if location is defined.
if ( has_nav_menu( $menu_location ) ) :
?>
<div id="footer-bottom-menu" class="navigation clr">
<?php
// Display footer menu.
wp_nav_menu(
array(
'theme_location' => $menu_location,
'sort_column' => 'menu_order',
'fallback_cb' => false,
)
);
?>
</div><!-- #footer-bottom-menu -->
<?php
endif;
?>
<?php
// Display copyright info.
if ( $copy ) :
?>
<div id="copyright" class="clr" role="contentinfo">
<?php echo wp_kses_post( do_shortcode( $copy ) ); ?>
</div><!-- #copyright -->
<?php
endif;
?>
</div><!-- #footer-bottom-inner -->
<?php do_action( 'ocean_after_footer_bottom_inner' ); ?>
</div><!-- #footer-bottom -->
<?php do_action( 'ocean_after_footer_bottom' ); ?>
@@ -0,0 +1,39 @@
<?php
/**
* Footer layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<footer id="footer" class="<?php echo esc_attr( oceanwp_footer_classes() ); ?>"<?php oceanwp_schema_markup( 'footer' ); ?> role="contentinfo">
<?php do_action( 'ocean_before_footer_inner' ); ?>
<div id="footer-inner" class="clr">
<?php
// Display the footer widgets if enabled.
if ( oceanwp_display_footer_widgets() ) {
get_template_part( 'partials/footer/widgets' );
}
// Display the footer bottom if enabled.
if ( oceanwp_display_footer_bottom() ) {
get_template_part( 'partials/footer/copyright' );
}
?>
</div><!-- #footer-inner -->
<?php do_action( 'ocean_after_footer_inner' ); ?>
</footer><!-- #footer -->
@@ -0,0 +1,144 @@
<?php
/**
* Footer widgets
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get ID.
$get_id = oceanwp_custom_footer_template();
// Check if page is Elementor page.
$elementor = get_post_meta( $get_id, '_elementor_edit_mode', true );
// Get content.
$get_content = oceanwp_footer_template_content();
// Get footer widgets columns.
$columns = apply_filters( 'ocean_footer_widgets_columns', get_theme_mod( 'ocean_footer_widgets_columns', '4' ) );
$grid_class = oceanwp_grid_class( $columns );
// Responsive columns.
$tablet_columns = get_theme_mod( 'ocean_footer_widgets_tablet_columns' );
$mobile_columns = get_theme_mod( 'ocean_footer_widgets_mobile_columns' );
// Visibility.
$visibility = get_theme_mod( 'ocean_footer_widgets_visibility', 'all-devices' );
// Classes.
$wrap_classes = array( 'oceanwp-row', 'clr' );
if ( ! empty( $tablet_columns ) ) {
$wrap_classes[] = 'tablet-' . $tablet_columns . '-col';
}
if ( ! empty( $mobile_columns ) ) {
$wrap_classes[] = 'mobile-' . $mobile_columns . '-col';
}
if ( 'all-devices' !== $visibility ) {
$wrap_classes[] = $visibility;
}
$wrap_classes = implode( ' ', $wrap_classes );
// Get inner classes.
$inner_classes = array( 'footer-widgets-inner' );
// Add container class.
if ( true === get_theme_mod( 'ocean_add_footer_container', true ) ) {
$inner_classes[] = 'container';
}
// Turn inner classes into space seperated string.
$inner_classes = implode( ' ', $inner_classes );
?>
<?php do_action( 'ocean_before_footer_widgets' ); ?>
<div id="footer-widgets" class="<?php echo esc_attr( $wrap_classes ); ?>">
<?php do_action( 'ocean_before_footer_widgets_inner' ); ?>
<div class="<?php echo esc_attr( $inner_classes ); ?>">
<?php
// Check if there is a template for the footer.
if ( ! empty( $get_id ) ) {
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
// If Elementor.
OceanWP_Elementor::get_footer_content();
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $get_id ) ) {
// If Beaver Builder.
echo do_shortcode( '[fl_builder_insert_layout id="' . $get_id . '"]' );
} else {
// Display template content.
echo do_shortcode( $get_content );
}
// Display widgets.
} else {
// Footer box 1.
?>
<div class="footer-box <?php echo esc_attr( $grid_class ); ?> col col-1">
<?php dynamic_sidebar( 'footer-one' ); ?>
</div><!-- .footer-one-box -->
<?php
// Footer box 2.
if ( $columns > '1' ) :
?>
<div class="footer-box <?php echo esc_attr( $grid_class ); ?> col col-2">
<?php dynamic_sidebar( 'footer-two' ); ?>
</div><!-- .footer-one-box -->
<?php
endif;
?>
<?php
// Footer box 3.
if ( $columns > '2' ) :
?>
<div class="footer-box <?php echo esc_attr( $grid_class ); ?> col col-3 ">
<?php dynamic_sidebar( 'footer-three' ); ?>
</div><!-- .footer-one-box -->
<?php
endif;
?>
<?php
// Footer box 4.
if ( $columns > '3' ) :
?>
<div class="footer-box <?php echo esc_attr( $grid_class ); ?> col col-4">
<?php dynamic_sidebar( 'footer-four' ); ?>
</div><!-- .footer-box -->
<?php
endif;
?>
<?php
}
?>
</div><!-- .container -->
<?php do_action( 'ocean_after_footer_widgets_inner' ); ?>
</div><!-- #footer-widgets -->
<?php do_action( 'ocean_after_footer_widgets' ); ?>
@@ -0,0 +1,140 @@
<?php
/**
* Main Header Layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Header style.
$header_style = oceanwp_header_style();
// Header height, used for local scrolling.
$header_height = get_theme_mod( 'ocean_header_height', '74' );
if ( class_exists( 'Ocean_Sticky_Header' ) ) {
if ( 'shrink' === get_theme_mod( 'osh_sticky_header_style', 'shrink' ) ) {
$header_height = get_theme_mod( 'osh_shrink_header_height', '54' );
}
}
// If vertical header style.
if ( 'vertical' === $header_style ) {
$header_height = 0;
}
// Add container class if the header is not full width.
$class = '';
if ( true !== get_theme_mod( 'ocean_header_full_width', false ) ) {
$class = 'container';
}
do_action( 'ocean_before_header' );
// If transparent header style.
if ( 'transparent' === $header_style
|| ( 'full_screen' === $header_style && true === get_theme_mod( 'ocean_full_screen_header_transparent', false ) )
|| ( 'center' === $header_style && true === get_theme_mod( 'ocean_center_header_transparent', false ) )
|| ( 'medium' === $header_style && true === get_theme_mod( 'ocean_medium_header_transparent', false ) ) ) { ?>
<div id="transparent-header-wrap" class="clr">
<?php
}
?>
<header id="site-header" class="<?php echo esc_attr( oceanwp_header_classes() ); ?>" data-height="<?php echo esc_attr( $header_height ); ?>"<?php oceanwp_schema_markup( 'header' ); ?> role="banner">
<?php
// Elementor `header` location.
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) {
?>
<?php
// If header video.
if ( function_exists( 'has_header_video' ) && has_header_video() ) {
?>
<div class="custom-header-media">
<?php the_custom_header_markup(); ?>
</div>
<?php
}
if ( 'top' === $header_style ) {
// If top header style.
get_template_part( 'partials/header/style/top-header' );
} elseif ( 'full_screen' === $header_style ) {
// If full screen header style.
get_template_part( 'partials/header/style/full-screen-header' );
} elseif ( 'center' === $header_style ) {
// If center header style.
get_template_part( 'partials/header/style/center-header' );
} elseif ( 'medium' === $header_style ) {
// If medium header style.
get_template_part( 'partials/header/style/medium-header' );
} elseif ( 'vertical' === $header_style ) {
// If vertical header style.
get_template_part( 'partials/header/style/vertical-header' );
} elseif ( 'custom' === $header_style ) {
// If custom header style.
get_template_part( 'partials/header/style/custom-header' );
} else {
// Default header style.
?>
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="clr <?php echo esc_attr( $class ); ?>">
<?php do_action( 'ocean_header_inner_left_content' ); ?>
<?php do_action( 'ocean_header_inner_middle_content' ); ?>
<?php do_action( 'ocean_header_inner_right_content' ); ?>
</div><!-- #site-header-inner -->
<?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
<?php do_action( 'ocean_after_header_inner' ); ?>
<?php
}
?>
<?php
// If header media.
if ( has_header_image() ) {
?>
<div class="overlay-header-media"></div>
<?php
}
?>
<?php
}
?>
</header><!-- #site-header -->
<?php
// If transparent header style.
if ( 'transparent' === $header_style
|| ( 'full_screen' === $header_style && true === get_theme_mod( 'ocean_full_screen_header_transparent', false ) )
|| ( 'center' === $header_style && true === get_theme_mod( 'ocean_center_header_transparent', false ) )
|| ( 'medium' === $header_style && true === get_theme_mod( 'ocean_medium_header_transparent', false ) ) ) {
?>
</div>
<?php
}
do_action( 'ocean_after_header' ); ?>
@@ -0,0 +1,92 @@
<?php
/**
* Header Logo
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Vars.
$retina_logo = oceanwp_header_retina_logo_setting();
$full_screen_logo = get_theme_mod( 'ocean_full_screen_header_logo' );
$responsive_logo = get_theme_mod( 'ocean_responsive_logo' );
$header_text_color = null;
if ( display_header_text() && ! OCEAN_EXTRA_ACTIVE && ! class_exists( 'Ocean_Extra_Theme_Panel' ) ) {
$header_text_color = ' style=color:#' . get_header_textcolor() . ';';
}
?>
<?php do_action( 'ocean_before_logo' ); ?>
<div id="site-logo" class="<?php echo esc_attr( oceanwp_header_logo_classes() ); ?>"<?php oceanwp_schema_markup( 'logo' ); ?> >
<?php do_action( 'ocean_before_logo_inner' ); ?>
<div id="site-logo-inner" class="clr">
<?php
// Custom site-wide image logo.
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
do_action( 'ocean_before_logo_img' );
// Add srcset attr.
if ( $retina_logo ) {
add_filter( 'wp_get_attachment_image_attributes', 'oceanwp_header_retina_logo', 10, 3 );
}
// Default logo.
the_custom_logo();
// Remove filter to only add the srcset attr to the logo.
if ( $retina_logo ) {
remove_filter( 'wp_get_attachment_image_attributes', 'oceanwp_header_retina_logo', 10 );
}
// Full screen logo.
if ( $full_screen_logo ) {
oceanwp_custom_full_screen_logo();
}
// Responsive logo.
if ( $responsive_logo ) {
oceanwp_custom_responsive_logo();
}
do_action( 'ocean_after_logo_img' );
} else {
if ( display_header_text() === true ) {
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="site-title site-logo-text" <?php echo esc_attr( $header_text_color ); ?>><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
<?php
do_action( 'ocean_after_site_title' );
}
}
?>
</div><!-- #site-logo-inner -->
<?php do_action( 'ocean_after_logo_inner' ); ?>
<?php
// Site description.
if ( display_header_text() === true ) {
if ( 'top' === oceanwp_header_style()
&& '' !== get_bloginfo( 'description' ) ) {
?>
<div id="site-description"><h2 <?php echo esc_attr( $header_text_color ); ?>><?php echo bloginfo( 'description' ); ?></h2></div>
<?php
}
}
?>
</div><!-- #site-logo -->
<?php do_action( 'ocean_after_logo' ); ?>
@@ -0,0 +1,213 @@
<?php
/**
* Header menu template part.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Retunr if disabled.
if ( ! oceanwp_display_navigation() ) {
return;
}
// Header style.
$header_style = oceanwp_header_style();
// Get ID.
$template = oceanwp_custom_nav_template();
// Check if page is Elementor page.
$elementor = get_post_meta( $template, '_elementor_edit_mode', true );
// Get content.
$get_content = oceanwp_nav_template_content();
// Get classes for the header menu.
$wrap_classes = oceanwp_header_menu_classes( 'wrapper' );
$inner_classes = oceanwp_header_menu_classes( 'inner' );
// Nav attributes.
$owp_nav_attrs = apply_filters( 'oceanwp_attrs_main_nav', '' );
if ( ! empty( $template ) ) {
do_action( 'ocean_before_nav' );
// If is not full screen header style.
if ( 'full_screen' !== $header_style ) { ?>
<div id="site-navigation-wrap" class="<?php echo esc_attr( $wrap_classes ); ?>">
<?php } ?>
<?php do_action( 'ocean_before_nav_inner' ); ?>
<?php
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
// If Elementor.
OceanWP_Elementor::get_nav_content();
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $template ) ) {
// If Beaver Builder.
echo do_shortcode( '[fl_builder_insert_layout id="' . $template . '"]' );
} else {
// Display template content.
echo do_shortcode( $get_content );
}
?>
<?php do_action( 'ocean_after_nav_inner' ); ?>
<?php
// If is not full screen header style.
if ( 'full_screen' !== $header_style ) {
?>
</div><!-- #site-navigation-wrap -->
<?php
}
?>
<?php do_action( 'ocean_after_nav' ); ?>
<?php
} else {
// Menu Location.
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
// Multisite global menu.
$ms_global_menu = apply_filters( 'ocean_ms_global_menu', false );
// Display menu if defined.
if ( has_nav_menu( $menu_location ) || $ms_global_menu ) :
// Get menu classes.
$menu_classes = array( 'main-menu' );
// If full screen header style.
if ( 'full_screen' === $header_style ) {
$menu_classes[] = 'fs-dropdown-menu';
} else {
$menu_classes[] = 'dropdown-menu';
}
// If is not full screen or vertical header style.
if ( 'full_screen' !== $header_style
&& 'vertical' !== $header_style ) {
$menu_classes[] = 'sf-menu';
}
// Turn menu classes into space seperated string.
$menu_classes = implode( ' ', $menu_classes );
// Menu arguments.
$menu_args = array(
'theme_location' => $menu_location,
'menu_class' => $menu_classes,
'container' => false,
'fallback_cb' => false,
'link_before' => '<span class="text-wrap">',
'link_after' => '</span>',
'walker' => new OceanWP_Custom_Nav_Walker(),
);
// Check if custom menu.
if ( $menu = oceanwp_header_custom_menu() ) {
$menu_args['menu'] = $menu;
}
do_action( 'ocean_before_nav' );
// If is not full screen header style.
if ( 'full_screen' !== $header_style ) {
?>
<div id="site-navigation-wrap" class="<?php echo esc_attr( $wrap_classes ); ?>">
<?php
}
?>
<?php do_action( 'ocean_before_nav_inner' ); ?>
<?php
// Add container if is medium header style.
if ( 'medium' === $header_style ) {
?>
<div class="container clr">
<?php
}
?>
<nav id="site-navigation" class="<?php echo esc_attr( $inner_classes ); ?>"<?php oceanwp_schema_markup( 'site_navigation' ); ?> role="navigation" <?php echo $owp_nav_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php
// Display global multisite menu.
if ( is_multisite() && $ms_global_menu ) :
switch_to_blog( 1 );
wp_nav_menu( $menu_args );
restore_current_blog();
else :
// Display this site's menu.
wp_nav_menu( $menu_args );
endif;
// If is not top menu header style.
if ( 'top' !== $header_style
&& 'full_screen' !== $header_style
&& 'vertical' !== $header_style ) {
// Header search.
if ( 'drop_down' === oceanwp_menu_search_style() ) {
get_template_part( 'partials/header/search-dropdown' );
} elseif ( 'header_replace' === oceanwp_menu_search_style() ) {
get_template_part( 'partials/header/search-replace' );
}
}
// Social links if full screen header style.
if ( 'full_screen' === $header_style
&& true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
?>
</nav><!-- #site-navigation -->
<?php
// Add container if is medium header style.
if ( 'medium' === $header_style ) {
?>
</div>
<?php
}
?>
<?php do_action( 'ocean_after_nav_inner' ); ?>
<?php
// If is not full screen header style.
if ( 'full_screen' !== $header_style ) {
?>
</div><!-- #site-navigation-wrap -->
<?php
}
?>
<?php do_action( 'ocean_after_nav' ); ?>
<?php endif;
}
?>
@@ -0,0 +1,20 @@
<?php
/**
* Site header search dropdown HTML
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Search attributes.
$item_search_attrs = apply_filters( 'oceanwp_attrs_search_bar', '' );
?>
<div id="searchform-dropdown" class="header-searchform-wrap clr" <?php echo $item_search_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php get_search_form(); ?>
</div><!-- #searchform-dropdown -->
@@ -0,0 +1,38 @@
<?php
/**
* Site header search overlay
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Post type.
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' );
// Aria labels.
$oaria_close = __( 'Close search form', 'oceanwp' );
// Search attributes.
$item_search_overlay_attrs = apply_filters( 'oceanwp_attrs_overlay_search_bar', '' );
?>
<div id="searchform-overlay" class="header-searchform-wrap clr" <?php echo $item_search_overlay_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="container clr">
<form role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-searchform">
<a href="javascript:void(0)" class="search-overlay-close" aria-label="<?php echo esc_attr( $oaria_close ); ?>"><span></span></a>
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'oceanwp' ); ?></span>
<input class="searchform-overlay-input" type="search" name="s" autocomplete="off" value="" aria-placeholder="<?php oceanwp_theme_strings( 'owp-string-search-overlay-search-text', 'oceanwp' ); ?>" />
<label><?php oceanwp_theme_strings( 'owp-string-search-overlay-search-text', 'oceanwp' ); ?><span aria-hidden="true"><i></i><i></i><i></i></span></label>
<?php if ( 'any' !== $post_type ) { ?>
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
<?php } ?>
<?php do_action( 'wpml_add_language_form_field' ); ?>
</form>
</div>
</div><!-- #searchform-overlay -->
@@ -0,0 +1,35 @@
<?php
/**
* Site header search header replace
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Search attributes.
$item_search_attrs = apply_filters( 'oceanwp_attrs_search_bar', '' );
// Post type.
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' );
// Aria labels.
$oaria_close = __( 'Close search form', 'oceanwp' );
?>
<div id="searchform-header-replace" class="header-searchform-wrap clr" <?php echo $item_search_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<form role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-searchform">
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'oceanwp' ); ?></span>
<input type="search" name="s" autocomplete="off" value="" placeholder="<?php oceanwp_theme_strings( 'owp-string-header-replace-search-text', 'oceanwp' ); ?>" />
<?php if ( 'any' !== $post_type ) { ?>
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
<?php } ?>
<?php do_action( 'wpml_add_language_form_field' ); ?>
</form>
<span id="searchform-header-replace-close" class="icon-close" aria-label="<?php echo esc_attr( $oaria_close ); ?>"></span>
</div><!-- #searchform-header-replace -->
@@ -0,0 +1,157 @@
<?php
/**
* Header social menu template part.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get social options array.
$social_options = oceanwp_social_options();
// Return if array is empty.
if ( empty( $social_options ) ) {
return;
}
// Get template ID.
$get_id = get_theme_mod( 'ocean_menu_social_template' );
// Check if page is Elementor page.
$elementor = get_post_meta( $get_id, '_elementor_edit_mode', true );
// Get content.
$get_content = oceanwp_social_menu_content();
// Style.
$style = get_theme_mod( 'ocean_menu_social_style', 'simple' );
$style = $style ? $style : 'simple';
// Classes.
$classes = array( 'oceanwp-social-menu', 'clr' );
// Add class if social menu has class.
if ( 'simple' != $style ) {
$classes[] = 'social-with-style';
} else {
$classes[] = 'simple-social';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
// Inner classes.
$inner_classes = array( 'social-menu-inner', 'clr' );
if ( 'simple' != $style ) {
$inner_classes[] = $style;
}
// Turn classes into space seperated string.
$inner_classes = implode( ' ', $inner_classes );
// Return if there aren't any profiles defined and define var.
if ( ( ! $profiles = get_theme_mod( 'ocean_menu_social_profiles' ) )
&& empty( $get_content ) ) {
return;
}
// Get theme mods.
$link_target = get_theme_mod( 'ocean_menu_social_target', 'blank' );
$link_rel = '';
if ( $link_target == 'blank' ) {
$link_rel = 'rel="noopener noreferrer"';
}
?>
<div class="<?php echo esc_attr( $classes ); ?>">
<div class="<?php echo esc_attr( $inner_classes ); ?>">
<?php
// Check if there is a template for the footer
if ( ! empty( $get_id ) ) {
// If Elementor
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
OceanWP_Elementor::get_social_menu_content();
}
// If Beaver Builder
else if ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $get_id ) ) {
echo do_shortcode( '[fl_builder_insert_layout id="' . $get_id . '"]' );
}
// Else
else {
// Display template content
echo do_shortcode( $get_content );
}
// Display social
} else { ?>
<ul aria-label="<?php echo esc_attr__( 'Social links', 'oceanwp' ); ?>">
<?php
// Loop through social options
foreach ( $social_options as $key => $val ) {
// Get URL from the theme mods
$url = isset( $profiles[$key] ) ? $profiles[$key] : '';
$esc_url = esc_url( $url );
// Get correct label
$label = ! empty( $val['label'] ) ? esc_attr( $val['label'] ) : '';
if ( $link_target == 'blank' ) {
$aria_label = 'aria-label="' . $label . ' '. esc_attr__( '(opens in a new tab)', 'oceanwp' ).'"';
}
else {
$aria_label = 'aria-label="' . $label . '"';
}
// Display if there is a value defined
if ( $url ) {
// Display link
echo '<li class="oceanwp-'. esc_attr( $key ) .'">';
if ( in_array( $key, array( 'skype' ) ) ) {
echo '<a href="skype:'. esc_attr( $url ) .'?call" aria-label="'. esc_attr__( 'Skype (opens in your application)', 'oceanwp' ) .'" target="_self">';
} else if ( in_array( $key, array( 'email' ) ) ) {
echo '<a href="mailto:'. antispambot( esc_attr( $url ) ) .'" aria-label="'. esc_attr__( 'Send email (opens in your application)', 'oceanwp' ) .'" target="_self">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
echo '<a href="'. $esc_url .'" '. $aria_label .' target="_'. esc_attr( $link_target ) .'" '. $link_rel .'>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '<span class="'. esc_attr( $val['icon_class'] ) .'" aria-hidden="true"></span>';
echo '</a>';
echo '</li>';
} // End url check
} // End loop ?>
</ul>
<?php } ?>
</div>
</div>
@@ -0,0 +1,194 @@
<?php
/**
* Center Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get classes.
$classes = array( 'clr' );
// Add container class.
if ( true !== get_theme_mod( 'ocean_header_full_width', false ) ) {
$classes[] = 'container';
}
// Add menus position class.
$position = get_theme_mod( 'ocean_center_header_menu_position', 'centered' );
$position = $position ? $position : 'centered';
$classes[] = $position;
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
// Left menu.
$left_menu = get_theme_mod( 'ocean_center_header_left_menu' );
$left_menu = '0' !== $left_menu ? $left_menu : '';
$left_menu = apply_filters( 'ocean_center_header_left_menu', $left_menu );
// Right menu.
$right_menu = apply_filters( 'ocean_main_menu_location', 'main_menu' );
$right_custom_menu = apply_filters( 'ocean_custom_menu', $right_menu );
// Retina logo.
$retina_logo = oceanwp_header_retina_logo_setting(); ?>
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="<?php echo esc_attr( $classes ); ?>">
<?php do_action( 'ocean_header_inner_left_content' ); ?>
<?php get_template_part( 'partials/header/logo' ); ?>
<?php
// If social.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
?>
<?php
// Get classes for the header menu.
$wrap_classes = oceanwp_header_menu_classes( 'wrapper' );
$inner_classes = oceanwp_header_menu_classes( 'inner' );
// Get menu classes.
$menu_classes = array( 'main-menu', 'dropdown-menu', 'sf-menu', 'clr' );
// Turn menu classes into space seperated string.
$menu_classes = implode( ' ', $menu_classes );
// Left menu arguments.
$left_menu_args = array(
'menu' => $left_menu,
'container' => false,
'fallback_cb' => false,
'items_wrap' => '%3$s',
'link_before' => '<span class="text-wrap">',
'link_after' => '</span>',
'walker' => new OceanWP_Custom_Nav_Walker(),
);
// Menu arguments.
$right_menu_args = array(
'theme_location' => $right_menu,
'container' => false,
'fallback_cb' => false,
'items_wrap' => '%3$s',
'link_before' => '<span class="text-wrap">',
'link_after' => '</span>',
'walker' => new OceanWP_Custom_Nav_Walker(),
);
// Check if right custom menu.
if ( '' !== $right_custom_menu ) {
$right_menu_args['menu'] = $right_custom_menu;
}
do_action( 'ocean_before_nav' );
?>
<div id="site-navigation-wrap" class="<?php echo esc_attr( $wrap_classes ); ?>">
<?php do_action( 'ocean_before_nav_inner' ); ?>
<nav id="site-navigation" class="<?php echo esc_attr( $inner_classes ); ?>"<?php oceanwp_schema_markup( 'site_navigation' ); ?> role="navigation">
<ul class="left-menu <?php echo esc_attr( $menu_classes ); ?>">
<?php
// Display menu if defined.
if ( $left_menu ) {
wp_nav_menu( $left_menu_args );
}
?>
</ul>
<?php do_action( 'ocean_before_logo' ); ?>
<div class="middle-site-logo <?php echo esc_attr( oceanwp_header_logo_classes() ); ?>">
<?php do_action( 'ocean_before_logo_inner' ); ?>
<?php
// Custom site-wide image logo.
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
do_action( 'ocean_before_logo_img' );
// Add srcset attr.
if ( $retina_logo ) {
add_filter( 'wp_get_attachment_image_attributes', 'oceanwp_header_retina_logo', 10, 3 );
}
// Default logo.
the_custom_logo();
// Remove filter to only add the srcset attr to the logo.
if ( $retina_logo ) {
remove_filter( 'wp_get_attachment_image_attributes', 'oceanwp_header_retina_logo', 10 );
}
do_action( 'ocean_after_logo_img' );
} else {
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="site-title site-logo-text"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
<?php } ?>
<?php do_action( 'ocean_after_logo_inner' ); ?>
</div>
<?php do_action( 'ocean_after_logo' ); ?>
<ul class="right-menu <?php echo esc_attr( $menu_classes ); ?>">
<?php
// Display menu if defined.
if ( has_nav_menu( $right_menu ) ) {
wp_nav_menu( $right_menu_args );
// Drop down search.
if ( 'drop_down' === oceanwp_menu_search_style() ) {
get_template_part( 'partials/header/search-dropdown' );
}
// WooCommerce cart.
if ( 'drop_down' === oceanwp_menu_cart_style() ) {
get_template_part( 'partials/cart/cart-dropdown' );
}
}
?>
</ul>
<?php
// Search header replace.
if ( 'header_replace' === oceanwp_menu_search_style() ) {
get_template_part( 'partials/header/search-replace' );
}
?>
</nav><!-- #site-navigation -->
<?php do_action( 'ocean_after_nav_inner' ); ?>
</div><!-- #site-navigation-wrap -->
<?php do_action( 'ocean_header_inner_right_content' ); ?>
</div><!-- #site-header-inner -->
<?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
<?php do_action( 'ocean_after_header_inner' ); ?>
@@ -0,0 +1,60 @@
<?php
/**
* Custom Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get ID.
$get_id = oceanwp_custom_header_template();
// Check if page is Elementor page.
$elementor = get_post_meta( $get_id, '_elementor_edit_mode', true );
// Get content.
$get_content = oceanwp_header_template_content();
// Get classes.
$classes = array( 'clr' );
// Add container class.
if ( true === get_theme_mod( 'ocean_add_custom_header_container', true ) ) {
$classes[] = 'container';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes ); ?>
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="<?php echo esc_attr( $classes ); ?>">
<?php
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
// If Elementor.
OceanWP_Elementor::get_header_content();
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $get_id ) ) {
// If Beaver Builder.
echo do_shortcode( '[fl_builder_insert_layout id="' . $get_id . '"]' );
} else {
// Display template content.
echo do_shortcode( $get_content );
}
?>
</div>
<?php do_action( 'ocean_after_header_inner' ); ?>
@@ -0,0 +1,54 @@
<?php
/**
* Full Screen Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get classes.
$classes = array( 'clr' );
// Add container class.
if ( true !== get_theme_mod( 'ocean_header_full_width', false ) ) {
$classes[] = 'container';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes ); ?>
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="<?php echo esc_attr( $classes ); ?>">
<?php do_action( 'ocean_header_inner_left_content' ); ?>
<?php get_template_part( 'partials/header/logo' ); ?>
<div id="site-navigation-wrap" class="clr">
<div class="menu-bar-wrap clr">
<div class="menu-bar-inner clr">
<a href="#" class="menu-bar"><span class="ham"></span></a>
</div>
</div>
<div id="full-screen-menu" class="clr">
<div id="full-screen-menu-inner" class="clr">
<?php get_template_part( 'partials/header/nav' ); ?>
</div>
</div>
</div><!-- #site-header-wrap -->
<?php do_action( 'ocean_header_inner_right_content' ); ?>
</div><!-- #site-header-inner -->
<?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
<?php do_action( 'ocean_after_header_inner' ); ?>
@@ -0,0 +1,38 @@
<?php
/**
* Search Form for The Medium Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Post type.
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' );
?>
<div id="medium-searchform" class="header-searchform-wrap clr">
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-searchform" role="search" aria-label="<?php esc_attr_e( 'Medium Header Search', 'oceanwp' ); ?>">
<input type="search" name="s" autocomplete="off" value="" />
<?php
// If the headerSearchForm script is not disable.
if ( OCEAN_EXTRA_ACTIVE
&& class_exists( 'Ocean_Extra_Scripts_Panel' )
&& Ocean_Extra_Scripts_Panel::get_setting( 'oe_headerSearchForm_script' ) ) {
?>
<label><?php oceanwp_theme_strings( 'owp-string-medium-header-search-text', 'oceanwp' ); ?></label>
<?php
}
?>
<button class="search-submit"><i class="icon-magnifier"></i></button>
<div class="search-bg"></div>
<?php if ( 'any' !== $post_type ) { ?>
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
<?php } ?>
<?php do_action( 'wpml_add_language_form_field' ); ?>
</form>
</div><!-- #medium-searchform -->
@@ -0,0 +1,112 @@
<?php
/**
* Medium Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get elements.
$elements = oceanwp_medium_header_elements();
// Define counter.
$count = '';
// Bottom header class.
$classes = array( 'bottom-header-wrap', 'clr' );
// Add the fixed class if only sticky menu.
if ( true === get_theme_mod( 'ocean_medium_header_stick_menu', false ) ) {
$classes[] = 'fixed-scroll';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
?>
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="clr">
<?php
// If elements.
if ( ! empty( $elements ) ) {
?>
<div class="top-header-wrap clr">
<div class="container clr">
<div class="top-header-inner clr">
<?php
// Loop through elements.
foreach ( $elements as $element ) :
// Counter.
$count++;
// Classes.
$e_classes = array( 'top-col', 'clr' );
// Count.
$e_classes[] = 'col-' . $count;
// If logo.
if ( 'logo' === $element ) {
$e_classes[] = 'logo-col';
}
// Turn classes into space seperated string.
$e_classes = implode( ' ', $e_classes );
?>
<div class="<?php echo esc_attr( $e_classes ); ?>">
<?php
// Search form.
if ( 'searchfrom' === $element ) {
get_template_part( 'partials/header/style/medium-header-search' );
} elseif ( 'logo' === $element ) {
// Logo.
get_template_part( 'partials/header/logo' );
} elseif ( 'social' === $element ) {
// Social buttons.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
}
?>
</div>
<?php
endforeach;
?>
</div>
</div>
</div>
<?php
}
?>
<div class="<?php echo esc_attr( $classes ); ?>">
<?php get_template_part( 'partials/header/nav' ); ?>
<?php get_template_part( 'partials/mobile/mobile-icon' ); ?>
<?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
</div>
</div><!-- #site-header-inner -->
<?php do_action( 'ocean_after_header_inner' ); ?>
@@ -0,0 +1,108 @@
<?php
/**
* Top Menu Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Menu position.
$position = get_theme_mod( 'ocean_top_header_menu_position', 'before' );
// Get classes.
$classes = array( 'clr' );
// Add container class.
if ( true !== get_theme_mod( 'ocean_header_full_width', false ) ) {
$classes[] = 'container';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
// Search style.
$search = oceanwp_menu_search_style(); ?>
<?php
if ( 'after' === $position ) {
?>
<div class="header-bottom clr">
<div class="container">
<?php get_template_part( 'partials/header/logo' ); ?>
</div>
</div>
<?php
}
?>
<div class="<?php echo esc_attr( oceanwp_top_header_classes() ); ?>">
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="<?php echo esc_attr( $classes ); ?>">
<?php
// Search header replace.
if ( 'header_replace' === $search ) {
get_template_part( 'partials/header/search-replace' );
}
?>
<div class="left clr">
<div class="inner">
<?php get_template_part( 'partials/header/nav' ); ?>
<?php get_template_part( 'partials/mobile/mobile-icon' ); ?>
</div>
</div>
<div class="right clr">
<div class="inner">
<?php
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
oceanwp_top_header_search();
// Search style.
if ( 'drop_down' === $search ) {
get_template_part( 'partials/header/search-dropdown' );
} elseif ( 'overlay' === $search ) {
get_template_part( 'partials/header/search-overlay' );
}
?>
</div>
</div>
</div><!-- #site-header-inner -->
<?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
<?php do_action( 'ocean_after_header_inner' ); ?>
</div><!-- .header-top -->
<?php
if ( 'before' === $position ) {
?>
<div class="header-bottom clr">
<div class="container">
<?php get_template_part( 'partials/header/logo' ); ?>
</div>
</div>
<?php
}
?>
@@ -0,0 +1,36 @@
<?php
/**
* Search Form for The Vertical Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Post type.
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' ); ?>
<div id="vertical-searchform" class="header-searchform-wrap clr">
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-searchform" role="search" aria-label="<?php esc_attr_e( 'Vertical Header Search', 'oceanwp' ); ?>">
<input type="search" name="s" autocomplete="off" value="" />
<?php
// If the headerSearchForm script is not disable.
if ( OCEAN_EXTRA_ACTIVE
&& class_exists( 'Ocean_Extra_Scripts_Panel' )
&& Ocean_Extra_Scripts_Panel::get_setting( 'oe_headerSearchForm_script' ) ) {
?>
<label><?php oceanwp_theme_strings( 'owp-string-vertical-header-search-text', 'oceanwp' ); ?></label>
<?php
}
?>
<button class="search-submit"><i class="icon-magnifier"></i></button>
<div class="search-bg"></div>
<?php if ( 'any' !== $post_type ) { ?>
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
<?php } ?>
<?php do_action( 'wpml_add_language_form_field' ); ?>
</form>
</div><!-- #vertical-searchform -->
@@ -0,0 +1,23 @@
<?php
/**
* Hamburger button for The Vertical Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$vertical_header_attrs = apply_filters( 'oceanwp_attrs_vertical_header_style', '' );
?>
<a href="javascript:void(0)" class="vertical-toggle">
<div class="hamburger hamburger--spin" <?php echo $vertical_header_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="hamburger-box">
<div class="hamburger-inner"></div>
</div>
</div>
</a>
@@ -0,0 +1,141 @@
<?php
/**
* Vertical Header Style
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get template.
$template = get_theme_mod( 'ocean_vertical_header_template' );
// Check if template is created with Elementor.
$elementor = get_post_meta( $template, '_elementor_edit_mode', true );
// Get template content.
if ( ! empty( $template ) ) {
$content = get_post( $template );
if ( $content && ! is_wp_error( $content ) ) {
$get_content = $content->post_content;
}
}
// Get bottom template.
$bottom_template = get_theme_mod( 'ocean_vertical_header_bottom_template' );
// Check if template is created with Elementor.
$bottom_elementor = get_post_meta( $bottom_template, '_elementor_edit_mode', true );
// Get bottom template content.
if ( ! empty( $bottom_template ) ) {
$bottom_content = get_post( $bottom_template );
if ( $bottom_content && ! is_wp_error( $bottom_content ) ) {
$get_bottom_content = $bottom_content->post_content;
}
}
// Get classes.
$classes = array( 'clr' );
// If template.
if ( ! empty( $template ) ) {
$classes[] = 'has-template';
}
// Add container class.
if ( true !== get_theme_mod( 'ocean_header_full_width', false ) ) {
$classes[] = 'container';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes ); ?>
<?php do_action( 'ocean_before_header_inner' ); ?>
<div id="site-header-inner" class="<?php echo esc_attr( $classes ); ?>">
<?php get_template_part( 'partials/header/logo' ); ?>
<?php
// If template.
if ( ! empty( $template ) ) {
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
// If Elementor.
OceanWP_Elementor::get_vertical_header_content();
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $template ) ) {
// If Beaver Builder.
echo do_shortcode( '[fl_builder_insert_layout id="' . $template . '"]' );
} else {
// Display template content.
echo do_shortcode( $get_content );
}
} else {
?>
<?php get_template_part( 'partials/header/nav' ); ?>
<?php
// Search form.
if ( true === get_theme_mod( 'ocean_vertical_header_search_form', true ) ) {
get_template_part( 'partials/header/style/vertical-header-search' );
}
?>
<?php
// Social menu.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
?>
<?php
// If bottom template.
if ( ! empty( $bottom_template ) ) {
if ( OCEANWP_ELEMENTOR_ACTIVE && $bottom_elementor ) {
// If Elementor.
OceanWP_Elementor::get_vertical_header_bottom_content();
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $bottom_template ) ) {
// If Beaver Builder.
echo do_shortcode( '[fl_builder_insert_layout id="' . $bottom_template . '"]' );
} else {
// Display bottom template content.
echo do_shortcode( $get_bottom_content );
}
}
?>
<?php
}
?>
<?php get_template_part( 'partials/mobile/mobile-icon' ); ?>
<?php get_template_part( 'partials/header/style/vertical-header-toggle' ); ?>
</div>
<?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
<?php do_action( 'ocean_after_header_inner' ); ?>
@@ -0,0 +1,19 @@
<?php
/**
* Outputs correct library layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
<article class="single-library-article clr">
<div class="entry clr"<?php oceanwp_schema_markup( 'entry_content' ); ?>>
<?php the_content(); ?>
</div>
</article>
@@ -0,0 +1,114 @@
<?php
/**
* Drop down mobile style template part.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( 'dropdown' !== oceanwp_mobile_menu_style()
|| ! oceanwp_display_navigation() ) {
return;
}
// Navigation classes.
$classes = array( 'clr' );
// If social.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
$classes[] = 'has-social';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
// Menu Location.
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
// Dropdown menu attributes.
$dropdown_menu_attrs = apply_filters( 'oceanwp_attrs_mobile_dropdown', '' );
// Menu arguments.
$menu_args = array(
'theme_location' => $menu_location,
'container' => false,
'fallback_cb' => false,
);
// Check if custom menu.
if ( $menu = oceanwp_header_custom_menu() ) {
$menu_args['menu'] = $menu;
}
// Left menu for the Center header style.
$left_menu = get_theme_mod( 'ocean_center_header_left_menu' );
$left_menu = '0' !== $left_menu ? $left_menu : '';
$left_menu = apply_filters( 'ocean_center_header_left_menu', $left_menu );
// Menu arguments.
$left_menu_args = array(
'menu' => $left_menu,
'container' => false,
'fallback_cb' => false,
);
// Top bar menu Location.
$top_menu_location = 'topbar_menu';
// Menu arguments.
$top_menu_args = array(
'theme_location' => $top_menu_location,
'container' => false,
'fallback_cb' => false,
);
// Get close menu text.
$close_text = get_theme_mod( 'ocean_mobile_menu_close_text' );
$close_text = oceanwp_tm_translation( 'ocean_mobile_menu_close_text', $close_text );
$close_text = $close_text ? $close_text : esc_html__( 'Close', 'oceanwp' );
?>
<div id="mobile-dropdown" class="clr" <?php echo $dropdown_menu_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<nav class="<?php echo esc_attr( $classes ); ?>"<?php oceanwp_schema_markup( 'site_navigation' ); ?>>
<?php
// If has mobile menu.
if ( has_nav_menu( 'mobile_menu' ) ) {
get_template_part( 'partials/mobile/mobile-nav' );
} else {
// If has center header style and left menu.
if ( 'center' === oceanwp_header_style()
&& $left_menu ) {
wp_nav_menu( $left_menu_args );
}
// Navigation.
wp_nav_menu( $menu_args );
// If has top bar menu.
if ( has_nav_menu( $top_menu_location ) ) {
wp_nav_menu( $top_menu_args );
}
}
// Social.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
// Mobile search form.
if ( get_theme_mod( 'ocean_mobile_menu_search', true ) ) {
get_template_part( 'partials/mobile/mobile-search' );
}
?>
</nav>
</div>
@@ -0,0 +1,37 @@
<?php
/**
* Search for the full screen mobile style.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( 'fullscreen' !== oceanwp_mobile_menu_style() ) {
return;
}
// Post type.
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' ); ?>
<div id="mobile-search" class="clr">
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-searchform" role="search" aria-label="<?php esc_attr_e( 'Mobile Search', 'oceanwp' ); ?>">
<input type="search" name="s" value="" autocomplete="off" />
<?php
// If the headerSearchForm script is not disable.
if ( OCEAN_EXTRA_ACTIVE
&& class_exists( 'Ocean_Extra_Scripts_Panel' )
&& Ocean_Extra_Scripts_Panel::get_setting( 'oe_headerSearchForm_script' ) ) {
?>
<label><?php oceanwp_theme_strings( 'owp-string-mobile-fs-search-text', 'oceanwp' ); ?><span><i></i><i></i><i></i></span></label>
<?php
}
?>
<?php if ( 'any' !== $post_type ) { ?>
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
<?php } ?>
</form>
</div>
@@ -0,0 +1,122 @@
<?php
/**
* Full screen mobile style template part.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( 'fullscreen' !== oceanwp_mobile_menu_style()
|| ! oceanwp_display_navigation() ) {
return;
}
// Navigation classes.
$classes = array( 'clr' );
// If social.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
$classes[] = 'has-social';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
// Fullscreen menu attributes.
$fullscreen_menu_attrs = apply_filters( 'oceanwp_attrs_mobile_fullscreen', '' );
$fs_menu_close_attrs = apply_filters( 'oceanwp_attrs_mobile_fullscreen_close', '' );
// Menu Location.
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
// Menu arguments.
$menu_args = array(
'theme_location' => $menu_location,
'menu_class' => 'fs-dropdown-menu',
'container' => false,
'fallback_cb' => false,
);
// Check if custom menu.
if ( $menu = oceanwp_header_custom_menu() ) {
$menu_args['menu'] = $menu;
}
// Left menu for the Center header style.
$left_menu = get_theme_mod( 'ocean_center_header_left_menu' );
$left_menu = '0' !== $left_menu ? $left_menu : '';
$left_menu = apply_filters( 'ocean_center_header_left_menu', $left_menu );
// Menu arguments.
$left_menu_args = array(
'menu' => $left_menu,
'container' => false,
'fallback_cb' => false,
);
// Top bar menu Location.
$top_menu_location = 'topbar_menu';
// Menu arguments.
$top_menu_args = array(
'theme_location' => $top_menu_location,
'menu_class' => 'fs-dropdown-menu',
'container' => false,
'fallback_cb' => false,
);
?>
<div id="mobile-fullscreen" class="clr" <?php echo $fullscreen_menu_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div id="mobile-fullscreen-inner" class="clr">
<a href="javascript:void(0)" class="close" aria-label="<?php esc_attr_e( 'Close Menu', 'oceanwp' ); ?>" <?php echo $fs_menu_close_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="close-icon-wrap">
<div class="close-icon-inner"></div>
</div>
</a>
<nav class="<?php echo esc_attr( $classes ); ?>"<?php oceanwp_schema_markup( 'site_navigation' ); ?> role="navigation">
<?php
// If has mobile menu.
if ( has_nav_menu( 'mobile_menu' ) ) {
get_template_part( 'partials/mobile/mobile-nav' );
} else {
// If has center header style and left menu.
if ( 'center' === oceanwp_header_style()
&& $left_menu ) {
wp_nav_menu( $left_menu_args );
}
// Navigation.
wp_nav_menu( $menu_args );
// If has top bar menu.
if ( has_nav_menu( $top_menu_location ) ) {
wp_nav_menu( $top_menu_args );
}
}
// Mobile search form.
if ( get_theme_mod( 'ocean_mobile_menu_search', true ) ) {
get_template_part( 'partials/mobile/mobile-fullscreen-search' );
}
// Social.
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
get_template_part( 'partials/header/social' );
}
?>
</nav>
</div>
</div>
@@ -0,0 +1,134 @@
<?php
/**
* Mobile Menu icon
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Retunr if disabled.
if ( ! oceanwp_display_navigation() ) {
return;
}
// Menu Location.
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
// Multisite global menu.
$ms_global_menu = apply_filters( 'ocean_ms_global_menu', false );
// Menu data attributes.
$toggle_menu_attrs = apply_filters( 'oceanwp_menu_toggle_data_attrs', '' );
// Display if menu is defined.
if ( has_nav_menu( $menu_location ) || $ms_global_menu ) :
// Get menu icon.
$icon = get_theme_mod( 'ocean_mobile_menu_open_icon', 'fa fa-bars' );
$icon = apply_filters( 'ocean_mobile_menu_navbar_open_icon', $icon );
// Custom hamburger button.
$btn = get_theme_mod( 'ocean_mobile_menu_open_hamburger', 'default' );
// Get menu text.
$text = get_theme_mod( 'ocean_mobile_menu_text' );
$text = oceanwp_tm_translation( 'ocean_mobile_menu_text', $text );
$text = $text ? $text : esc_html__( 'Menu', 'oceanwp' );
// Get close menu text.
$close_text = get_theme_mod( 'ocean_mobile_menu_close_text' );
$close_text = oceanwp_tm_translation( 'ocean_mobile_menu_close_text', $close_text );
$close_text = $close_text ? $close_text : esc_html__( 'Close', 'oceanwp' );
if ( OCEANWP_WOOCOMMERCE_ACTIVE ) {
// Get cart icon.
$woo_icon = get_theme_mod( 'ocean_woo_menu_icon', 'icon-handbag' );
$woo_icon = $woo_icon ? $woo_icon : 'icon-handbag';
// If has custom cart icon.
$custom_icon = get_theme_mod( 'ocean_woo_menu_custom_icon' );
if ( '' !== $custom_icon ) {
$woo_icon = $custom_icon;
}
// Cart Icon.
$cart_icon = '<i class="' . esc_attr( $woo_icon ) . '" aria-hidden="true"></i>';
$cart_icon = apply_filters( 'ocean_menu_cart_icon_html', $cart_icon );
}
// Classes.
$classes = array( 'oceanwp-mobile-menu-icon', 'clr' );
// Position.
if ( 'three' === get_theme_mod( 'ocean_mobile_elements_positioning', 'one' ) ) {
$classes[] = 'mobile-left';
} else {
$classes[] = 'mobile-right';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes ); ?>
<div class="<?php echo esc_attr( $classes ); ?>">
<?php do_action( 'ocean_before_mobile_icon' ); ?>
<?php
// If big header style.
if ( 'big' === oceanwp_header_style() ) {
?>
<div class="container clr">
<?php
}
?>
<?php do_action( 'ocean_before_mobile_icon_inner' ); ?>
<a href="javascript:void(0)" class="mobile-menu" <?php echo $toggle_menu_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> aria-label="<?php esc_attr_e( 'Mobile Menu', 'oceanwp' ); ?>">
<?php
if ( 'default' !== $btn ) {
?>
<div class="hamburger hamburger--<?php echo esc_attr( $btn ); ?>" aria-expanded="false">
<div class="hamburger-box">
<div class="hamburger-inner"></div>
</div>
</div>
<?php
} else {
?>
<i class="<?php echo esc_attr( $icon ); ?>" aria-hidden="true"></i>
<?php
}
// Mobile menu text.
if ( get_theme_mod( 'ocean_mobile_menu_display_opening_text', true ) ) {
?>
<span class="oceanwp-text"><?php echo do_shortcode( $text ); ?></span>
<span class="oceanwp-close-text"><?php echo do_shortcode( $close_text ); ?></span>
<?php
}
?>
</a>
<?php do_action( 'ocean_after_mobile_icon_inner' ); ?>
<?php
// If big header style.
if ( 'big' === oceanwp_header_style() ) {
?>
</div>
<?php
}
?>
<?php do_action( 'ocean_after_mobile_icon' ); ?>
</div><!-- #oceanwp-mobile-menu-navbar -->
<?php endif; ?>
@@ -0,0 +1,42 @@
<?php
/**
* Mobile nav template part.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Menu Location.
$menu_location = apply_filters( 'ocean_mobile_menu_location', 'mobile_menu' );
// Menu arguments.
$menu_args = array(
'theme_location' => $menu_location,
'container' => false,
'fallback_cb' => false,
);
// If sidebar mobile menu style.
if ( 'sidebar' === oceanwp_mobile_menu_style() ) {
$menu_args['menu_class'] = 'mobile-menu dropdown-menu';
}
// Display menu if defined.
if ( has_nav_menu( $menu_location ) ) : ?>
<div id="mobile-nav" class="navigation clr">
<?php
// Display menu.
wp_nav_menu( $menu_args );
?>
</div>
<?php endif; ?>
@@ -0,0 +1,34 @@
<?php
/**
* Mobile search template.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Post type.
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' );
$ocean_msf_id = oceanwp_unique_id( 'ocean-mobile-search' );
$mosf_id = esc_attr( $ocean_msf_id );
?>
<div id="mobile-menu-search" class="clr">
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="mobile-searchform" role="search" aria-label="<?php esc_attr_e( 'Search for:', 'oceanwp' ); ?>">
<label for="<?php echo esc_attr( $mosf_id ); ?>">
<input type="search" name="s" autocomplete="off" placeholder="<?php oceanwp_theme_strings( 'owp-string-mobile-search-text', 'oceanwp' ); ?>" />
<button type="submit" class="searchform-submit" aria-label="<?php esc_attr_e( 'Submit Search', 'oceanwp' ); ?>">
<i class="icon icon-magnifier" aria-hidden="true"></i>
</button>
<?php if ( 'any' !== $post_type ) { ?>
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
<?php } ?>
</label>
<?php do_action( 'wpml_add_language_form_field' ); ?>
</form>
</div><!-- .mobile-menu-search -->
@@ -0,0 +1,28 @@
<?php
/**
* Mobile Menu sidr close
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get icon.
$icon = get_theme_mod( 'ocean_mobile_menu_close_btn_icon', 'icon-close' );
$icon = apply_filters( 'ocean_mobile_menu_close_btn_icon', $icon );
// Text.
$text = get_theme_mod( 'ocean_mobile_menu_close_btn_text' );
$text = oceanwp_tm_translation( 'ocean_mobile_menu_close_btn_text', $text );
$text = $text ? $text : esc_html__( 'Close Menu', 'oceanwp' );
?>
<div id="sidr-close">
<a href="javascript:void(0)" class="toggle-sidr-close" aria-label="<?php esc_attr_e( 'Close mobile Menu', 'oceanwp' ); ?>">
<i class="icon <?php echo esc_attr( $icon ); ?>" aria-hidden="true"></i><span class="close-text"><?php echo do_shortcode( $text ); ?></span>
</a>
</div>
@@ -0,0 +1,63 @@
<?php
/**
* The template for displaying a "No posts found" message.
*
* @package OceanWP WordPress theme
*/
?>
<div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) { ?>
<p>
<?php
/* translators: 1: Admin URL 2: </a> */
echo sprintf( esc_html__( 'Ready to publish your first post? %1$sGet started here%2$s.', 'oceanwp' ), '<a href="' . esc_url( admin_url( 'post-new.php' ) ) . '" target="_blank">', '</a>' );
?>
</p>
<?php } elseif ( is_search() ) { ?>
<p>
<?php
esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with different keywords.', 'oceanwp' );
?>
</p>
<?php } elseif ( is_category() ) { ?>
<p>
<?php
esc_html_e( 'There aren\'t any posts currently published in this category.', 'oceanwp' );
?>
</p>
<?php } elseif ( is_tax() ) { ?>
<p>
<?php
esc_html_e( 'There aren\'t any posts currently published under this taxonomy.', 'oceanwp' );
?>
</p>
<?php } elseif ( is_tag() ) { ?>
<p>
<?php
esc_html_e( 'There aren\'t any posts currently published under this tag.', 'oceanwp' );
?>
</p>
<?php } else { ?>
<p>
<?php
esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for.', 'oceanwp' );
?>
</p>
<?php } ?>
</div><!-- .page-content -->
@@ -0,0 +1,21 @@
<?php
/**
* The template for displaying the page subheading
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Display subheading if there is one.
if ( $subheading = oceanwp_get_page_subheading() ) :
?>
<div class="clr page-subheading">
<?php echo do_shortcode( $subheading ); ?>
</div><!-- .page-subheading -->
<?php endif; ?>
@@ -0,0 +1,78 @@
<?php
/**
* The template for displaying the page header.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if page header is disabled.
if ( ! oceanwp_has_page_header() ) {
return;
}
// Classes.
$classes = array( 'page-header' );
// Get header style.
$style = oceanwp_page_header_style();
// Add classes for title style.
if ( $style ) {
$classes[ $style . '-page-header' ] = $style . '-page-header';
}
// Visibility.
$visibility = get_theme_mod( 'ocean_page_header_visibility', 'all-devices' );
if ( 'all-devices' !== $visibility ) {
$classes[] = $visibility;
}
// Turn into space seperated list.
$classes = implode( ' ', $classes );
// Heading tag.
$heading = get_theme_mod( 'ocean_page_header_heading_tag', 'h1' );
$heading = $heading ? $heading : 'h1';
$heading = apply_filters( 'ocean_page_header_heading', $heading );
?>
<?php do_action( 'ocean_before_page_header' ); ?>
<header class="<?php echo esc_attr( $classes ); ?>">
<?php do_action( 'ocean_before_page_header_inner' ); ?>
<div class="container clr page-header-inner">
<?php
// Return if page header is disabled.
if ( oceanwp_has_page_header_heading() ) {
?>
<<?php echo esc_attr( $heading ); ?> class="page-header-title clr"<?php oceanwp_schema_markup( 'headline' ); ?>><?php echo wp_kses_post( oceanwp_title() ); ?></<?php echo esc_attr( $heading ); ?>>
<?php get_template_part( 'partials/page-header-subheading' ); ?>
<?php } ?>
<?php
if ( function_exists( 'oceanwp_breadcrumb_trail' ) ) {
oceanwp_breadcrumb_trail();
}
?>
</div><!-- .page-header-inner -->
<?php oceanwp_page_header_overlay(); ?>
<?php do_action( 'ocean_after_page_header_inner' ); ?>
</header><!-- .page-header -->
<?php do_action( 'ocean_after_page_header' ); ?>
@@ -0,0 +1,32 @@
<?php
/**
* Outputs page article
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div class="entry clr"<?php oceanwp_schema_markup( 'entry_content' ); ?>>
<?php do_action( 'ocean_before_page_entry' ); ?>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'oceanwp' ),
'after' => '</div>',
)
);
?>
<?php do_action( 'ocean_after_page_entry' ); ?>
</div>
@@ -0,0 +1,27 @@
<?php
/**
* Outputs correct page layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<article class="single-page-article clr">
<?php
// Get page entry.
get_template_part( 'partials/page/article' );
// Display comments.
comments_template();
?>
</article>
@@ -0,0 +1,26 @@
<?php
/**
* The template for displaying the scroll top button.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// If no scroll top button.
if ( ! oceanwp_display_scroll_up_button() ) {
return;
}
// Get arrow.
$arrow = apply_filters( 'ocean_scroll_top_arrow', get_theme_mod( 'ocean_scroll_top_arrow' ) );
$arrow = $arrow ? $arrow : 'fa fa-angle-up';
// Position.
$position = apply_filters( 'ocean_scroll_top_position', get_theme_mod( 'ocean_scroll_top_position' ) );
$position = $position ? $position : 'right'; ?>
<a id="scroll-top" class="scroll-top-<?php echo esc_attr( $position ); ?>" href="#"><span class="<?php echo esc_attr( $arrow ); ?>" aria-label="<?php esc_attr_e( 'Scroll to the top of the page', 'oceanwp' ); ?>"></span></a>
@@ -0,0 +1,33 @@
<?php
/**
* Search result page entry content
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $post;
// Excerpt length.
$length = apply_filters( 'ocean_search_results_excerpt_length', '30' );
?>
<div class="search-entry-summary clr"<?php oceanwp_schema_markup( 'entry_content' ); ?>>
<p>
<?php
// Display excerpt.
if ( has_excerpt( $post->ID ) ) {
the_excerpt();
} else {
// Display custom excerpt.
echo wp_trim_words( strip_shortcodes( $post->post_content ), $length ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</p>
</div><!-- .search-entry-summary -->
@@ -0,0 +1,19 @@
<?php
/**
* Search result page entry header
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<header class="search-entry-header clr">
<h2 class="search-entry-title entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
</header>
@@ -0,0 +1,42 @@
<?php
/**
* Search result page entry layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="search-entry-inner clr">
<?php
// Featured Image.
get_template_part( 'partials/search/thumbnail' );
?>
<div class="search-entry-content clr">
<?php
// Title.
get_template_part( 'partials/search/header' );
// Content.
get_template_part( 'partials/search/content' );
// Read more button.
get_template_part( 'partials/search/readmore' );
?>
</div><!-- .search-entry-content -->
</div><!-- .search-entry-inner -->
</article><!-- #post-## -->
@@ -0,0 +1,18 @@
<?php
/**
* Search result page entry read more
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div class="search-entry-readmore clr">
<a href="<?php the_permalink(); ?>" title="<?php oceanwp_theme_strings( 'owp-string-search-continue-reading', 'oceanwp' ); ?>"><?php oceanwp_theme_strings( 'owp-string-search-continue-reading', 'oceanwp' ); ?></a>
<span class="screen-reader-text"><?php the_title(); ?></span>
</div><!-- .search-entry-readmore -->
@@ -0,0 +1,37 @@
<?php
/**
* Displays the post entry thumbmnail
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if there isn't a thumbnail defined.
if ( ! has_post_thumbnail() ) {
return;
}
// Image args.
$img_args = array(
'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
} ?>
<div class="thumbnail">
<a href="<?php the_permalink(); ?>" class="thumbnail-link">
<?php
// Display post thumbnail.
the_post_thumbnail( 'thumbnail', $img_args );
?>
</a>
</div><!-- .thumbnail -->
@@ -0,0 +1,72 @@
<?php
/**
* Author bio template
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Only display for standard posts.
if ( 'post' !== get_post_type() ) {
return;
}
// Get author data.
$author = get_the_author();
$description = get_the_author_meta( 'description' );
$url = esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) );
// Only display if author has a description.
if ( ! $description ) {
return;
}
?>
<?php do_action( 'ocean_before_single_post_author_bio' ); ?>
<section id="author-bio" class="clr">
<div id="author-bio-inner">
<div class="author-bio-avatar">
<a href="<?php echo esc_url( $url ); ?>" title="<?php esc_attr_e( 'Visit Author Page', 'oceanwp' ); ?>" rel="author" >
<?php
// Display author avatar.
echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'ocean_author_bio_avatar_size', 100 ) );
?>
</a>
</div><!-- .author-bio-avatar -->
<div class="author-bio-content clr">
<h4 class="author-bio-title">
<a href="<?php echo esc_url( $url ); ?>" title="<?php esc_attr_e( 'Visit Author Page', 'oceanwp' ); ?>">
<?php echo esc_html( wp_strip_all_tags( $author ) ); ?>
</a>
</h4><!-- .author-bio-title -->
<?php
// Outputs the author description if one exists.
if ( $description ) :
?>
<div class="author-bio-description clr">
<?php echo wp_kses_post( $description ); ?>
</div><!-- author-bio-description -->
<?php endif; ?>
</div>
</div><!-- #author-bio-inner -->
</section><!-- #author-bio -->
<?php do_action( 'ocean_after_single_post_author_bio' ); ?>
@@ -0,0 +1,33 @@
<?php
/**
* Post single content
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<?php do_action( 'ocean_before_single_post_content' ); ?>
<div class="entry-content clr"<?php oceanwp_schema_markup( 'entry_content' ); ?>>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'oceanwp' ),
'after' => '</div>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
)
);
?>
</div><!-- .entry -->
<?php do_action( 'ocean_after_single_post_content' ); ?>
@@ -0,0 +1,31 @@
<?php
/**
* Displays the post header
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if quote format.
if ( 'quote' === get_post_format() ) {
return;
}
// Heading tag.
$heading = get_theme_mod( 'ocean_single_post_heading_tag', 'h2' );
$heading = $heading ? $heading : 'h2';
$heading = apply_filters( 'ocean_single_post_heading', $heading );
?>
<?php do_action( 'ocean_before_single_post_title' ); ?>
<header class="entry-header clr">
<<?php echo esc_attr( $heading ); ?> class="single-post-title entry-title"<?php oceanwp_schema_markup( 'headline' ); ?>><?php the_title(); ?></<?php echo esc_attr( $heading ); ?>><!-- .single-post-title -->
</header><!-- .entry-header -->
<?php do_action( 'ocean_after_single_post_title' ); ?>
@@ -0,0 +1,103 @@
<?php
/**
* Single post layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<article id="post-<?php the_ID(); ?>">
<?php
// Get posts format.
$format = get_post_format();
// Get elements.
$elements = oceanwp_blog_single_elements_positioning();
// Loop through elements.
foreach ( $elements as $element ) {
// Featured Image.
if ( 'featured_image' === $element
&& ! post_password_required() ) {
$format = $format ? $format : 'thumbnail';
get_template_part( 'partials/single/media/blog-single', $format );
}
// Title.
if ( 'title' === $element ) {
get_template_part( 'partials/single/header' );
}
// Meta.
if ( 'meta' === $element ) {
get_template_part( 'partials/single/meta' );
}
// Content.
if ( 'content' === $element ) {
get_template_part( 'partials/single/content' );
}
// Tags.
if ( 'tags' === $element ) {
get_template_part( 'partials/single/tags' );
}
// Social Share.
if ( 'social_share' === $element
&& OCEAN_EXTRA_ACTIVE ) {
do_action( 'ocean_social_share' );
}
// Next/Prev.
if ( 'next_prev' === $element ) {
get_template_part( 'partials/single/next-prev' );
}
// Author Box.
if ( 'author_box' === $element ) {
get_template_part( 'partials/single/author-bio' );
}
// Related Posts.
if ( 'related_posts' === $element ) {
get_template_part( 'partials/single/related-posts' );
}
// Comments.
if ( 'single_comments' === $element ) {
comments_template();
}
}
?>
</article>
@@ -0,0 +1,35 @@
<?php
/**
* Blog single audio format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
// Get audio html.
$audio = oceanwp_get_post_audio_html();
// Display audio if audio exists and the post isn't protected.
if ( $audio && ! post_password_required() ) :
?>
<div id="post-media" class="thumbnail clr">
<div class="blog-post-audio clr"><?php echo $audio; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
</div>
<?php
// Else display post thumbnail.
else :
get_template_part( 'partials/single/media/blog-single' );
endif;
@@ -0,0 +1,74 @@
<?php
/**
* Blog single gallery format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
// Get attachments.
$attachments = oceanwp_get_gallery_ids( get_the_ID() );
// Return standard entry style if password protected or there aren't any attachments.
if ( post_password_required() || empty( $attachments ) ) {
get_template_part( 'partials/single/media/blog-single' );
return;
}
?>
<div class="thumbnail">
<div class="gallery-format clr">
<?php
// Loop through each attachment ID.
foreach ( $attachments as $attachment ) :
// Get attachment data.
$attachment_title = get_the_title( $attachment );
$attachment_alt = get_post_meta( $attachment, '_wp_attachment_image_alt', true );
$attachment_alt = $attachment_alt ? $attachment_alt : $attachment_title;
// Get image output.
$attachment_html = wp_get_attachment_image(
$attachment,
'full',
'',
array(
'alt' => $attachment_alt,
'itemprop' => 'image',
)
);
// Display with lightbox.
if ( oceanwp_gallery_is_lightbox_enabled() === 'on' ) :
?>
<a href="<?php echo esc_url( wp_get_attachment_url( $attachment ) ); ?>" title="<?php echo esc_attr( $attachment_alt ); ?>" class="gallery-lightbox">
<?php echo wp_kses_post( $attachment_html ); ?>
</a>
<?php
// Display single image.
else :
echo wp_kses_post( $attachment_html );
endif;
endforeach;
?>
</div>
</div>
@@ -0,0 +1,54 @@
<?php
/**
* Blog single link format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if there isn't a thumbnail defined.
if ( ! has_post_thumbnail() ) {
return;
}
// Image args.
$img_args = array(
'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
}
// Caption.
$caption = get_the_post_thumbnail_caption();
?>
<div class="thumbnail">
<?php
// Display post thumbnail.
the_post_thumbnail( 'full', $img_args );
// Caption.
if ( $caption ) {
?>
<div class="thumbnail-caption">
<?php echo wp_kses_post( $caption ); ?>
</div>
<?php
}
?>
<div class="link-entry clr">
<a href="<?php echo esc_url( get_post_meta( get_the_ID(), 'ocean_link_format', true ) ); ?>" target="_<?php echo esc_attr( get_post_meta( get_the_ID(), 'ocean_link_format_target', true ) ); ?>"><i class="icon-link"></i></a>
</div>
</div>
@@ -0,0 +1,32 @@
<?php
/**
* Blog single quote format
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
?>
<div class="post-quote-wrap">
<div class="post-quote-content">
<?php echo wp_kses_post( get_post_meta( get_the_ID(), 'ocean_quote_format', true ) ); ?>
<span class="post-quote-icon icon-speech"></span>
</div>
<div class="post-quote-author"><?php the_title(); ?></div>
</div>
@@ -0,0 +1,41 @@
<?php
/**
* Blog single video format media
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if Ocean Extra is not active.
if ( ! OCEAN_EXTRA_ACTIVE ) {
return;
}
// Get post video.
$video = oceanwp_get_post_video_html();
// Display video if one exists and it's not a password protected post.
if ( $video && ! post_password_required() ) :
?>
<div id="post-media" class="thumbnail clr">
<div class="blog-post-video">
<?php echo $video; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div><!-- .blog-post-video -->
</div><!-- #post-media -->
<?php
// Else display post thumbnail.
else :
get_template_part( 'partials/single/media/blog-single' );
endif;
@@ -0,0 +1,61 @@
<?php
/**
* Displays the post single thumbmnail
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Return if there isn't a thumbnail defined.
if ( ! has_post_thumbnail() ) {
return;
}
// LLMS Integration.
if ( OCEANWP_LIFTERLMS_ACTIVE ) {
$details = get_theme_mod( 'ocean_llms_course_details', array( 'image', 'description', 'meta', 'author', 'progress', 'syllabus' ) );
if ( is_course() && ! in_array( 'image', $details, true ) ) {
return;
}
if ( is_membership() && ! ( get_theme_mod( 'ocean_llms_membership_image', false ) ) ) {
return;
}
}
// Image args.
$img_args = array(
'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
}
// Caption.
$caption = get_the_post_thumbnail_caption();
?>
<div class="thumbnail">
<?php
// Display post thumbnail.
the_post_thumbnail( 'full', $img_args );
// Caption.
if ( $caption ) {
?>
<div class="thumbnail-caption">
<?php echo wp_kses_post( $caption ); ?>
</div>
<?php
}
?>
</div><!-- .thumbnail -->
@@ -0,0 +1,64 @@
<?php
/**
* Post single meta
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get meta sections.
$sections = oceanwp_blog_single_meta();
// Return if sections are empty.
if ( empty( $sections )
|| 'post' !== get_post_type() ) {
return;
}
// Return if quote format.
if ( 'quote' === get_post_format() ) {
return;
} ?>
<?php do_action( 'ocean_before_single_post_meta' ); ?>
<ul class="meta clr">
<?php
// Loop through meta sections.
foreach ( $sections as $section ) {
?>
<?php if ( 'author' === $section ) { ?>
<li class="meta-author"<?php oceanwp_schema_markup( 'author_name' ); ?>><span class="screen-reader-text"><?php esc_html_e( 'Post author:', 'oceanwp' ); ?></span><i class="icon-user" aria-hidden="true"></i><?php echo esc_html( the_author_posts_link() ); ?></li>
<?php } ?>
<?php if ( 'date' === $section ) { ?>
<li class="meta-date"<?php oceanwp_schema_markup( 'publish_date' ); ?>><span class="screen-reader-text"><?php esc_html_e( 'Post published:', 'oceanwp' ); ?></span><i class="icon-clock" aria-hidden="true"></i><?php echo get_the_date(); ?></li>
<?php } ?>
<?php if ( 'mod-date' === $section ) { ?>
<li class="meta-mod-date"<?php oceanwp_schema_markup( 'modified_date' ); ?>><span class="screen-reader-text"><?php esc_html_e( 'Post last modified:', 'oceanwp' ); ?></span><i class="icon-note" aria-hidden="true"></i><?php echo esc_html( get_the_modified_date() ); ?></li>
<?php } ?>
<?php if ( 'categories' === $section ) { ?>
<li class="meta-cat"><span class="screen-reader-text"><?php esc_html_e( 'Post category:', 'oceanwp' ); ?></span><i class="icon-folder" aria-hidden="true"></i><?php the_category( ' <span class="owp-sep">/</span> ', get_the_ID() ); ?></li>
<?php } ?>
<?php if ( 'reading-time' === $section ) { ?>
<li class="meta-cat"><span class="screen-reader-text"><?php esc_html_e( 'Reading time:', 'oceanwp' ); ?></span><i class="icon-cup" aria-hidden="true"></i><?php echo esc_attr( ocean_reading_time() ); ?></li>
<?php } ?>
<?php if ( 'comments' === $section && comments_open() && ! post_password_required() ) { ?>
<li class="meta-comments"><span class="screen-reader-text"><?php esc_html_e( 'Post comments:', 'oceanwp' ); ?></span><i class="icon-bubble" aria-hidden="true"></i><?php comments_popup_link( esc_html__( '0 Comments', 'oceanwp' ), esc_html__( '1 Comment', 'oceanwp' ), esc_html__( '% Comments', 'oceanwp' ), 'comments-link' ); ?></li>
<?php } ?>
<?php } ?>
</ul>
<?php do_action( 'ocean_after_single_post_meta' ); ?>
@@ -0,0 +1,54 @@
<?php
/**
* The next/previous links to go to another post.
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Only display for standard posts.
if ( 'post' !== get_post_type() ) {
return;
}
// Term.
$term_tax = get_theme_mod( 'ocean_single_post_next_prev_taxonomy', 'post_tag' );
$term_tax = $term_tax ? $term_tax : 'post_tag';
// Vars.
$prev_text = '<span class="title"><i class="fas fa-long-arrow-alt-left" aria-hidden="true"></i>' . oceanwp_theme_strings( 'owp-string-single-prev-post', false, 'oceanwp' ) . '</span><span class="post-title">%title</span>';
$next_text = '<span class="title"><i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i>' . oceanwp_theme_strings( 'owp-string-single-next-post', false, 'oceanwp' ) . '</span><span class="post-title">%title</span>';
$screen_rt = oceanwp_theme_strings( 'owp-string-single-screen-reader-rm', false, 'oceanwp' );
// Args.
if ( 'pub-date' === $term_tax ) {
$args = array(
'prev_text' => $prev_text,
'next_text' => $next_text,
'in_same_term' => false,
'screen_reader_text' => $screen_rt,
);
} else {
$args = array(
'prev_text' => $prev_text,
'next_text' => $next_text,
'in_same_term' => true,
'taxonomy' => $term_tax,
'screen_reader_text' => $screen_rt,
);
}
// Display Next/Prev navigation.
$args = apply_filters( 'ocean_single_post_next_prev_args', $args ); ?>
<?php do_action( 'ocean_before_single_post_next_prev' ); ?>
<?php the_post_navigation( $args ); ?>
<?php
do_action( 'ocean_after_single_post_next_prev' );
@@ -0,0 +1,210 @@
<?php
/**
* Single related posts
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Only display for standard posts.
if ( 'post' !== get_post_type() ) {
return;
}
// Number of columns for entries.
$oceanwp_columns = apply_filters( 'ocean_related_blog_posts_columns', absint( get_theme_mod( 'ocean_blog_related_columns', '3' ) ) );
// Term.
$term_tax = get_theme_mod( 'ocean_blog_related_taxonomy', 'category' );
$term_tax = $term_tax ? $term_tax : 'category';
// Create an array of current term ID's.
$terms = wp_get_post_terms( get_the_ID(), $term_tax );
$terms_ids = array();
foreach ( $terms as $termkey ) {
$terms_ids[] = $termkey->term_id;
}
// Query args.
$args = array(
'posts_per_page' => apply_filters( 'ocean_related_blog_posts_count', absint( get_theme_mod( 'ocean_blog_related_count', '3' ) ) ),
'orderby' => 'rand',
'post__not_in' => array( get_the_ID() ),
'no_found_rows' => true,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-quote', 'post-format-link' ),
'operator' => 'NOT IN',
),
),
);
// If category.
if ( 'category' === $term_tax ) {
$args['category__in'] = $terms_ids;
}
// If tags.
if ( 'post_tag' === $term_tax ) {
$args['tag__in'] = $terms_ids;
}
// Args.
$args = apply_filters( 'ocean_blog_post_related_query_args', $args );
do_action( 'ocean_before_single_post_related_posts' );
// Related query arguments.
$oceanwp_related_query = new WP_Query( $args );
// If the custom query returns post display related posts section.
if ( $oceanwp_related_query->have_posts() ) :
// Wrapper classes.
$classes = 'clr';
if ( 'full-screen' === oceanwp_post_layout() ) {
$classes .= ' container';
} ?>
<section id="related-posts" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="theme-heading related-posts-title">
<span class="text"><?php oceanwp_theme_strings( 'owp-string-single-related-posts', 'oceanwp' ); ?></span>
</h3>
<div class="oceanwp-row clr">
<?php $oceanwp_count = 0; ?>
<?php
foreach ( $oceanwp_related_query->posts as $post ) :
setup_postdata( $post );
?>
<?php
$oceanwp_count++;
// Disable embeds.
$show_embeds = apply_filters( 'ocean_related_blog_posts_embeds', false );
// Get post format.
$format = get_post_format();
// Add classes.
$classes = array( 'related-post', 'clr', 'col' );
$classes[] = oceanwp_grid_class( $oceanwp_columns );
$classes[] = 'col-' . $oceanwp_count;
?>
<article <?php post_class( $classes ); ?>>
<?php
// Display post video.
if ( $show_embeds && 'video' === $format && oceanwp_get_post_video_html() === $video ) :
?>
<div class="related-post-video">
<?php echo $video; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div><!-- .related-post-video -->
<?php
// Display post audio.
elseif ( $show_embeds && 'audio' === $format && oceanwp_get_post_audio_html() === $audio ) :
?>
<div class="related-post-video">
<?php echo $audio; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div><!-- .related-post-audio -->
<?php
// Display post thumbnail.
elseif ( has_post_thumbnail() ) :
?>
<figure class="related-post-media clr">
<a href="<?php the_permalink(); ?>" class="related-thumb">
<?php
// Image width.
$img_width = apply_filters( 'ocean_related_blog_posts_img_width', absint( get_theme_mod( 'ocean_blog_related_img_width' ) ) );
$img_height = apply_filters( 'ocean_related_blog_posts_img_height', absint( get_theme_mod( 'ocean_blog_related_img_height' ) ) );
// Images attr.
$img_id = get_post_thumbnail_id( get_the_ID(), 'full' );
$img_url = wp_get_attachment_image_src( $img_id, 'full', true );
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_image_attributes' ) ) {
$img_atts = ocean_extra_image_attributes( $img_url[1], $img_url[2], $img_width, $img_height );
}
// If Ocean Extra is active and has a custom size.
if ( OCEAN_EXTRA_ACTIVE
&& function_exists( 'ocean_extra_resize' )
&& ! empty( $img_atts ) ) {
?>
<img src="<?php echo ocean_extra_resize( $img_url[0], $img_atts['width'], $img_atts['height'], $img_atts['crop'], true, $img_atts['upscale'] ); ?>" alt="<?php the_title_attribute(); ?>" width="<?php echo esc_attr( $img_width ); ?>" height="<?php echo esc_attr( $img_height ); ?>"<?php oceanwp_schema_markup( 'image' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> />
<?php
} else {
// Images size.
if ( 'full-width' === oceanwp_post_layout()
|| 'full-screen' === oceanwp_post_layout() ) {
$size = 'medium_large';
} else {
$size = 'medium';
}
// Image args.
$img_args = array(
'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
$img_args['itemprop'] = 'image';
}
// Display post thumbnail.
the_post_thumbnail( $size, $img_args );
}
?>
</a>
</figure>
<?php endif; ?>
<h3 class="related-post-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h3><!-- .related-post-title -->
<time class="published" datetime="<?php echo esc_html( get_the_date( 'c' ) ); ?>"><i class="icon-clock" aria-hidden="true"></i><?php echo esc_html( get_the_date() ); ?></time>
</article><!-- .related-post -->
<?php
if ( $oceanwp_columns === $oceanwp_count ) {
$oceanwp_count = 0;
}
?>
<?php endforeach; ?>
</div><!-- .oceanwp-row -->
</section><!-- .related-posts -->
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<?php do_action( 'ocean_after_single_post_related_posts' ); ?>
@@ -0,0 +1,16 @@
<?php
/**
* Blog single tags
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Display tags. ?>
<div class="post-tags clr">
<?php the_tags( '<span class="owp-tag-text">' . esc_attr__( 'Tags: ', 'oceanwp' ) . '</span>', '<span class="owp-sep">,</span> ', '' ); ?>
</div>
@@ -0,0 +1,97 @@
<?php
/**
* Topbar content
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get the template.
$template = get_theme_mod( 'ocean_top_bar_template' );
// Check if page is Elementor page.
$elementor = get_post_meta( $template, '_elementor_edit_mode', true );
// Get content.
$get_content = oceanwp_topbar_template_content();
// Get topbar content.
$content = get_theme_mod( 'ocean_top_bar_content' );
$content = oceanwp_tm_translation( 'ocean_top_bar_content', $content );
// Display topbar content.
if ( ! empty( $template )
|| $content
|| has_nav_menu( 'topbar_menu' )
|| is_customize_preview() ) : ?>
<div id="top-bar-content" class="<?php echo esc_attr( oceanwp_topbar_content_classes() ); ?>">
<?php
// Get topbar menu.
if ( has_nav_menu( 'topbar_menu' ) ) {
get_template_part( 'partials/topbar/nav' );
}
?>
<?php
// If template.
if ( ! empty( $template ) ) {
?>
<div id="topbar-template">
<?php
// If Elementor.
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
OceanWP_Elementor::get_topbar_content();
// If Beaver Builder.
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $template ) ) {
echo do_shortcode( '[fl_builder_insert_layout id="' . $template . '"]' );
// Else.
} else {
// Display template content.
echo do_shortcode( $get_content );
}
?>
</div>
<?php
} else {
?>
<?php
// Check if there is content for the topbar.
if ( $content
|| is_customize_preview() ) :
?>
<span class="topbar-content">
<?php
// Display top bar content.
echo do_shortcode( $content );
?>
</span>
<?php
endif;
}
?>
</div><!-- #top-bar-content -->
<?php endif; ?>
@@ -0,0 +1,59 @@
<?php
/**
* Topbar layout
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Classes.
$classes = array( 'clr' );
// Add container class if the top bar is not full width.
if ( true !== get_theme_mod( 'ocean_top_bar_full_width', false ) ) {
$classes[] = 'container';
}
// If no content.
if ( ! get_theme_mod( 'ocean_top_bar_content' ) ) {
$classes[] = 'has-no-content';
}
// Turn classes into space seperated string.
$classes = implode( ' ', $classes );
?>
<?php do_action( 'ocean_before_top_bar' ); ?>
<div id="top-bar-wrap" class="<?php echo esc_attr( oceanwp_topbar_classes() ); ?>">
<div id="top-bar" class="<?php echo esc_attr( $classes ); ?>">
<?php do_action( 'ocean_before_top_bar_inner' ); ?>
<div id="top-bar-inner" class="clr">
<?php
// Get content.
get_template_part( 'partials/topbar/content' );
// Get social.
if ( true === get_theme_mod( 'ocean_top_bar_social', true ) ) {
get_template_part( 'partials/topbar/social' );
}
?>
</div><!-- #top-bar-inner -->
<?php do_action( 'ocean_after_top_bar_inner' ); ?>
</div><!-- #top-bar -->
</div><!-- #top-bar-wrap -->
<?php do_action( 'ocean_after_top_bar' ); ?>
@@ -0,0 +1,37 @@
<?php
/**
* Topbar menu displays inside the topbar "content" area
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="top-bar-nav" class="navigation clr">
<?php
// Menu Location.
$menu_location = apply_filters( 'ocean_topbar_menu_location', 'topbar_menu' );
if ( has_nav_menu( $menu_location ) || $ms_global_menu ) :
// Display menu.
wp_nav_menu(
array(
'theme_location' => $menu_location,
'fallback_cb' => false,
'container' => false,
'menu_class' => 'top-bar-menu dropdown-menu sf-menu',
'walker' => new OceanWP_Custom_Nav_Walker(),
)
);
endif;
?>
</div>
@@ -0,0 +1,135 @@
<?php
/**
* Topbar social profiles
*
* @package OceanWP WordPress theme
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get social options array.
$social_options = oceanwp_social_options();
// Return if array is empty.
if ( empty( $social_options ) ) {
return;
}
// Add classes based on topbar style.
$classes = '';
$topbar_style = get_theme_mod( 'ocean_top_bar_style', 'one' );
if ( 'one' === $topbar_style ) {
$classes = 'top-bar-right';
} elseif ( 'two' === $topbar_style ) {
$classes = 'top-bar-left';
} elseif ( 'three' === $topbar_style ) {
$classes = 'top-bar-centered';
}
// Get ID.
$get_id = get_theme_mod( 'ocean_top_bar_social_alt_template' );
// Check if page is Elementor page.
$elementor = get_post_meta( $get_id, '_elementor_edit_mode', true );
// Get content.
$get_content = oceanwp_top_bar_social_alt_content();
// Display Social alternative.
if ( $get_id ) : ?>
<div id="top-bar-social-alt" class="clr <?php echo esc_attr( $classes ); ?>">
<?php
// If Elementor.
if ( OCEANWP_ELEMENTOR_ACTIVE && $elementor ) {
OceanWP_Elementor::get_topbar_social_alt_content();
// If Beaver Builder.
} elseif ( OCEANWP_BEAVER_BUILDER_ACTIVE && ! empty( $get_id ) ) {
echo do_shortcode( '[fl_builder_insert_layout id="' . $get_id . '"]' );
// Else.
} else {
// Display template content.
echo do_shortcode( $get_content );
}
?>
</div><!-- #top-bar-social-alt -->
<?php
return;
endif;
?>
<?php
// Return if there aren't any profiles defined and define var.
if ( ! $profiles = get_theme_mod( 'ocean_top_bar_social_profiles' ) ) {
return;
}
// Get theme mods.
$link_target = get_theme_mod( 'ocean_top_bar_social_target', 'blank' );
$link_target = $link_target ? $link_target : 'blank';
$link_rel = '';
if ( 'blank' === $link_target ) {
$link_rel = 'rel="noopener noreferrer"';
}
?>
<div id="top-bar-social" class="clr <?php echo esc_attr( $classes ); ?>">
<ul class="clr" aria-label="<?php echo esc_attr__( 'Social links', 'oceanwp' ); ?>">
<?php
// Loop through social options.
foreach ( $social_options as $key => $val ) {
// Get URL from the theme mods.
$url = isset( $profiles[ $key ] ) ? $profiles[ $key ] : '';
$esc_url = esc_url( $url );
// Get correct label.
$label = ! empty( $val['label'] ) ? esc_attr( $val['label'] ) : '';
if ( 'blank' === $link_target ) {
$aria_label = 'aria-label="' . $label . ' ' . esc_attr__( '(opens in a new tab)', 'oceanwp' ) . '"';
} else {
$aria_label = 'aria-label="' . $label . '"';
}
// Display if there is a value defined.
if ( $url ) {
// Display link.
echo '<li class="oceanwp-' . esc_attr( $key ) . '">';
if ( in_array( $key, array( 'skype' ), true ) ) {
echo '<a href="skype:' . esc_attr( $url ) . '?call" aria-label="' . esc_attr__( 'Skype (opens in your application)', 'oceanwp' ) . '" target="_self">';
} elseif ( in_array( $key, array( 'email' ), true ) ) {
echo '<a href="mailto:' . antispambot( esc_attr( $url ) ) . '" aria-label="' . esc_attr__( 'Send email (opens in your application)', 'oceanwp' ) . '" target="_self">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
echo '<a href="' . $esc_url . '" ' . $aria_label . ' target="_' . esc_attr( $link_target ) . '" ' . $link_rel . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '<span class="' . esc_attr( $val['icon_class'] ) . '" aria-hidden="true"></span>';
echo '</a>';
echo '</li>';
} // End url check.
} // End loop
?>
</ul>
</div><!-- #top-bar-social -->