first commit

This commit is contained in:
2023-11-23 22:14:40 +01:00
commit 6c5e83d1b2
2779 changed files with 640726 additions and 0 deletions

View File

@@ -0,0 +1,141 @@
<?php
foreach ( glob( ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/admin/meta-boxes/*/*.php' ) as $meta_box_load ) {
include_once $meta_box_load;
}
if ( ! function_exists( 'calla_elated_map_blog_meta' ) ) {
function calla_elated_map_blog_meta() {
$eltd_blog_categories = array();
$categories = get_categories();
foreach ( $categories as $category ) {
$eltd_blog_categories[ $category->slug ] = $category->name;
}
$blog_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'page' ),
'title' => esc_html__( 'Blog', 'calla' ),
'name' => 'blog_meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_category_meta',
'type' => 'selectblank',
'label' => esc_html__( 'Blog Category', 'calla' ),
'description' => esc_html__( 'Choose category of posts to display (leave empty to display all categories)', 'calla' ),
'parent' => $blog_meta_box,
'options' => $eltd_blog_categories
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_show_posts_per_page_meta',
'type' => 'text',
'label' => esc_html__( 'Number of Posts', 'calla' ),
'description' => esc_html__( 'Enter the number of posts to display', 'calla' ),
'parent' => $blog_meta_box,
'options' => $eltd_blog_categories,
'args' => array(
'col_width' => 3
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_masonry_layout_meta',
'type' => 'select',
'label' => esc_html__( 'Masonry - Layout', 'calla' ),
'description' => esc_html__( 'Set masonry layout. Default is in grid.', 'calla' ),
'parent' => $blog_meta_box,
'options' => array(
'' => esc_html__( 'Default', 'calla' ),
'in-grid' => esc_html__( 'In Grid', 'calla' ),
'full-width' => esc_html__( 'Full Width', 'calla' )
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_masonry_number_of_columns_meta',
'type' => 'select',
'label' => esc_html__( 'Masonry - Number of Columns', 'calla' ),
'description' => esc_html__( 'Set number of columns for your masonry blog lists', 'calla' ),
'parent' => $blog_meta_box,
'options' => array(
'' => esc_html__( 'Default', 'calla' ),
'two' => esc_html__( '2 Columns', 'calla' ),
'three' => esc_html__( '3 Columns', 'calla' ),
'four' => esc_html__( '4 Columns', 'calla' ),
'five' => esc_html__( '5 Columns', 'calla' )
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_masonry_space_between_items_meta',
'type' => 'select',
'label' => esc_html__( 'Masonry - Space Between Items', 'calla' ),
'description' => esc_html__( 'Set space size between posts for your masonry blog lists', 'calla' ),
'options' => calla_elated_get_space_between_items_array( true ),
'parent' => $blog_meta_box
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_list_featured_image_proportion_meta',
'type' => 'select',
'label' => esc_html__( 'Masonry - Featured Image Proportion', 'calla' ),
'description' => esc_html__( 'Choose type of proportions you want to use for featured images on masonry blog lists', 'calla' ),
'parent' => $blog_meta_box,
'default_value' => '',
'options' => array(
'' => esc_html__( 'Default', 'calla' ),
'fixed' => esc_html__( 'Fixed', 'calla' ),
'original' => esc_html__( 'Original', 'calla' )
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_pagination_type_meta',
'type' => 'select',
'label' => esc_html__( 'Pagination Type', 'calla' ),
'description' => esc_html__( 'Choose a pagination layout for Blog Lists', 'calla' ),
'parent' => $blog_meta_box,
'default_value' => '',
'options' => array(
'' => esc_html__( 'Default', 'calla' ),
'standard' => esc_html__( 'Standard', 'calla' ),
'load-more' => esc_html__( 'Load More', 'calla' ),
'infinite-scroll' => esc_html__( 'Infinite Scroll', 'calla' ),
'no-pagination' => esc_html__( 'No Pagination', 'calla' )
)
)
);
calla_elated_create_meta_box_field(
array(
'type' => 'text',
'name' => 'eltdf_number_of_chars_meta',
'default_value' => '',
'label' => esc_html__( 'Number of Words in Excerpt', 'calla' ),
'description' => esc_html__( 'Enter a number of words in excerpt (article summary). Default value is 40', 'calla' ),
'parent' => $blog_meta_box,
'args' => array(
'col_width' => 3
)
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_blog_meta', 30 );
}

View File

@@ -0,0 +1,67 @@
<?php
if ( ! function_exists( 'calla_elated_map_post_audio_meta' ) ) {
function calla_elated_map_post_audio_meta() {
$audio_post_format_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'post' ),
'title' => esc_html__( 'Audio Post Format', 'calla' ),
'name' => 'post_format_audio_meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_audio_type_meta',
'type' => 'select',
'label' => esc_html__( 'Audio Type', 'calla' ),
'description' => esc_html__( 'Choose audio type', 'calla' ),
'parent' => $audio_post_format_meta_box,
'default_value' => 'social_networks',
'options' => array(
'social_networks' => esc_html__( 'Audio Service', 'calla' ),
'self' => esc_html__( 'Self Hosted', 'calla' )
)
)
);
$eltdf_audio_embedded_container = calla_elated_add_admin_container(
array(
'parent' => $audio_post_format_meta_box,
'name' => 'eltdf_audio_embedded_container'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_audio_link_meta',
'type' => 'text',
'label' => esc_html__( 'Audio URL', 'calla' ),
'description' => esc_html__( 'Enter audio URL', 'calla' ),
'parent' => $eltdf_audio_embedded_container,
'dependency' => array(
'show' => array(
'eltdf_audio_type_meta' => 'social_networks'
)
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_audio_custom_meta',
'type' => 'text',
'label' => esc_html__( 'Audio Link', 'calla' ),
'description' => esc_html__( 'Enter audio link', 'calla' ),
'parent' => $eltdf_audio_embedded_container,
'dependency' => array(
'show' => array(
'eltdf_audio_type_meta' => 'self'
)
)
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_post_audio_meta', 23 );
}

View File

@@ -0,0 +1,25 @@
<?php
if ( ! function_exists( 'calla_elated_map_post_gallery_meta' ) ) {
function calla_elated_map_post_gallery_meta() {
$gallery_post_format_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'post' ),
'title' => esc_html__( 'Gallery Post Format', 'calla' ),
'name' => 'post_format_gallery_meta'
)
);
calla_elated_add_multiple_images_field(
array(
'name' => 'eltdf_post_gallery_images_meta',
'label' => esc_html__( 'Gallery Images', 'calla' ),
'description' => esc_html__( 'Choose your gallery images', 'calla' ),
'parent' => $gallery_post_format_meta_box,
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_post_gallery_meta', 21 );
}

View File

@@ -0,0 +1,25 @@
<?php
if ( ! function_exists( 'calla_elated_map_post_link_meta' ) ) {
function calla_elated_map_post_link_meta() {
$link_post_format_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'post' ),
'title' => esc_html__( 'Link Post Format', 'calla' ),
'name' => 'post_format_link_meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_link_link_meta',
'type' => 'text',
'label' => esc_html__( 'Link', 'calla' ),
'description' => esc_html__( 'Enter link', 'calla' ),
'parent' => $link_post_format_meta_box
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_post_link_meta', 24 );
}

View File

@@ -0,0 +1,35 @@
<?php
if ( ! function_exists( 'calla_elated_map_post_quote_meta' ) ) {
function calla_elated_map_post_quote_meta() {
$quote_post_format_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'post' ),
'title' => esc_html__( 'Quote Post Format', 'calla' ),
'name' => 'post_format_quote_meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_quote_text_meta',
'type' => 'text',
'label' => esc_html__( 'Quote Text', 'calla' ),
'description' => esc_html__( 'Enter Quote text', 'calla' ),
'parent' => $quote_post_format_meta_box
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_quote_author_meta',
'type' => 'text',
'label' => esc_html__( 'Quote Author', 'calla' ),
'description' => esc_html__( 'Enter Quote author', 'calla' ),
'parent' => $quote_post_format_meta_box
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_post_quote_meta', 25 );
}

View File

@@ -0,0 +1,82 @@
<?php
if ( ! function_exists( 'calla_elated_map_post_video_meta' ) ) {
function calla_elated_map_post_video_meta() {
$video_post_format_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'post' ),
'title' => esc_html__( 'Video Post Format', 'calla' ),
'name' => 'post_format_video_meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_video_type_meta',
'type' => 'select',
'label' => esc_html__( 'Video Type', 'calla' ),
'description' => esc_html__( 'Choose video type', 'calla' ),
'parent' => $video_post_format_meta_box,
'default_value' => 'social_networks',
'options' => array(
'social_networks' => esc_html__( 'Video Service', 'calla' ),
'self' => esc_html__( 'Self Hosted', 'calla' )
)
)
);
$eltdf_video_embedded_container = calla_elated_add_admin_container(
array(
'parent' => $video_post_format_meta_box,
'name' => 'eltdf_video_embedded_container'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_video_link_meta',
'type' => 'text',
'label' => esc_html__( 'Video URL', 'calla' ),
'description' => esc_html__( 'Enter Video URL', 'calla' ),
'parent' => $eltdf_video_embedded_container,
'dependency' => array(
'show' => array(
'eltdf_video_type_meta' => 'social_networks'
)
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_video_custom_meta',
'type' => 'text',
'label' => esc_html__( 'Video MP4', 'calla' ),
'description' => esc_html__( 'Enter video URL for MP4 format', 'calla' ),
'parent' => $eltdf_video_embedded_container,
'dependency' => array(
'show' => array(
'eltdf_video_type_meta' => 'self'
)
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_post_video_image_meta',
'type' => 'image',
'label' => esc_html__( 'Video Image', 'calla' ),
'description' => esc_html__( 'Enter video image', 'calla' ),
'parent' => $eltdf_video_embedded_container,
'dependency' => array(
'show' => array(
'eltdf_video_type_meta' => 'self'
)
)
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_post_video_meta', 22 );
}

View File

@@ -0,0 +1,101 @@
<?php
/*** Post Settings ***/
if ( ! function_exists( 'calla_elated_map_post_meta' ) ) {
function calla_elated_map_post_meta() {
$post_meta_box = calla_elated_create_meta_box(
array(
'scope' => array( 'post' ),
'title' => esc_html__( 'Post', 'calla' ),
'name' => 'post-meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_single_sidebar_layout_meta',
'type' => 'select',
'label' => esc_html__( 'Sidebar Layout', 'calla' ),
'description' => esc_html__( 'Choose a sidebar layout for Blog single page', 'calla' ),
'default_value' => '',
'parent' => $post_meta_box,
'options' => calla_elated_get_custom_sidebars_options( true )
)
);
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
if ( count( $calla_custom_sidebars ) > 0 ) {
calla_elated_create_meta_box_field( array(
'name' => 'eltdf_blog_single_custom_sidebar_area_meta',
'type' => 'selectblank',
'label' => esc_html__( 'Sidebar to Display', 'calla' ),
'description' => esc_html__( 'Choose a sidebar to display on Blog single page. Default sidebar is "Sidebar"', 'calla' ),
'parent' => $post_meta_box,
'options' => calla_elated_get_custom_sidebars(),
'args' => array(
'select2' => true
)
) );
}
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_list_featured_image_meta',
'type' => 'image',
'label' => esc_html__( 'Blog List Image', 'calla' ),
'description' => esc_html__( 'Choose an Image for displaying in blog list. If not uploaded, featured image will be shown.', 'calla' ),
'parent' => $post_meta_box
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_masonry_gallery_fixed_dimensions_meta',
'type' => 'select',
'label' => esc_html__( 'Dimensions for Fixed Proportion', 'calla' ),
'description' => esc_html__( 'Choose image layout when it appears in Masonry lists in fixed proportion', 'calla' ),
'default_value' => 'default',
'parent' => $post_meta_box,
'options' => array(
'default' => esc_html__( 'Default', 'calla' ),
'large-width' => esc_html__( 'Large Width', 'calla' ),
'large-height' => esc_html__( 'Large Height', 'calla' ),
'large-width-height' => esc_html__( 'Large Width/Height', 'calla' )
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_blog_masonry_gallery_original_dimensions_meta',
'type' => 'select',
'label' => esc_html__( 'Dimensions for Original Proportion', 'calla' ),
'description' => esc_html__( 'Choose image layout when it appears in Masonry lists in original proportion', 'calla' ),
'default_value' => 'default',
'parent' => $post_meta_box,
'options' => array(
'default' => esc_html__( 'Default', 'calla' ),
'large-width' => esc_html__( 'Large Width', 'calla' )
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_show_title_area_blog_meta',
'type' => 'select',
'default_value' => '',
'label' => esc_html__( 'Show Title Area', 'calla' ),
'description' => esc_html__( 'Enabling this option will show title area on your single post page', 'calla' ),
'parent' => $post_meta_box,
'options' => calla_elated_get_yes_no_select_array()
)
);
do_action('calla_elated_blog_post_meta', $post_meta_box);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_post_meta', 20 );
}

View File

@@ -0,0 +1,355 @@
<?php
if ( ! function_exists( 'calla_elated_get_blog_list_types_options' ) ) {
function calla_elated_get_blog_list_types_options() {
$blog_list_type_options = apply_filters( 'calla_elated_blog_list_type_global_option', $blog_list_type_options = array() );
return $blog_list_type_options;
}
}
if ( ! function_exists( 'calla_elated_blog_options_map' ) ) {
function calla_elated_blog_options_map() {
$blog_list_type_options = calla_elated_get_blog_list_types_options();
calla_elated_add_admin_page(
array(
'slug' => '_blog_page',
'title' => esc_html__( 'Blog', 'calla' ),
'icon' => 'fa fa-files-o'
)
);
/**
* Blog Lists
*/
$panel_blog_lists = calla_elated_add_admin_panel(
array(
'page' => '_blog_page',
'name' => 'panel_blog_lists',
'title' => esc_html__( 'Blog Lists', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_list_type',
'type' => 'select',
'label' => esc_html__( 'Blog Layout for Archive Pages', 'calla' ),
'description' => esc_html__( 'Choose a default blog layout for archived blog post lists', 'calla' ),
'default_value' => 'standard',
'parent' => $panel_blog_lists,
'options' => $blog_list_type_options
)
);
calla_elated_add_admin_field(
array(
'name' => 'archive_sidebar_layout',
'type' => 'select',
'label' => esc_html__( 'Sidebar Layout for Archive Pages', 'calla' ),
'description' => esc_html__( 'Choose a sidebar layout for archived blog post lists', 'calla' ),
'default_value' => '',
'parent' => $panel_blog_lists,
'options' => calla_elated_get_custom_sidebars_options(),
)
);
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
if ( count( $calla_custom_sidebars ) > 0 ) {
calla_elated_add_admin_field(
array(
'name' => 'archive_custom_sidebar_area',
'type' => 'selectblank',
'label' => esc_html__( 'Sidebar to Display for Archive Pages', 'calla' ),
'description' => esc_html__( 'Choose a sidebar to display on archived blog post lists. Default sidebar is "Sidebar Page"', 'calla' ),
'parent' => $panel_blog_lists,
'options' => calla_elated_get_custom_sidebars(),
'args' => array(
'select2' => true
)
)
);
}
calla_elated_add_admin_field(
array(
'name' => 'blog_masonry_layout',
'type' => 'select',
'label' => esc_html__( 'Masonry - Layout', 'calla' ),
'default_value' => 'in-grid',
'description' => esc_html__( 'Set masonry layout. Default is in grid.', 'calla' ),
'parent' => $panel_blog_lists,
'options' => array(
'in-grid' => esc_html__( 'In Grid', 'calla' ),
'full-width' => esc_html__( 'Full Width', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_masonry_number_of_columns',
'type' => 'select',
'label' => esc_html__( 'Masonry - Number of Columns', 'calla' ),
'default_value' => 'three',
'description' => esc_html__( 'Set number of columns for your masonry blog lists. Default value is 4 columns', 'calla' ),
'parent' => $panel_blog_lists,
'options' => array(
'two' => esc_html__( '2 Columns', 'calla' ),
'three' => esc_html__( '3 Columns', 'calla' ),
'four' => esc_html__( '4 Columns', 'calla' ),
'five' => esc_html__( '5 Columns', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_masonry_space_between_items',
'type' => 'select',
'label' => esc_html__( 'Masonry - Space Between Items', 'calla' ),
'description' => esc_html__( 'Set space size between posts for your masonry blog lists. Default value is normal', 'calla' ),
'default_value' => 'normal',
'options' => calla_elated_get_space_between_items_array(),
'parent' => $panel_blog_lists
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_list_featured_image_proportion',
'type' => 'select',
'label' => esc_html__( 'Masonry - Featured Image Proportion', 'calla' ),
'default_value' => 'fixed',
'description' => esc_html__( 'Choose type of proportions you want to use for featured images on masonry blog lists', 'calla' ),
'parent' => $panel_blog_lists,
'options' => array(
'fixed' => esc_html__( 'Fixed', 'calla' ),
'original' => esc_html__( 'Original', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_pagination_type',
'type' => 'select',
'label' => esc_html__( 'Pagination Type', 'calla' ),
'description' => esc_html__( 'Choose a pagination layout for Blog Lists', 'calla' ),
'parent' => $panel_blog_lists,
'default_value' => 'standard',
'options' => array(
'standard' => esc_html__( 'Standard', 'calla' ),
'load-more' => esc_html__( 'Load More', 'calla' ),
'infinite-scroll' => esc_html__( 'Infinite Scroll', 'calla' ),
'no-pagination' => esc_html__( 'No Pagination', 'calla' )
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'text',
'name' => 'number_of_chars',
'default_value' => '40',
'label' => esc_html__( 'Number of Words in Excerpt', 'calla' ),
'description' => esc_html__( 'Enter a number of words in excerpt (article summary). Default value is 40', 'calla' ),
'parent' => $panel_blog_lists,
'args' => array(
'col_width' => 3
)
)
);
/**
* Blog Single
*/
$panel_blog_single = calla_elated_add_admin_panel(
array(
'page' => '_blog_page',
'name' => 'panel_blog_single',
'title' => esc_html__( 'Blog Single', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_single_sidebar_layout',
'type' => 'select',
'label' => esc_html__( 'Sidebar Layout', 'calla' ),
'description' => esc_html__( 'Choose a sidebar layout for Blog Single pages', 'calla' ),
'default_value' => '',
'parent' => $panel_blog_single,
'options' => calla_elated_get_custom_sidebars_options()
)
);
if ( count( $calla_custom_sidebars ) > 0 ) {
calla_elated_add_admin_field(
array(
'name' => 'blog_single_custom_sidebar_area',
'type' => 'selectblank',
'label' => esc_html__( 'Sidebar to Display', 'calla' ),
'description' => esc_html__( 'Choose a sidebar to display on Blog Single pages. Default sidebar is "Sidebar"', 'calla' ),
'parent' => $panel_blog_single,
'options' => calla_elated_get_custom_sidebars(),
'args' => array(
'select2' => true
)
)
);
}
calla_elated_add_admin_field(
array(
'type' => 'select',
'name' => 'show_title_area_blog',
'default_value' => '',
'label' => esc_html__( 'Show Title Area', 'calla' ),
'description' => esc_html__( 'Enabling this option will show title area on single post pages', 'calla' ),
'parent' => $panel_blog_single,
'options' => calla_elated_get_yes_no_select_array(),
'args' => array(
'col_width' => 3
)
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_single_title_in_title_area',
'type' => 'yesno',
'label' => esc_html__( 'Show Post Title in Title Area', 'calla' ),
'description' => esc_html__( 'Enabling this option will show post title in title area on single post pages', 'calla' ),
'parent' => $panel_blog_single,
'default_value' => 'no'
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_single_related_posts',
'type' => 'yesno',
'label' => esc_html__( 'Show Related Posts', 'calla' ),
'description' => esc_html__( 'Enabling this option will show related posts on single post pages', 'calla' ),
'parent' => $panel_blog_single,
'default_value' => 'yes'
)
);
calla_elated_add_admin_field(
array(
'name' => 'blog_single_comments',
'type' => 'yesno',
'label' => esc_html__( 'Show Comments Form', 'calla' ),
'description' => esc_html__( 'Enabling this option will show comments form on single post pages', 'calla' ),
'parent' => $panel_blog_single,
'default_value' => 'yes'
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'blog_single_navigation',
'default_value' => 'no',
'label' => esc_html__( 'Enable Prev/Next Single Post Navigation Links', 'calla' ),
'description' => esc_html__( 'Enable navigation links through the blog posts (left and right arrows will appear)', 'calla' ),
'parent' => $panel_blog_single
)
);
$blog_single_navigation_container = calla_elated_add_admin_container(
array(
'name' => 'eltdf_blog_single_navigation_container',
'parent' => $panel_blog_single,
'dependency' => array(
'show' => array(
'blog_single_navigation' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'blog_navigation_through_same_category',
'default_value' => 'no',
'label' => esc_html__( 'Enable Navigation Only in Current Category', 'calla' ),
'description' => esc_html__( 'Limit your navigation only through current category', 'calla' ),
'parent' => $blog_single_navigation_container,
'args' => array(
'col_width' => 3
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'blog_author_info',
'default_value' => 'yes',
'label' => esc_html__( 'Show Author Info Box', 'calla' ),
'description' => esc_html__( 'Enabling this option will display author name and descriptions on single post pages', 'calla' ),
'parent' => $panel_blog_single
)
);
calla_elated_add_admin_field(
array(
'type' => 'text',
'name' => 'blog_single_grid_padding',
'default_value' => '',
'label' => esc_html__( 'Blog single padding for container', 'calla' ),
'description' => esc_html__( 'Insert padding in format: top right bottom left (e.g. 10px 5px 10px 5px or 10% 5% 10% 5%', 'calla' ),
'parent' => $panel_blog_single
)
);
$blog_single_author_info_container = calla_elated_add_admin_container(
array(
'name' => 'eltdf_blog_single_author_info_container',
'parent' => $panel_blog_single,
'dependency' => array(
'show' => array(
'blog_author_info' => 'yes'
)
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'blog_author_info_email',
'default_value' => 'no',
'label' => esc_html__( 'Show Author Email', 'calla' ),
'description' => esc_html__( 'Enabling this option will show author email', 'calla' ),
'parent' => $blog_single_author_info_container,
'args' => array(
'col_width' => 3
)
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'blog_single_author_social',
'default_value' => 'yes',
'label' => esc_html__( 'Show Author Social Icons', 'calla' ),
'description' => esc_html__( 'Enabling this option will show author social icons on single post pages', 'calla' ),
'parent' => $blog_single_author_info_container,
'args' => array(
'col_width' => 3
)
)
);
do_action( 'calla_elated_blog_single_options_map', $panel_blog_single );
}
add_action( 'calla_elated_options_map', 'calla_elated_blog_options_map', 11 );
}

View File

@@ -0,0 +1,257 @@
/* ==========================================================================
Blog responsive styles - begin
========================================================================== */
/* common mixins - start */
/* common mixins - end */
/* mixins styles - start */
/* mixins styles - end */
/* ==========================================================================
Blog Masonry general style - begin
========================================================================== */
@media only screen and (max-width: 1440px) {
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns .eltdf-blog-masonry-grid-sizer {
width: 25%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width-height {
width: 50%;
}
}
@media only screen and (max-width: 1280px) {
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns .eltdf-blog-masonry-grid-sizer {
width: 33.33333%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article.eltdf-post-size-large-width-height {
width: 66.66667%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns .eltdf-blog-masonry-grid-sizer {
width: 33.33333%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width-height {
width: 66.66667%;
}
}
@media only screen and (max-width: 1024px) {
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns .eltdf-blog-masonry-grid-sizer {
width: 50%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns .eltdf-blog-masonry-grid-sizer {
width: 50%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns .eltdf-blog-masonry-grid-sizer {
width: 50%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
}
@media only screen and (max-width: 680px) {
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-two-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-two-columns .eltdf-blog-masonry-grid-sizer {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-two-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-two-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns .eltdf-blog-masonry-grid-sizer {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-three-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns .eltdf-blog-masonry-grid-sizer {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-four-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article,
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns .eltdf-blog-masonry-grid-sizer {
width: 100%;
}
.eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width, .eltdf-blog-holder.eltdf-blog-type-masonry.eltdf-blog-five-columns article.eltdf-post-size-large-width-height {
width: 100%;
}
}
/* ==========================================================================
Blog Masonry general style - end
========================================================================== */
@media only screen and (max-width: 768px) {
.eltdf-related-posts-holder .eltdf-related-post {
width: 50% !important;
}
}
@media only screen and (max-width: 480px) {
.eltdf-related-posts-holder .eltdf-related-post {
width: 100% !important;
}
}
@media only screen and (max-width: 768px) {
.eltdf-blog-holder.eltdf-blog-single article .eltdf-post-info-bottom .eltdf-post-info-bottom-left,
.eltdf-blog-holder.eltdf-blog-single article .eltdf-post-info-bottom .eltdf-post-info-bottom-right {
width: 100%;
float: none;
}
.eltdf-blog-holder.eltdf-blog-single article .eltdf-post-info-bottom .eltdf-post-info-bottom-right {
text-align: inherit;
margin: 10px 0 0;
}
}
/* ==========================================================================
Blog List shortcode responsive style - begin
========================================================================== */
@media only screen and (max-width: 1440px) {
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-grid-sizer {
width: 25%;
}
}
@media only screen and (max-width: 1280px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-four-columns .eltdf-bl-item, .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-four-columns .eltdf-bl-item {
width: 33.33333%;
}
}
@media only screen and (max-width: 1280px) and (min-width: 1025px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-four-columns .eltdf-bl-item:nth-child(3n+1), .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-four-columns .eltdf-bl-item:nth-child(3n+1) {
clear: both;
}
}
@media only screen and (max-width: 1280px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-five-columns .eltdf-bl-item, .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-five-columns .eltdf-bl-item {
width: 33.33333%;
}
}
@media only screen and (max-width: 1280px) and (min-width: 1025px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-five-columns .eltdf-bl-item:nth-child(3n+1), .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-five-columns .eltdf-bl-item:nth-child(3n+1) {
clear: both;
}
}
@media only screen and (max-width: 1280px) {
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-four-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-four-columns .eltdf-bl-grid-sizer {
width: 33.33333%;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-grid-sizer {
width: 33.33333%;
}
}
@media only screen and (max-width: 1024px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-three-columns .eltdf-bl-item, .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-three-columns .eltdf-bl-item {
width: 50%;
}
}
@media only screen and (max-width: 1024px) and (min-width: 681px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-three-columns .eltdf-bl-item:nth-child(2n+1), .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-three-columns .eltdf-bl-item:nth-child(2n+1) {
clear: both;
}
}
@media only screen and (max-width: 1024px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-four-columns .eltdf-bl-item, .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-four-columns .eltdf-bl-item {
width: 50%;
}
}
@media only screen and (max-width: 1024px) and (min-width: 681px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-four-columns .eltdf-bl-item:nth-child(2n+1), .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-four-columns .eltdf-bl-item:nth-child(2n+1) {
clear: both;
}
}
@media only screen and (max-width: 1024px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-five-columns .eltdf-bl-item, .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-five-columns .eltdf-bl-item {
width: 50%;
}
}
@media only screen and (max-width: 1024px) and (min-width: 681px) {
.eltdf-blog-list-holder.eltdf-bl-standard.eltdf-bl-five-columns .eltdf-bl-item:nth-child(2n+1), .eltdf-blog-list-holder.eltdf-bl-boxed.eltdf-bl-five-columns .eltdf-bl-item:nth-child(2n+1) {
clear: both;
}
}
@media only screen and (max-width: 1024px) {
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-three-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-three-columns .eltdf-bl-grid-sizer {
width: 50%;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-four-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-four-columns .eltdf-bl-grid-sizer {
width: 50%;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-grid-sizer {
width: 50%;
}
}
@media only screen and (max-width: 680px) {
.eltdf-blog-list-holder.eltdf-bl-standard .eltdf-bl-item, .eltdf-blog-list-holder.eltdf-bl-boxed .eltdf-bl-item {
width: 100% !important;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-two-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-two-columns .eltdf-bl-grid-sizer {
width: 100%;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-three-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-three-columns .eltdf-bl-grid-sizer {
width: 100%;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-four-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-four-columns .eltdf-bl-grid-sizer {
width: 100%;
}
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-item,
.eltdf-blog-list-holder.eltdf-bl-masonry.eltdf-bl-five-columns .eltdf-bl-grid-sizer {
width: 100%;
}
}
/* ==========================================================================
Blog List shortcode responsive style - end
========================================================================== */
/* ==========================================================================
Blog Slider shortcode responsive style - begin
========================================================================== */
@media only screen and (max-width: 1024px) {
.eltdf-blog-slider-holder.eltdf-bs-carousel-centered .active.center .eltdf-item-text-wrapper {
opacity: 1;
}
}
/* ==========================================================================
Blog Slider shortcode responsive style - end
========================================================================== */
/* ==========================================================================
Blog responsive styles - end
========================================================================== */
/*# sourceMappingURL=blog-map-responsive.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

View File

@@ -0,0 +1,263 @@
(function($) {
"use strict";
var blog = {};
eltdf.modules.blog = blog;
blog.eltdfOnDocumentReady = eltdfOnDocumentReady;
blog.eltdfOnWindowLoad = eltdfOnWindowLoad;
blog.eltdfOnWindowResize = eltdfOnWindowResize;
blog.eltdfOnWindowScroll = eltdfOnWindowScroll;
$(document).ready(eltdfOnDocumentReady);
$(window).on('load', eltdfOnWindowLoad);
$(window).resize(eltdfOnWindowResize);
$(window).scroll(eltdfOnWindowScroll);
/*
All functions to be called on $(document).ready() should be in this function
*/
function eltdfOnDocumentReady() {
eltdfInitAudioPlayer();
eltdfInitBlogMasonry();
}
/*
All functions to be called on $(window).load() should be in this function
*/
function eltdfOnWindowLoad() {
eltdfInitBlogPagination().init();
}
/*
All functions to be called on $(window).resize() should be in this function
*/
function eltdfOnWindowResize() {
eltdfInitBlogMasonry();
}
/*
All functions to be called on $(window).scroll() should be in this function
*/
function eltdfOnWindowScroll() {
eltdfInitBlogPagination().scroll();
}
/**
* Init audio player for Blog list and single pages
*/
function eltdfInitAudioPlayer() {
var players = $('audio.eltdf-blog-audio');
if (players.length) {
players.mediaelementplayer({
audioWidth: '100%'
});
}
}
/**
* Init Resize Blog Items
*/
function eltdfResizeBlogItems(size,container){
if(container.hasClass('eltdf-masonry-images-fixed')) {
var padding = parseInt(container.find('article').css('padding-left')),
defaultMasonryItem = container.find('.eltdf-post-size-default'),
largeWidthMasonryItem = container.find('.eltdf-post-size-large-width'),
largeHeightMasonryItem = container.find('.eltdf-post-size-large-height'),
largeWidthHeightMasonryItem = container.find('.eltdf-post-size-large-width-height');
if (eltdf.windowWidth > 680) {
defaultMasonryItem.css('height', size - 2 * padding);
largeHeightMasonryItem.css('height', Math.round(2 * size) - 2 * padding);
largeWidthHeightMasonryItem.css('height', Math.round(2 * size) - 2 * padding);
largeWidthMasonryItem.css('height', size - 2 * padding);
} else {
defaultMasonryItem.css('height', size);
largeHeightMasonryItem.css('height', size);
largeWidthHeightMasonryItem.css('height', size);
largeWidthMasonryItem.css('height', Math.round(size / 2));
}
}
}
/**
* Init Blog Masonry Layout
*/
function eltdfInitBlogMasonry() {
var holder = $('.eltdf-blog-holder.eltdf-blog-type-masonry');
if(holder.length){
holder.each(function(){
var thisHolder = $(this),
masonry = thisHolder.children('.eltdf-blog-holder-inner'),
size = thisHolder.find('.eltdf-blog-masonry-grid-sizer').width();
masonry.waitForImages(function() {
masonry.isotope({
layoutMode: 'packery',
itemSelector: 'article',
percentPosition: true,
packery: {
gutter: '.eltdf-blog-masonry-grid-gutter',
columnWidth: '.eltdf-blog-masonry-grid-sizer'
}
});
eltdfResizeBlogItems(size, thisHolder);
masonry.css('opacity', '1');
setTimeout(function() {
masonry.isotope('layout');
}, 800);
});
});
}
}
/**
* Initializes blog pagination functions
*/
function eltdfInitBlogPagination(){
var holder = $('.eltdf-blog-holder');
var initLoadMorePagination = function(thisHolder) {
var loadMoreButton = thisHolder.find('.eltdf-blog-pag-load-more a');
loadMoreButton.on('click', function(e) {
e.preventDefault();
e.stopPropagation();
initMainPagFunctionality(thisHolder);
});
};
var initInifiteScrollPagination = function(thisHolder) {
var blogListHeight = thisHolder.outerHeight(),
blogListTopOffest = thisHolder.offset().top,
blogListPosition = blogListHeight + blogListTopOffest - eltdfGlobalVars.vars.eltdfAddForAdminBar;
if(!thisHolder.hasClass('eltdf-blog-pagination-infinite-scroll-started') && eltdf.scroll + eltdf.windowHeight > blogListPosition) {
initMainPagFunctionality(thisHolder);
}
};
var initMainPagFunctionality = function(thisHolder) {
var thisHolderInner = thisHolder.children('.eltdf-blog-holder-inner'),
nextPage,
maxNumPages;
if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) {
maxNumPages = thisHolder.data('max-num-pages');
}
if(thisHolder.hasClass('eltdf-blog-pagination-infinite-scroll')) {
thisHolder.addClass('eltdf-blog-pagination-infinite-scroll-started');
}
var loadMoreDatta = eltdf.modules.common.getLoadMoreData(thisHolder),
loadingItem = thisHolder.find('.eltdf-blog-pag-loading');
nextPage = loadMoreDatta.nextPage;
if(nextPage <= maxNumPages){
loadingItem.addClass('eltdf-showing');
var ajaxData = eltdf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'calla_elated_blog_load_more');
$.ajax({
type: 'POST',
data: ajaxData,
url: eltdfGlobalVars.vars.eltdfAjaxUrl,
success: function (data) {
nextPage++;
thisHolder.data('next-page', nextPage);
var response = $.parseJSON(data),
responseHtml = response.html;
thisHolder.waitForImages(function(){
if(thisHolder.hasClass('eltdf-blog-type-masonry')){
eltdfInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml);
eltdfResizeBlogItems(thisHolderInner.find('.eltdf-blog-masonry-grid-sizer').width(), thisHolder);
} else {
eltdfInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml);
}
setTimeout(function() {
eltdfInitAudioPlayer();
eltdf.modules.common.eltdfOwlSlider();
eltdf.modules.common.eltdfFluidVideo();
eltdf.modules.common.eltdfInitSelfHostedVideoPlayer();
eltdf.modules.common.eltdfSelfHostedVideoSize();
if (typeof eltdf.modules.common.eltdfStickySidebarWidget === 'function') {
eltdf.modules.common.eltdfStickySidebarWidget().reInit();
}
// Trigger event.
$( document.body ).trigger( 'blog_list_load_more_trigger' );
}, 400);
});
if(thisHolder.hasClass('eltdf-blog-pagination-infinite-scroll-started')) {
thisHolder.removeClass('eltdf-blog-pagination-infinite-scroll-started');
}
}
});
}
if(nextPage === maxNumPages){
thisHolder.find('.eltdf-blog-pag-load-more').hide();
}
};
var eltdfInitAppendIsotopeNewContent = function(thisHolderInner, loadingItem, responseHtml) {
thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('eltdf-showing');
setTimeout(function() {
thisHolderInner.isotope('layout');
}, 600);
};
var eltdfInitAppendGalleryNewContent = function(thisHolderInner, loadingItem, responseHtml) {
loadingItem.removeClass('eltdf-showing');
thisHolderInner.append(responseHtml);
};
return {
init: function() {
if(holder.length) {
holder.each(function() {
var thisHolder = $(this);
if(thisHolder.hasClass('eltdf-blog-pagination-load-more')) {
initLoadMorePagination(thisHolder);
}
if(thisHolder.hasClass('eltdf-blog-pagination-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
},
scroll: function() {
if(holder.length) {
holder.each(function() {
var thisHolder = $(this);
if(thisHolder.hasClass('eltdf-blog-pagination-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
}
};
}
})(jQuery);

View File

@@ -0,0 +1,955 @@
<?php
/**
* FUNCTIONS LIST
* @see calla_elated_include_blog_helper_functions
* @see calla_elated_get_archive_blog_list_layout
* @see calla_elated_get_holder_params_blog
* @see calla_elated_get_blog
* @see calla_elated_get_blog_type
* @see calla_elated_get_blog_query
* @see calla_elated_get_blog_list_holder_classes
* @see calla_elated_get_blog_holder_data_params
* @see calla_elated_set_ajax_url
* @see calla_elated_blog_load_more
* @see calla_elated_get_post_format_html
* @see calla_elated_single_link_pages
* @see calla_elated_get_blog_single
* @see calla_elated_get_blog_single_type
* @see calla_elated_get_single_post_format_html
* @see calla_elated_excerpt
* @see calla_elated_excerpt_length
* @see calla_elated_post_has_read_more
* @see calla_elated_modify_read_more_link
* @see calla_elated_get_blog_related_post_type
* @see calla_elated_get_blog_related_posts
* @see calla_elated_blog_shortcode_load_more
* @see calla_elated_get_user_custom_fields
* @see calla_elated_blog_item_has_link
* @see calla_elated_get_blog_module
* @see calla_elated_return_post_format
* @see calla_elated_return_has_media
* @see calla_elated_blog_single_title
**/
if ( ! function_exists( 'calla_elated_include_blog_helper_functions' ) ) {
/**
* Function which include blog helper function file
*
* @param $module - string that defines is single or list loaded
*
* @param $type - type for module
*/
function calla_elated_include_blog_helper_functions( $module, $type ) {
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/templates/' . $module . '/' . $type . '/helper.php';
}
}
if ( ! function_exists( 'calla_elated_include_blog_types_function_file' ) ) {
/**
* Function which include blog type function file
*/
function calla_elated_include_blog_types_function_file() {
foreach ( glob( ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/templates/lists/*/functions.php' ) as $blog_functions ) {
include_once $blog_functions;
}
}
add_action( 'calla_elated_options_map', 'calla_elated_include_blog_types_function_file', 1 ); // 1 is set to just be before option map init
}
if ( ! function_exists( 'calla_elated_register_blog_template' ) ) {
/**
* Function that register blog templates
*/
function calla_elated_register_blog_template( $templates ) {
$templates = apply_filters( 'calla_elated_register_blog_templates', $templates );
return $templates;
}
// Add a filter to the theme page templates to assigned our custom template into the list
add_filter( 'theme_page_templates', 'calla_elated_register_blog_template' );
}
if ( ! function_exists( 'calla_elated_register_blog_template_path' ) ) {
/**
* Function that return blog template file if blog template is selected
*
* $template - default value is page.php
*/
function calla_elated_register_blog_template_path( $template ) {
global $post;
if ( isset( $post ) && ! calla_elated_is_default_wp_template() ) {
$postID = $post->ID;
$chosenTemplate = get_post_meta( $postID, '_wp_page_template', true );
if ( ! isset( $chosenTemplate ) && ! preg_match( '/blog/', $chosenTemplate ) ) {
return $template;
}
$file = ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/templates/lists/' . str_replace( 'blog-', '', $chosenTemplate ) . '/templates/' . $chosenTemplate . '.php';
if ( file_exists( $file ) ) {
$blog_root_template = get_template_directory() . '/' . $chosenTemplate . '.php';
if ( ! file_exists( $blog_root_template ) ) {
return $file;
} else {
return $blog_root_template;
}
} else {
return $template;
}
}
return $template;
}
// Add a filter to the template include to determine if the page has our template assigned and return it's path
add_filter( 'template_include', 'calla_elated_register_blog_template_path' );
}
if ( ! function_exists( 'calla_elated_get_archive_blog_list_layout' ) ) {
/**
* Function which return archive blog list layout
*/
function calla_elated_get_archive_blog_list_layout() {
if(calla_elated_core_plugin_installed()) {
$blog_layout = calla_elated_options()->getOptionValue('blog_list_type');
} else {
$blog_layout = 'standard';
}
return $blog_layout;
}
}
if ( ! function_exists( 'calla_elated_get_holder_params_blog' ) ) {
/**
* Function which return holder class and holder inner class for blog pages
*/
function calla_elated_get_holder_params_blog() {
/**
* Available parameters for holder params
* -holder
* -inner
*/
return apply_filters( 'calla_elated_blog_holder_params', $params = array() );
}
}
if ( ! function_exists( 'calla_elated_get_blog' ) ) {
/**
* Function which return holder for all blog lists
*/
function calla_elated_get_blog( $type ) {
$holder_classes = apply_filters( 'calla_elated_blog_holder_classes', $holder_classes = '' );
$sidebar_layout = calla_elated_sidebar_layout();
$params = array(
'holder_classes' => $holder_classes,
'sidebar_layout' => $sidebar_layout,
'blog_type' => $type
);
calla_elated_get_module_template_part( 'templates/lists/holder', 'blog', '', $params );
}
}
if ( ! function_exists( 'calla_elated_get_blog_type' ) ) {
/**
* Function which create query for blog lists
*
* @param $type string with name of list that is loaded
*/
function calla_elated_get_blog_type( $type ) {
$blog_query = calla_elated_get_blog_query();
$paged = isset( $blog_query->query['paged'] ) ? $blog_query->query['paged'] : 1;
$max_num_pages = $blog_query->max_num_pages;
$blog_classes = calla_elated_get_blog_list_holder_classes( $type );
$blog_data_params = calla_elated_get_blog_holder_data_params( $type );
$params = array(
'blog_query' => $blog_query,
'paged' => $paged,
'max_num_pages' => $max_num_pages,
'blog_type' => $type,
'blog_classes' => $blog_classes,
'blog_data_params' => $blog_data_params
);
calla_elated_get_module_template_part( 'templates/lists/' . $type . '/list', 'blog', '', $params );
}
}
if ( ! function_exists( 'calla_elated_get_blog_query' ) ) {
/**
* Function which create query for blog lists
*
* @return wp query object
*/
function calla_elated_get_blog_query() {
$id = calla_elated_get_page_id();
$category = esc_attr( get_post_meta( $id, 'eltdf_blog_category_meta', true ) );
$number_of_posts_per_page = get_post_meta( $id, 'eltdf_show_posts_per_page_meta', true );
$post_number = ! empty( $number_of_posts_per_page ) ? esc_attr( $number_of_posts_per_page ) : esc_attr( get_option( 'posts_per_page' ) );
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
$query_array = array(
'post_status' => 'publish',
'post_type' => 'post',
'paged' => $paged,
'category_name' => $category,
'posts_per_page' => $post_number
);
$blog_query = new WP_Query( $query_array );
if ( is_archive() ) {
global $wp_query;
$blog_query = $wp_query;
}
return $blog_query;
}
}
if ( ! function_exists( 'calla_elated_get_max_number_of_pages' ) ) {
/**
* Function that return max number of posts/pages for pagination
*/
function calla_elated_get_max_number_of_pages() {
global $wp_query;
$max_number_of_pages = 10; //default value
if ( $wp_query ) {
$max_number_of_pages = $wp_query->max_num_pages;
}
return $max_number_of_pages;
}
}
if ( ! function_exists( 'calla_elated_get_blog_list_holder_classes' ) ) {
/**
* Function set blog list classes
*
* @param $type - type of blog list that is passing
*
* @return string - string with formatted classes
*/
function calla_elated_get_blog_list_holder_classes( $type ) {
$blog_classes = array();
$blog_classes[] = 'eltdf-blog-holder';
$blog_classes[] = 'eltdf-blog-' . $type;
$pagination_type = calla_elated_get_meta_field_intersect( 'blog_pagination_type' );
if ( ! empty( $pagination_type ) ) {
$blog_classes[] = 'eltdf-blog-pagination-' . $pagination_type;
}
$masonry_type = calla_elated_get_meta_field_intersect( 'blog_list_featured_image_proportion' );
if ( ! empty( $masonry_type ) ) {
$blog_classes[] = 'eltdf-masonry-images-' . $masonry_type;
}
$blog_classes = apply_filters( 'calla_elated_blog_list_classes', $blog_classes );
return implode( ' ', $blog_classes );
}
}
if ( ! function_exists( 'calla_elated_get_blog_holder_data_params' ) ) {
/**
* Function which set data params on blog holder div
*
* @param $type - type of blog list that is loaded
*
* @return string - string with formatted parameters
*/
function calla_elated_get_blog_holder_data_params( $type ) {
$current_query = calla_elated_get_blog_query();
$paged = isset( $current_query->query['paged'] ) ? $current_query->query['paged'] : 1;
$data_params = array();
$data_return_string = '';
$data_params['data-blog-type'] = $type;
$posts_number = get_option( 'posts_per_page' );
$posts_per_page_meta = get_post_meta( get_the_ID(), "eltdf_show_posts_per_page_meta", true );
if ( ! empty( $posts_per_page_meta ) ) {
$posts_number = esc_attr( $posts_per_page_meta );
}
$category = get_post_meta( calla_elated_get_page_id(), 'eltdf_blog_category_meta', true );
$excerpt_length = calla_elated_get_meta_field_intersect( 'number_of_chars', calla_elated_get_page_id() );
//set data params
$data_params['data-next-page'] = $paged + 1;
$data_params['data-max-num-pages'] = $current_query->max_num_pages;
$data_params['data-post-number'] = $posts_number;
$data_params['data-excerpt-length'] = $excerpt_length;
if ( ! empty( $category ) ) {
$data_params['data-category'] = $category;
}
if ( is_archive() ) {
if ( is_category() ) {
$cat_id = get_queried_object_id();
$data_params['data-archive-category'] = $cat_id;
}
if ( is_author() ) {
$author_id = get_queried_object_id();
$data_params['data-archive-author'] = $author_id;
}
if ( is_tag() ) {
$current_tag_id = get_queried_object_id();
$data_params['data-archive-tag'] = $current_tag_id;
}
if ( is_date() ) {
$day = get_query_var( 'day' );
$month = get_query_var( 'monthnum' );
$year = get_query_var( 'year' );
$data_params['data-archive-day'] = $day;
$data_params['data-archive-month'] = $month;
$data_params['data-archive-year'] = $year;
}
}
foreach ( $data_params as $key => $value ) {
if ( $key !== '' ) {
$data_return_string .= $key . '= ' . esc_attr( $value ) . ' ';
}
}
return $data_return_string;
}
}
if ( ! function_exists( 'calla_elated_blog_load_more' ) ) {
function calla_elated_blog_load_more() {
$params = array();
$paged = $post_number = $category = $blog_type = $excerpt_length = '';
$archive_category = $archive_author = $archive_tag = $archive_day = $archive_month = $archive_year = '';
if ( ! empty( $_POST['nextPage'] ) ) {
$paged = $_POST['nextPage'];
}
if ( ! empty( $_POST['postNumber'] ) ) {
$post_number = $_POST['postNumber'];
}
if ( ! empty( $_POST['category'] ) ) {
$category = $_POST['category'];
}
if ( ! empty( $_POST['blogType'] ) ) {
$blog_type = $_POST['blogType'];
}
if ( ! empty( $_POST['archiveCategory'] ) ) {
$archive_category = $_POST['archiveCategory'];
}
if ( ! empty( $_POST['archiveAuthor'] ) ) {
$archive_author = $_POST['archiveAuthor'];
}
if ( ! empty( $_POST['archiveTag'] ) ) {
$archive_tag = $_POST['archiveTag'];
}
if ( ! empty( $_POST['archiveDay'] ) ) {
$archive_day = $_POST['archiveDay'];
}
if ( ! empty( $_POST['archiveMonth'] ) ) {
$archive_month = $_POST['archiveMonth'];
}
if ( ! empty( $_POST['archiveYear'] ) ) {
$archive_year = $_POST['archiveYear'];
}
if ( ! empty( $_POST['excerptLength'] ) ) {
$excerpt_length = $_POST['excerptLength'];
}
$params['excerpt_length'] = $excerpt_length;
$query_array = array(
'post_status' => 'publish',
'post_type' => 'post',
'paged' => $paged,
'posts_per_page' => $post_number,
'post__not_in' => get_option( 'sticky_posts' )
);
if ( ! empty( $category ) ) {
$query_array['category_name'] = $category;
}
if ( ! empty( $archive_category ) ) {
$query_array['cat'] = $archive_category;
}
if ( ! empty( $archive_author ) ) {
$query_array['author'] = $archive_author;
}
if ( ! empty( $archive_tag ) ) {
$query_array['tag'] = $archive_tag;
}
if ( $archive_day !== '' && $archive_month !== '' && $archive_year !== '' ) {
$query_array['day'] = $archive_day;
$query_array['monthnum'] = $archive_month;
$query_array['year'] = $archive_year;
}
$query_results = new \WP_Query( $query_array );
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/templates/lists/' . $blog_type . '/helper.php';
$html = '';
if ( $query_results->have_posts() ):
while ( $query_results->have_posts() ) : $query_results->the_post();
$html .= calla_elated_get_post_format_html( $blog_type, 'yes', $params );
endwhile;
else:
$html .= calla_elated_get_module_template_part( 'templates/parts/no-posts', 'blog' );
endif;
wp_reset_postdata();
$return_obj = array(
'html' => $html,
);
echo json_encode( $return_obj );
exit;
}
add_action( 'wp_ajax_nopriv_calla_elated_blog_load_more', 'calla_elated_blog_load_more' );
add_action( 'wp_ajax_calla_elated_blog_load_more', 'calla_elated_blog_load_more' );
}
if ( ! function_exists( 'calla_elated_get_post_format_html' ) ) {
/**
* Function which return html for post formats
*
* @param $type
* @param $ajax
* @param $ajax_params
*
* @return html with format template
*/
function calla_elated_get_post_format_html( $type = "", $ajax = '', $ajax_params = array() ) {
$post_format = calla_elated_return_post_format();
$params = array();
$params['blog_template_type'] = $type;
$params['post_format'] = $post_format;
$post_classes = array();
// Sticky class is added on posts only when they are displayed on the first page of the blog home
if ( is_sticky( get_the_ID() ) ) {
$post_classes[] = 'sticky';
}
$post_classes[] = calla_elated_return_has_media() ? 'eltdf-post-has-media' : 'eltdf-post-no-media';
$params['post_classes'] = $post_classes;
/*
* Available parameters for template parts
* -image_size
* -title_tag
* -link_tag
* -quote_tag
* -share_type
*/
$part_params_temp = array_merge( array(), $ajax_params );
$params['part_params'] = apply_filters( 'calla_elated_blog_part_params', $part_params_temp );
$background_img = get_the_post_thumbnail_url(get_the_ID(),'full');
$params['post_background_image'] = 'background-image: url("'.esc_url($background_img).'");';
if ( $ajax == '' ) {
calla_elated_get_module_template_part( 'templates/lists/' . $type . '/post', 'blog', $post_format, $params );
}
if ( $ajax == 'yes' ) {
return calla_elated_get_blog_module_template_part( 'templates/lists/' . $type . '/post', $post_format, $params );
}
}
}
if ( ! function_exists( 'calla_elated_single_link_pages' ) ) {
/**
* Function which return parts on single.php which are just below content
*/
function calla_elated_single_link_pages() {
$args_pages = array(
'before' => '<div class="eltdf-single-links-pages"><div class="eltdf-single-links-pages-inner"><span>' . esc_html__( 'Pages: ', 'calla' ) . '</span>',
'after' => '</div></div>',
'link_before' => '<span>' . esc_html__( 'Link ', 'calla' ),
'link_after' => '</span>',
'pagelink' => '%'
);
wp_link_pages( $args_pages );
}
add_action( 'calla_elated_single_link_pages', 'calla_elated_single_link_pages' );
}
if ( ! function_exists( 'calla_elated_get_blog_single' ) ) {
/**
* Function which return holder for single posts
*
* @param type - type of single layout
*/
function calla_elated_get_blog_single( $type ) {
$sidebar_layout = calla_elated_sidebar_layout();
$holder_classes = $sidebar_layout !== 'no-sidebar' ? 'eltdf-content-has-sidebar' : '';
$holder_classes = apply_filters( 'calla_elated_blog_single_holder_classes', $holder_classes );
$blog_single_padding = calla_elated_get_blog_single_holder_padding();
$params = array(
'holder_classes' => $holder_classes,
'sidebar_layout' => $sidebar_layout,
'blog_single_padding' => $blog_single_padding,
'blog_single_type' => $type,
'blog_single_classes' => 'eltdf-blog-single-' . $type
);
calla_elated_get_module_template_part( 'templates/singles/holder', 'blog', '', $params );
}
}
if ( ! function_exists( 'calla_elated_get_blog_single_type' ) ) {
/**
* Function which returns proper single post template
*
* @param $type string with name of list that is loaded
*/
function calla_elated_get_blog_single_type( $type ) {
$params = array();
$params['blog_single_type'] = $type;
/*
* Available parameters for info parts
* -related_posts_image_size
*/
$params['single_info_params'] = apply_filters( 'calla_elated_blog_single_info_params', array() );
calla_elated_get_module_template_part( 'templates/singles/' . $type . '/single', 'blog', '', $params );
}
}
if ( ! function_exists( 'calla_elated_get_single_post_format_html' ) ) {
/**
* Function return all parts on single.php page
*
* @param $type - type of blog single layout
*/
function calla_elated_get_single_post_format_html( $type ) {
$post_format = calla_elated_return_post_format();
$params = array();
$params['post_format'] = $post_format;
/*
* Available parameters for template parts
* -post_format
* -image_size
* -title_tag
* -link_tag
* -quote_tag
* -share type
*/
$background_img = get_the_post_thumbnail_url(get_the_ID(),'full');
$params['post_background_image'] = 'background-image: url("'.esc_url($background_img).'");';
$params['part_params'] = apply_filters( 'calla_elated_blog_part_params', array() );
calla_elated_get_module_template_part( 'templates/singles/' . $type . '/post', 'blog', $post_format, $params );
}
}
if ( ! function_exists( 'calla_elated_excerpt' ) ) {
/**
* Function that cuts post excerpt to the number of word based on previosly set global
* variable $word_count, which is defined in eltd_set_blog_word_count function.
*
* @param $length - default excerpt length
*
* @return string - formatted excerpt
*
* It current post has read more tag set it will return content of the post, else it will return post excerpt
*
*/
function calla_elated_excerpt( $length ) {
global $post;
//does current post has read more tag set?
if ( calla_elated_post_has_read_more() ) {
global $more;
//override global $more variable so this can be used in blog templates
$more = 0;
return get_the_content( true );
}
$number_of_chars = calla_elated_get_meta_field_intersect( 'number_of_chars', calla_elated_get_page_id() );
$word_count = $length !== '' ? $length : $number_of_chars;
//is word count set to something different that 0?
if ( $word_count > 0 ) {
//if post excerpt field is filled take that as post excerpt, else that content of the post
$post_excerpt = $post->post_excerpt !== '' ? $post->post_excerpt : strip_tags( strip_shortcodes( $post->post_content ) );
//remove leading dots if those exists
$clean_excerpt = strlen( $post_excerpt ) && strpos( $post_excerpt, '...' ) ? strstr( $post_excerpt, '...', true ) : $post_excerpt;
//if clean excerpt has text left
if ( $clean_excerpt !== '' ) {
//explode current excerpt to words
$excerpt_word_array = explode( ' ', $clean_excerpt );
//cut down that array based on the number of the words option
$excerpt_word_array = array_slice( $excerpt_word_array, 0, $word_count );
//and finally implode words together
$excerpt = implode( ' ', $excerpt_word_array );
//is excerpt different than empty string?
if ( $excerpt !== '' ) {
return rtrim( wp_kses_post( $excerpt ) );
}
}
return '';
} else {
return '';
}
}
}
if ( ! function_exists( 'calla_elated_excerpt_length' ) ) {
/**
* Function that changes excerpt length based on theme options
*/
function calla_elated_excerpt_length() {
$numb_of_chars = calla_elated_options()->getOptionValue( 'number_of_chars' );
return $numb_of_chars !== '' ? $numb_of_chars : 45;
}
add_filter( 'excerpt_length', 'calla_elated_excerpt_length', 999 );
}
if ( ! function_exists( 'calla_elated_post_has_read_more' ) ) {
/**
* Function that checks if current post has read more tag set
* @return int position of read more tag text. It will return false if read more tag isn't set
*/
function calla_elated_post_has_read_more() {
global $post;
return strpos( $post->post_content, '<!--more-->' );
}
}
if ( ! function_exists( 'calla_elated_modify_read_more_link' ) ) {
/**
* Function that modifies read more link output.
* Hooks to the_content_more_link
* @return string modified output
*/
function calla_elated_modify_read_more_link() {
$button_params = array(
'link' => get_permalink() . '#more-' . get_the_ID(),
'text' => esc_html__( 'Continue Reading', 'calla' )
);
$link = '<div class="eltdf-more-link-container">' . calla_elated_return_button_html( $button_params ) . '</div>';
return $link;
}
add_filter( 'the_content_more_link', 'calla_elated_modify_read_more_link' );
}
if ( ! function_exists( 'calla_elated_get_blog_related_post_type' ) ) {
/**
* Function for returning latest posts types
*
* @param $post_id
* @param array $options
*
* @return WP_Query
*/
function calla_elated_get_blog_related_post_type( $post_id, $options = array() ) {
$tags = get_the_tags( $post_id );
//Get categories
$categories = get_the_category( $post_id );
$tag_ids = array();
if ( $tags ) {
foreach ( $tags as $tag ) {
$tag_ids[] = $tag->term_id;
}
}
$category_ids = array();
if ( $categories ) {
foreach ( $categories as $category ) {
$category_ids[] = $category->term_id;
}
}
$hasRelatedByTag = false;
if ( $tag_ids ) {
$related_by_tag = calla_elated_get_blog_related_posts( $post_id, $tag_ids, 'tag', $options );
if ( ! empty( $related_by_tag->posts ) ) {
$hasRelatedByTag = true;
return $related_by_tag;
}
}
if ( $categories && ! $hasRelatedByTag ) {
$related_by_category = calla_elated_get_blog_related_posts( $post_id, $category_ids, 'category', $options );
if ( ! empty( $related_by_category->posts ) ) {
return $related_by_category;
}
}
}
}
if ( ! function_exists( 'calla_elated_get_blog_related_posts' ) ) {
/**
* Function for related posts
*
* @param $post_id - Post ID
* @param $term_ids - Category or Tag IDs
* @param $slug - term slug for WP_Query
* @param array $options
*
* @return WP_Query
*/
function calla_elated_get_blog_related_posts( $post_id, $term_ids, $slug, $options = array() ) {
//Query options
$posts_per_page = - 1;
//Override query options
extract( $options );
$args = array(
'post_status' => 'publish',
'post__not_in' => array( $post_id ),
$slug . '__in' => $term_ids,
'order' => 'DESC',
'orderby' => 'date',
'posts_per_page' => $posts_per_page
);
$related_posts = new WP_Query( $args );
return $related_posts;
}
}
if ( ! function_exists( 'calla_elated_blog_shortcode_load_more' ) ) {
function calla_elated_blog_shortcode_load_more() {
$params = array();
if ( ! empty( $_POST ) ) {
foreach ( $_POST as $key => $value ) {
if ( $key !== '' ) {
$addUnderscoreBeforeCapitalLetter = preg_replace( '/([A-Z])/', '_$1', $key );
$setAllLettersToLowercase = strtolower( $addUnderscoreBeforeCapitalLetter );
$params[ $setAllLettersToLowercase ] = $value;
}
}
}
$this_object = new \CallaCore\CPT\Shortcodes\BlogList\BlogList();
$query_array = $this_object->generateQueryArray( $params );
$query_results = new \WP_Query( $query_array );
$params['this_object'] = $this_object;
ob_start();
if ( $query_results->have_posts() ):
while ( $query_results->have_posts() ) : $query_results->the_post();
calla_elated_get_module_template_part('shortcodes/blog-list/layout-collections/post', 'blog', $params['type'], $params);
endwhile;
else:
calla_elated_get_module_template_part( 'templates/parts/no-posts', 'blog', '', $params );
endif;
$html = ob_get_contents();
ob_end_clean();
wp_reset_postdata();
$return_obj = array(
'html' => $html,
);
echo json_encode( $return_obj );
exit;
}
add_action( 'wp_ajax_nopriv_calla_elated_blog_shortcode_load_more', 'calla_elated_blog_shortcode_load_more' );
add_action( 'wp_ajax_calla_elated_blog_shortcode_load_more', 'calla_elated_blog_shortcode_load_more' );
}
if ( ! function_exists( 'calla_elated_get_user_custom_fields' ) ) {
/**
* Function returns links and icons for author social networks
* @param int|boolean $user_id
*
*@return string
*/
function calla_elated_get_user_custom_fields($user_id = false) {
$user_social_array = array();
$social_network_array = array(
'facebook',
'twitter',
'linkedin',
'instagram',
'pinterest',
'tumblr',
'googleplus'
);
foreach ( $social_network_array as $network ) {
if ( get_the_author_meta( $network, $user_id ) !== '' ) {
$$network = array(
'link' => get_the_author_meta( $network ),
'class' => 'social_' . $network . ' eltdf-author-social-' . $network . ' eltdf-author-social-icon'
);
$user_social_array[ $network ] = $$network;
}
}
return $user_social_array;
}
}
if ( ! function_exists( 'calla_elated_blog_item_has_link' ) ) {
/**
* Function returns true/false depends is single post or in loop
*/
function calla_elated_blog_item_has_link() {
$is_link = ( is_single() && ( get_the_ID() === calla_elated_get_page_id() ) ) ? false : true;
return $is_link;
}
}
if ( ! function_exists( 'calla_elated_get_blog_module' ) ) {
/**
* Function returns single/list depending is single post or in loop
*/
function calla_elated_get_blog_module() {
$module = ( is_single() && ( get_the_ID() === calla_elated_get_page_id() ) ) ? 'single' : 'list';
return $module;
}
}
if ( ! function_exists( 'calla_elated_return_post_format' ) ) {
/**
* Function return all parts on single.php page
*/
function calla_elated_return_post_format() {
$post_format = get_post_format();
$supported_post_formats = array( 'audio', 'video', 'link', 'quote', 'gallery' );
$post_format = in_array( $post_format, $supported_post_formats ) ? $post_format : 'standard';
return $post_format;
}
}
if ( ! function_exists( 'calla_elated_return_has_media' ) ) {
/**
* Function return all parts on single.php page
*
* @return string with post format
*/
function calla_elated_return_has_media() {
$post_format = get_post_format();
switch ( $post_format ):
case "video":
return get_post_meta( get_the_ID(), 'eltdf_post_video_custom_meta', true ) !== '' || get_post_meta( get_the_ID(), 'eltdf_post_video_link_meta', true ) !== '';
break;
case "audio":
return get_post_meta( get_the_ID(), 'eltdf_post_audio_custom_meta', true ) !== '' || get_post_meta( get_the_ID(), 'eltdf_post_audio_link_meta', true ) !== '';
break;
case "gallery":
return get_post_meta( get_the_ID(), 'eltdf_post_gallery_images_meta', true ) !== '';
break;
case "quote":
return get_post_meta( get_the_ID(), 'eltdf_post_quote_text_meta', true ) !== '';
break;
case "link":
return get_post_meta( get_the_ID(), 'eltdf_post_link_link_meta', true ) !== '';
break;
default:
return get_post_meta( get_the_ID(), 'eltdf_blog_list_featured_image_meta', true ) !== '' || has_post_thumbnail();
break;
endswitch;
}
}
if ( ! function_exists( 'calla_elated_blog_single_title' ) ) {
/**
* Function that checks option for single post title and overrides it with filter
*/
function calla_elated_blog_single_title( $show_title_area ) {
$show_title_area_meta = calla_elated_get_meta_field_intersect( 'show_title_area_blog' );
if ( ! empty( $show_title_area_meta ) && is_singular('post') ) {
$show_title_area = $show_title_area_meta === 'yes' ? true : false;
}
return $show_title_area;
}
add_filter( 'calla_elated_show_title_area', 'calla_elated_blog_single_title' );
}
if ( ! function_exists( 'calla_elated_set_title_text_output_for_single_posts' ) ) {
function calla_elated_set_title_text_output_for_single_posts( $title ) {
$setSinglePostTitle = calla_elated_options()->getOptionValue( 'blog_single_title_in_title_area' );
if ( is_singular( 'post' ) && $setSinglePostTitle === 'yes' ) {
$title = get_the_title( calla_elated_get_page_id() );
}
return $title;
}
add_filter( 'calla_elated_title_text', 'calla_elated_set_title_text_output_for_single_posts' );
}

View File

@@ -0,0 +1,10 @@
<?php
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/blog-functions.php';
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/shortcodes/shortcodes-functions.php';
//load global blog options
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/admin/options-map/blog-map.php';
//load per page blog options
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/admin/meta-boxes/blog-meta-boxes.php';

View File

@@ -0,0 +1,296 @@
(function($) {
"use strict";
var blogListSC = {};
eltdf.modules.blogListSC = blogListSC;
blogListSC.eltdfOnDocumentReady = eltdfOnDocumentReady;
blogListSC.eltdfOnWindowLoad = eltdfOnWindowLoad;
blogListSC.eltdfOnWindowScroll = eltdfOnWindowScroll;
$(document).ready(eltdfOnDocumentReady);
$(window).on('load', eltdfOnWindowLoad);
$(window).scroll(eltdfOnWindowScroll);
/*
All functions to be called on $(document).ready() should be in this function
*/
function eltdfOnDocumentReady() {
eltdfInitBlogListMasonry();
}
/*
All functions to be called on $(window).load() should be in this function
*/
function eltdfOnWindowLoad() {
eltdfInitBlogListShortcodePagination().init();
}
/*
All functions to be called on $(window).scroll() should be in this function
*/
function eltdfOnWindowScroll() {
eltdfInitBlogListShortcodePagination().scroll();
}
/**
* Init blog list shortcode masonry layout
*/
function eltdfInitBlogListMasonry() {
var holder = $('.eltdf-blog-list-holder.eltdf-bl-masonry');
if(holder.length){
holder.each(function(){
var thisHolder = $(this),
masonry = thisHolder.find('.eltdf-blog-list');
masonry.waitForImages(function() {
masonry.isotope({
layoutMode: 'packery',
itemSelector: '.eltdf-bl-item',
percentPosition: true,
packery: {
gutter: '.eltdf-bl-grid-gutter',
columnWidth: '.eltdf-bl-grid-sizer'
}
});
masonry.css('opacity', '1');
});
});
}
}
/**
* Init blog list shortcode pagination functions
*/
function eltdfInitBlogListShortcodePagination(){
var holder = $('.eltdf-blog-list-holder');
var initStandardPagination = function(thisHolder) {
var standardLink = thisHolder.find('.eltdf-bl-standard-pagination li');
if(standardLink.length) {
standardLink.each(function(){
var thisLink = $(this).children('a'),
pagedLink = 1;
thisLink.on('click', function(e) {
e.preventDefault();
e.stopPropagation();
if (typeof thisLink.data('paged') !== 'undefined' && thisLink.data('paged') !== false) {
pagedLink = thisLink.data('paged');
}
initMainPagFunctionality(thisHolder, pagedLink);
});
});
}
};
var initLoadMorePagination = function(thisHolder) {
var loadMoreButton = thisHolder.find('.eltdf-blog-pag-load-more a');
loadMoreButton.on('click', function(e) {
e.preventDefault();
e.stopPropagation();
initMainPagFunctionality(thisHolder);
});
};
var initInifiteScrollPagination = function(thisHolder) {
var blogListHeight = thisHolder.outerHeight(),
blogListTopOffest = thisHolder.offset().top,
blogListPosition = blogListHeight + blogListTopOffest - eltdfGlobalVars.vars.eltdfAddForAdminBar;
if(!thisHolder.hasClass('eltdf-bl-pag-infinite-scroll-started') && eltdf.scroll + eltdf.windowHeight > blogListPosition) {
initMainPagFunctionality(thisHolder);
}
};
var initMainPagFunctionality = function(thisHolder, pagedLink) {
var thisHolderInner = thisHolder.find('.eltdf-blog-list'),
nextPage,
maxNumPages;
if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) {
maxNumPages = thisHolder.data('max-num-pages');
}
if(thisHolder.hasClass('eltdf-bl-pag-standard-shortcodes')) {
thisHolder.data('next-page', pagedLink);
}
if(thisHolder.hasClass('eltdf-bl-pag-infinite-scroll')) {
thisHolder.addClass('eltdf-bl-pag-infinite-scroll-started');
}
var loadMoreDatta = eltdf.modules.common.getLoadMoreData(thisHolder),
loadingItem = thisHolder.find('.eltdf-blog-pag-loading');
nextPage = loadMoreDatta.nextPage;
if(nextPage <= maxNumPages){
if(thisHolder.hasClass('eltdf-bl-pag-standard-shortcodes')) {
loadingItem.addClass('eltdf-showing eltdf-standard-pag-trigger');
thisHolder.addClass('eltdf-bl-pag-standard-shortcodes-animate');
} else {
loadingItem.addClass('eltdf-showing');
}
var ajaxData = eltdf.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'calla_elated_blog_shortcode_load_more');
$.ajax({
type: 'POST',
data: ajaxData,
url: eltdfGlobalVars.vars.eltdfAjaxUrl,
success: function (data) {
if(!thisHolder.hasClass('eltdf-bl-pag-standard-shortcodes')) {
nextPage++;
}
thisHolder.data('next-page', nextPage);
var response = $.parseJSON(data),
responseHtml = response.html;
if(thisHolder.hasClass('eltdf-bl-pag-standard-shortcodes')) {
eltdfInitStandardPaginationLinkChanges(thisHolder, maxNumPages, nextPage);
thisHolder.waitForImages(function(){
if(thisHolder.hasClass('eltdf-bl-masonry')){
eltdfInitHtmlIsotopeNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml);
} else {
eltdfInitHtmlGalleryNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml);
if (typeof eltdf.modules.common.eltdfStickySidebarWidget === 'function') {
eltdf.modules.common.eltdfStickySidebarWidget().reInit();
}
}
});
} else {
thisHolder.waitForImages(function(){
if(thisHolder.hasClass('eltdf-bl-masonry')){
eltdfInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml);
} else {
eltdfInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml);
if (typeof eltdf.modules.common.eltdfStickySidebarWidget === 'function') {
eltdf.modules.common.eltdfStickySidebarWidget().reInit();
}
}
});
}
if(thisHolder.hasClass('eltdf-bl-pag-infinite-scroll-started')) {
thisHolder.removeClass('eltdf-bl-pag-infinite-scroll-started');
}
}
});
}
if(nextPage === maxNumPages){
thisHolder.find('.eltdf-blog-pag-load-more').hide();
}
};
var eltdfInitStandardPaginationLinkChanges = function(thisHolder, maxNumPages, nextPage) {
var standardPagHolder = thisHolder.find('.eltdf-bl-standard-pagination'),
standardPagNumericItem = standardPagHolder.find('li.eltdf-bl-pag-number'),
standardPagPrevItem = standardPagHolder.find('li.eltdf-bl-pag-prev a'),
standardPagNextItem = standardPagHolder.find('li.eltdf-bl-pag-next a');
standardPagNumericItem.removeClass('eltdf-bl-pag-active');
standardPagNumericItem.eq(nextPage-1).addClass('eltdf-bl-pag-active');
standardPagPrevItem.data('paged', nextPage-1);
standardPagNextItem.data('paged', nextPage+1);
if(nextPage > 1) {
standardPagPrevItem.css({'opacity': '1'});
} else {
standardPagPrevItem.css({'opacity': '0'});
}
if(nextPage === maxNumPages) {
standardPagNextItem.css({'opacity': '0'});
} else {
standardPagNextItem.css({'opacity': '1'});
}
};
var eltdfInitHtmlIsotopeNewContent = function(thisHolder, thisHolderInner, loadingItem, responseHtml) {
thisHolderInner.html(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('eltdf-showing eltdf-standard-pag-trigger');
thisHolder.removeClass('eltdf-bl-pag-standard-shortcodes-animate');
setTimeout(function() {
thisHolderInner.isotope('layout');
if (typeof eltdf.modules.common.eltdfStickySidebarWidget === 'function') {
eltdf.modules.common.eltdfStickySidebarWidget().reInit();
}
}, 600);
};
var eltdfInitHtmlGalleryNewContent = function(thisHolder, thisHolderInner, loadingItem, responseHtml) {
loadingItem.removeClass('eltdf-showing eltdf-standard-pag-trigger');
thisHolder.removeClass('eltdf-bl-pag-standard-shortcodes-animate');
thisHolderInner.html(responseHtml);
};
var eltdfInitAppendIsotopeNewContent = function(thisHolderInner, loadingItem, responseHtml) {
thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'});
loadingItem.removeClass('eltdf-showing');
setTimeout(function() {
thisHolderInner.isotope('layout');
if (typeof eltdf.modules.common.eltdfStickySidebarWidget === 'function') {
eltdf.modules.common.eltdfStickySidebarWidget().reInit();
}
}, 600);
};
var eltdfInitAppendGalleryNewContent = function(thisHolderInner, loadingItem, responseHtml) {
loadingItem.removeClass('eltdf-showing');
thisHolderInner.append(responseHtml);
};
return {
init: function() {
if(holder.length) {
holder.each(function() {
var thisHolder = $(this);
if(thisHolder.hasClass('eltdf-bl-pag-standard-shortcodes')) {
initStandardPagination(thisHolder);
}
if(thisHolder.hasClass('eltdf-bl-pag-load-more')) {
initLoadMorePagination(thisHolder);
}
if(thisHolder.hasClass('eltdf-bl-pag-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
},
scroll: function() {
if(holder.length) {
holder.each(function() {
var thisHolder = $(this);
if(thisHolder.hasClass('eltdf-bl-pag-infinite-scroll')) {
initInifiteScrollPagination(thisHolder);
}
});
}
}
};
}
})(jQuery);

View File

@@ -0,0 +1,442 @@
<?php
namespace CallaCore\CPT\Shortcodes\BlogList;
use CallaCore\Lib;
class BlogList implements Lib\ShortcodeInterface {
private $base;
function __construct() {
$this->base = 'eltdf_blog_list';
add_action('vc_before_init', array($this,'vcMap'));
//Category filter
add_filter( 'vc_autocomplete_eltdf_blog_list_category_callback', array( &$this, 'blogCategoryAutocompleteSuggester', ), 10, 1 ); // Get suggestion(find). Must return an array
//Category render
add_filter( 'vc_autocomplete_eltdf_blog_list_category_render', array( &$this, 'blogCategoryAutocompleteRender', ), 10, 1 ); // Get suggestion(find). Must return an array
}
public function getBase() {
return $this->base;
}
public function vcMap() {
vc_map(
array(
'name' => esc_html__( 'Elated Blog List', 'calla' ),
'base' => $this->base,
'icon' => 'icon-wpb-blog-list extended-custom-icon',
'category' => esc_html__( 'by ELATED', 'calla' ),
'allowed_container_element' => 'vc_row',
'params' => array(
array(
'type' => 'dropdown',
'param_name' => 'type',
'heading' => esc_html__( 'Type', 'calla' ),
'value' => array(
esc_html__( 'Standard', 'calla' ) => 'standard',
esc_html__( 'Boxed', 'calla' ) => 'boxed',
esc_html__( 'Masonry', 'calla' ) => 'masonry',
esc_html__( 'Simple', 'calla' ) => 'simple',
esc_html__( 'Minimal', 'calla' ) => 'minimal'
),
'save_always' => true
),
array(
'type' => 'textfield',
'param_name' => 'number_of_posts',
'heading' => esc_html__( 'Number of Posts', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'number_of_columns',
'heading' => esc_html__( 'Number of Columns', 'calla' ),
'value' => array(
esc_html__( 'One', 'calla' ) => '1',
esc_html__( 'Two', 'calla' ) => '2',
esc_html__( 'Three', 'calla' ) => '3',
esc_html__( 'Four', 'calla' ) => '4',
esc_html__( 'Five', 'calla' ) => '5'
),
'dependency' => array( 'element' => 'type', 'value' => array( 'standard', 'boxed', 'masonry' ) )
),
array(
'type' => 'dropdown',
'param_name' => 'space_between_items',
'heading' => esc_html__( 'Space Between Items', 'calla' ),
'value' => array_flip( calla_elated_get_space_between_items_array() ),
'save_always' => true,
'dependency' => array( 'element' => 'type', 'value' => array( 'standard', 'boxed', 'masonry' ) )
),
array(
'type' => 'dropdown',
'param_name' => 'orderby',
'heading' => esc_html__( 'Order By', 'calla' ),
'value' => array_flip( calla_elated_get_query_order_by_array() ),
'save_always' => true
),
array(
'type' => 'dropdown',
'param_name' => 'order',
'heading' => esc_html__( 'Order', 'calla' ),
'value' => array_flip( calla_elated_get_query_order_array() ),
'save_always' => true
),
array(
'type' => 'autocomplete',
'param_name' => 'category',
'heading' => esc_html__( 'Category', 'calla' ),
'description' => esc_html__( 'Enter one category slug (leave empty for showing all categories)', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'image_size',
'heading' => esc_html__( 'Image Size', 'calla' ),
'value' => array(
esc_html__( 'Original', 'calla' ) => 'full',
esc_html__( 'Square', 'calla' ) => 'calla_elated_square',
esc_html__( 'Landscape', 'calla' ) => 'calla_elated_landscape',
esc_html__( 'Portrait', 'calla' ) => 'calla_elated_portrait',
esc_html__( 'Thumbnail', 'calla' ) => 'thumbnail',
esc_html__( 'Medium', 'calla' ) => 'medium',
esc_html__( 'Large', 'calla' ) => 'large'
),
'save_always' => true,
'dependency' => Array( 'element' => 'type', 'value' => array( 'standard', 'boxed', 'masonry' ) )
),
array(
'type' => 'dropdown',
'param_name' => 'title_tag',
'heading' => esc_html__( 'Title Tag', 'calla' ),
'value' => array_flip( calla_elated_get_title_tag( true ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'title_transform',
'heading' => esc_html__( 'Title Text Transform', 'calla' ),
'value' => array_flip( calla_elated_get_text_transform_array( true ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'textfield',
'param_name' => 'excerpt_length',
'heading' => esc_html__( 'Text Length', 'calla' ),
'description' => esc_html__( 'Number of characters', 'calla' ),
'dependency' => Array( 'element' => 'type', 'value' => array( 'standard', 'boxed', 'masonry', 'simple' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_image',
'heading' => esc_html__( 'Enable Post Info Image', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'dependency' => Array( 'element' => 'type', 'value' => array( 'standard', 'boxed', 'masonry' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_image_zoom',
'heading' => esc_html__( 'Enable Image Zoom', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, false ) ),
'dependency' => Array( 'element' => 'post_info_image', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_image_shader',
'heading' => esc_html__( 'Enable Image Shader', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, false ) ),
'dependency' => Array( 'element' => 'post_info_image', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_section',
'heading' => esc_html__( 'Enable Post Info Section', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'dependency' => Array( 'element' => 'type', 'value' => array( 'standard', 'boxed', 'masonry' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_author',
'heading' => esc_html__( 'Enable Post Info Author', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'dependency' => Array( 'element' => 'post_info_section', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_date',
'heading' => esc_html__( 'Enable Post Info Date', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'dependency' => Array( 'element' => 'post_info_section', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_category',
'heading' => esc_html__( 'Enable Post Info Category', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'dependency' => Array( 'element' => 'post_info_section', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_comments',
'heading' => esc_html__( 'Enable Post Info Comments', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false ) ),
'dependency' => Array( 'element' => 'post_info_section', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_like',
'heading' => esc_html__( 'Enable Post Info Like', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false ) ),
'dependency' => Array( 'element' => 'post_info_section', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_share',
'heading' => esc_html__( 'Enable Post Info Share', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false ) ),
'dependency' => Array( 'element' => 'post_info_section', 'value' => array( 'yes' ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'pagination_type',
'heading' => esc_html__( 'Pagination Type', 'calla' ),
'value' => array(
esc_html__( 'None', 'calla' ) => 'no-pagination',
esc_html__( 'Standard', 'calla' ) => 'standard-shortcodes',
esc_html__( 'Load More', 'calla' ) => 'load-more',
esc_html__( 'Infinite Scroll', 'calla' ) => 'infinite-scroll'
),
'group' => esc_html__( 'Additional Features', 'calla' )
)
)
)
);
}
public function render( $atts, $content = null ) {
$default_atts = array(
'type' => 'standard',
'number_of_posts' => '-1',
'number_of_columns' => '3',
'space_between_items' => 'normal',
'category' => '',
'orderby' => 'title',
'order' => 'ASC',
'image_size' => 'full',
'title_tag' => 'h5',
'title_transform' => '',
'excerpt_length' => '40',
'post_info_section' => 'yes',
'post_info_image' => 'yes',
'post_info_image_zoom' => 'no',
'post_info_image_shader'=> 'no',
'post_info_author' => 'yes',
'post_info_date' => 'yes',
'post_info_category' => 'yes',
'post_info_comments' => 'no',
'post_info_like' => 'no',
'post_info_share' => 'no',
'pagination_type' => 'no-pagination'
);
$params = shortcode_atts( $default_atts, $atts );
$queryArray = $this->generateQueryArray( $params );
$query_result = new \WP_Query( $queryArray );
$params['query_result'] = $query_result;
$params['holder_data'] = $this->getHolderData( $params );
$params['holder_classes'] = $this->getHolderClasses( $params, $default_atts );
$params['module'] = 'list';
$params['max_num_pages'] = $query_result->max_num_pages;
$params['paged'] = isset( $query_result->query['paged'] ) ? $query_result->query['paged'] : 1;
$params['this_object'] = $this;
ob_start();
calla_elated_get_module_template_part( 'shortcodes/blog-list/holder', 'blog', $params['type'], $params );
$html = ob_get_contents();
ob_end_clean();
return $html;
}
public function getHolderClasses( $params, $default_atts ) {
$holderClasses = array();
$holderClasses[] = ! empty( $params['type'] ) ? 'eltdf-bl-' . $params['type'] : 'eltdf-bl-' . $default_atts['type'];
$holderClasses[] = $this->getColumnNumberClass( $params['number_of_columns'] );
$holderClasses[] = ! empty( $params['space_between_items'] ) ? 'eltdf-' . $params['space_between_items'] . '-space' : 'eltdf-' . $default_atts['space_between_items'] . '-space';
$holderClasses[] = ! empty( $params['pagination_type'] ) ? 'eltdf-bl-pag-' . $params['pagination_type'] : 'eltdf-bl-pag-' . $default_atts['pagination_type'];
$holderClasses[] = ( $params['post_info_image_zoom'] == 'yes') ? 'eltdf-bl-image-zoom' : '';
$holderClasses[] = ( $params['post_info_image_shader'] == 'yes') ? 'eltdf-bl-image-shader' : '';
return implode( ' ', $holderClasses );
}
public function getColumnNumberClass( $params ) {
switch ( $params ) {
case 1:
$classes = 'eltdf-bl-one-column';
break;
case 2:
$classes = 'eltdf-bl-two-columns';
break;
case 3:
$classes = 'eltdf-bl-three-columns';
break;
case 4:
$classes = 'eltdf-bl-four-columns';
break;
case 5:
$classes = 'eltdf-bl-five-columns';
break;
default:
$classes = 'eltdf-bl-three-columns';
break;
}
return $classes;
}
public function getHolderData( $params ) {
$dataString = '';
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
$query_result = $params['query_result'];
$params['max_num_pages'] = $query_result->max_num_pages;
if ( ! empty( $paged ) ) {
$params['next-page'] = $paged + 1;
}
foreach ( $params as $key => $value ) {
if ( $key !== 'query_result' && $value !== '' ) {
$new_key = str_replace( '_', '-', $key );
$dataString .= ' data-' . $new_key . '=' . esc_attr( str_replace( ' ', '', $value ) );
}
}
return $dataString;
}
public function generateQueryArray( $params ) {
$queryArray = array(
'post_status' => 'publish',
'post_type' => 'post',
'orderby' => $params['orderby'],
'order' => $params['order'],
'posts_per_page' => $params['number_of_posts'],
'post__not_in' => get_option( 'sticky_posts' )
);
if ( ! empty( $params['category'] ) ) {
$queryArray['category_name'] = $params['category'];
}
if ( ! empty( $params['next_page'] ) ) {
$queryArray['paged'] = $params['next_page'];
} else {
$query_array['paged'] = 1;
}
return $queryArray;
}
public function getTitleStyles( $params ) {
$styles = array();
if ( ! empty( $params['title_transform'] ) ) {
$styles[] = 'text-transform: ' . $params['title_transform'];
}
return implode( ';', $styles );
}
/**
* Filter blog categories
*
* @param $query
*
* @return array
*/
public function blogCategoryAutocompleteSuggester( $query ) {
global $wpdb;
$post_meta_infos = $wpdb->get_results( $wpdb->prepare( "SELECT a.slug AS slug, a.name AS category_title
FROM {$wpdb->terms} AS a
LEFT JOIN ( SELECT term_id, taxonomy FROM {$wpdb->term_taxonomy} ) AS b ON b.term_id = a.term_id
WHERE b.taxonomy = 'category' AND a.name LIKE '%%%s%%'", stripslashes( $query ) ), ARRAY_A );
$results = array();
if ( is_array( $post_meta_infos ) && ! empty( $post_meta_infos ) ) {
foreach ( $post_meta_infos as $value ) {
$data = array();
$data['value'] = $value['slug'];
$data['label'] = ( ( strlen( $value['category_title'] ) > 0 ) ? esc_html__( 'Category', 'calla' ) . ': ' . $value['category_title'] : '' );
$results[] = $data;
}
}
return $results;
}
/**
* Find blog category by slug
* @since 4.4
*
* @param $query
*
* @return bool|array
*/
public function blogCategoryAutocompleteRender( $query ) {
$query = trim( $query['value'] ); // get value from requested
if ( ! empty( $query ) ) {
// get portfolio category
$category = get_term_by( 'slug', $query, 'category' );
if ( is_object( $category ) ) {
$category_slug = $category->slug;
$category_title = $category->name;
$category_title_display = '';
if ( ! empty( $category_title ) ) {
$category_title_display = esc_html__( 'Category', 'calla' ) . ': ' . $category_title;
}
$data = array();
$data['value'] = $category_slug;
$data['label'] = $category_title_display;
return ! empty( $data ) ? $data : false;
}
return false;
}
return false;
}
}

View File

@@ -0,0 +1,20 @@
<div class="eltdf-blog-list-holder <?php echo esc_attr( $holder_classes ); ?>" <?php echo wp_kses( $holder_data, array( 'data' ) ); ?>>
<div class="eltdf-bl-wrapper eltdf-outer-space">
<ul class="eltdf-blog-list">
<li class="eltdf-bl-grid-sizer"></li>
<li class="eltdf-bl-grid-gutter"></li>
<?php
if ( $query_result->have_posts() ):
while ( $query_result->have_posts() ) : $query_result->the_post();
calla_elated_get_module_template_part( 'shortcodes/blog-list/layout-collections/post', 'blog', $type, $params );
endwhile;
else:
calla_elated_get_module_template_part( 'templates/parts/no-posts', 'blog', '', $params );
endif;
wp_reset_postdata();
?>
</ul>
</div>
<?php calla_elated_get_module_template_part( 'templates/parts/pagination/' . $params['pagination_type'], 'blog', '', $params ); ?>
</div>

View File

@@ -0,0 +1,18 @@
<div class="eltdf-blog-list-holder <?php echo esc_attr( $holder_classes ); ?>" <?php echo wp_kses( $holder_data, array( 'data' ) ); ?>>
<div class="eltdf-bl-wrapper eltdf-outer-space">
<ul class="eltdf-blog-list">
<?php
if ( $query_result->have_posts() ):
while ( $query_result->have_posts() ) : $query_result->the_post();
calla_elated_get_module_template_part( 'shortcodes/blog-list/layout-collections/post', 'blog', $type, $params );
endwhile;
else:
calla_elated_get_module_template_part( 'templates/parts/no-posts', 'blog', '', $params );
endif;
wp_reset_postdata();
?>
</ul>
</div>
<?php calla_elated_get_module_template_part( 'templates/parts/pagination/' . $params['pagination_type'], 'blog', '', $params ); ?>
</div>

View File

@@ -0,0 +1,8 @@
<li class="eltdf-bl-item eltdf-item-space clearfix">
<div class="eltdf-bli-inner">
<div class="eltdf-bli-content">
<?php calla_elated_get_module_template_part( 'templates/parts/title', 'blog', '', $params ); ?>
<?php calla_elated_get_module_template_part( 'templates/parts/post-info/date', 'blog', '', $params ); ?>
</div>
</div>
</li>

View File

@@ -0,0 +1,11 @@
<li class="eltdf-bl-item eltdf-item-space clearfix">
<div class="eltdf-bli-inner">
<?php if ( $post_info_image == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/media', 'blog', '', $params );
} ?>
<div class="eltdf-bli-content">
<?php calla_elated_get_module_template_part( 'templates/parts/title', 'blog', '', $params ); ?>
<?php calla_elated_get_module_template_part( 'templates/parts/post-info/date', 'blog', '', $params ); ?>
</div>
</div>
</li>

View File

@@ -0,0 +1,41 @@
<li class="eltdf-bl-item eltdf-item-space clearfix">
<div class="eltdf-bli-inner">
<?php if ( $post_info_image == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/media', 'blog', '', $params );
} ?>
<div class="eltdf-bli-content">
<?php if ($post_info_section == 'yes') { ?>
<div class="eltdf-bli-info">
<?php
if ( $post_info_author == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/post-info/author', 'blog', '', $params );
}
if ( $post_info_date == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/post-info/date', 'blog', '', $params );
}
if ( $post_info_category == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/post-info/category', 'blog', '', $params );
}
if ( $post_info_comments == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/post-info/comments', 'blog', '', $params );
}
if ( $post_info_like == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/post-info/like', 'blog', '', $params );
}
?>
</div>
<?php } ?>
<?php calla_elated_get_module_template_part( 'templates/parts/title', 'blog', '', $params ); ?>
<div class="eltdf-bli-excerpt">
<?php calla_elated_get_module_template_part( 'templates/parts/excerpt', 'blog', '', $params ); ?>
<?php if ( $post_info_share == 'yes' ) {
calla_elated_get_module_template_part( 'templates/parts/post-info/share', 'blog', '', $params );
}
?>
<?php calla_elated_get_module_template_part( 'templates/parts/post-info/read-more', 'blog', '', $params ); ?>
</div>
</div>
</div>
</li>

View File

@@ -0,0 +1,282 @@
<?php
namespace CallaCore\CPT\Shortcodes\BlogSlider;
use CallaCore\Lib;
class BlogSlider implements Lib\ShortcodeInterface {
private $base;
function __construct() {
$this->base = 'eltdf_blog_slider';
add_action('vc_before_init', array($this,'vcMap'));
//Category filter
add_filter( 'vc_autocomplete_eltdf_blog_slider_category_callback', array( &$this, 'blogListCategoryAutocompleteSuggester', ), 10, 1 ); // Get suggestion(find). Must return an array
//Category render
add_filter( 'vc_autocomplete_eltdf_blog_slider_category_render', array( &$this, 'blogListCategoryAutocompleteRender', ), 10, 1 ); // Get suggestion(find). Must return an array
}
public function getBase() {
return $this->base;
}
public function vcMap() {
vc_map(
array(
'name' => esc_html__( 'Elated Blog Slider', 'calla' ),
'base' => $this->base,
'icon' => 'icon-wpb-blog-slider extended-custom-icon',
'category' => esc_html__( 'by ELATED', 'calla' ),
'allowed_container_element' => 'vc_row',
'params' => array(
array(
'type' => 'dropdown',
'param_name' => 'slider_type',
'heading' => esc_html__( 'Type', 'calla' ),
'value' => array(
esc_html__( 'Slider', 'calla' ) => 'slider',
esc_html__( 'Carousel', 'calla' ) => 'carousel',
esc_html__( 'Carousel Centered', 'calla' ) => 'carousel-centered'
),
'save_always' => true
),
array(
'type' => 'textfield',
'param_name' => 'number_of_posts',
'heading' => esc_html__( 'Number of Posts', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'orderby',
'heading' => esc_html__( 'Order By', 'calla' ),
'value' => array_flip( calla_elated_get_query_order_by_array() ),
'save_always' => true
),
array(
'type' => 'dropdown',
'param_name' => 'order',
'heading' => esc_html__( 'Order', 'calla' ),
'value' => array_flip( calla_elated_get_query_order_array() ),
'save_always' => true
),
array(
'type' => 'autocomplete',
'param_name' => 'category',
'heading' => esc_html__( 'Category', 'calla' ),
'description' => esc_html__( 'Enter one category slug (leave empty for showing all categories)', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'image_size',
'heading' => esc_html__( 'Image Size', 'calla' ),
'value' => array(
esc_html__( 'Original', 'calla' ) => 'full',
esc_html__( 'Square', 'calla' ) => 'calla_elated_square',
esc_html__( 'Landscape', 'calla' ) => 'calla_elated_landscape',
esc_html__( 'Portrait', 'calla' ) => 'calla_elated_portrait',
esc_html__( 'Thumbnail', 'calla' ) => 'thumbnail',
esc_html__( 'Medium', 'calla' ) => 'medium',
esc_html__( 'Large', 'calla' ) => 'large'
),
'save_always' => true
),
array(
'type' => 'dropdown',
'param_name' => 'title_tag',
'heading' => esc_html__( 'Title Tag', 'calla' ),
'value' => array_flip( calla_elated_get_title_tag( true ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'title_transform',
'heading' => esc_html__( 'Title Text Transform', 'calla' ),
'value' => array_flip( calla_elated_get_text_transform_array( true ) ),
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_author',
'heading' => esc_html__( 'Enable Post Info Author', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'save_always' => true,
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_date',
'heading' => esc_html__( 'Enable Post Info Date', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'save_always' => true,
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_category',
'heading' => esc_html__( 'Enable Post Info Category', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false, true ) ),
'save_always' => true,
'group' => esc_html__( 'Post Info', 'calla' )
),
array(
'type' => 'dropdown',
'param_name' => 'post_info_comments',
'heading' => esc_html__( 'Enable Post Info Comments', 'calla' ),
'value' => array_flip( calla_elated_get_yes_no_select_array( false ) ),
'save_always' => true,
'group' => esc_html__( 'Post Info', 'calla' )
)
)
)
);
}
public function render( $atts, $content = null ) {
$default_atts = array(
'slider_type' => 'slider',
'number_of_posts' => '-1',
'orderby' => 'title',
'order' => 'ASC',
'category' => '',
'image_size' => 'full',
'title_tag' => 'h2',
'title_transform' => '',
'post_info_author' => '',
'post_info_date' => '',
'post_info_category' => '',
'post_info_comments' => ''
);
$params = shortcode_atts( $default_atts, $atts );
$queryArray = $this->generateBlogQueryArray( $params );
$query_result = new \WP_Query( $queryArray );
$params['query_result'] = $query_result;
$params['slider_type'] = ! empty( $params['slider_type'] ) ? $params['slider_type'] : $default_atts['slider_type'];
$params['slider_classes'] = $this->getSliderClasses( $params );
$params['slider_data'] = $this->getSliderData( $params );
ob_start();
calla_elated_get_module_template_part( 'shortcodes/blog-slider/holder', 'blog', '', $params );
$html = ob_get_contents();
ob_end_clean();
return $html;
}
public function generateBlogQueryArray( $params ) {
$queryArray = array(
'post_status' => 'publish',
'post_type' => 'post',
'orderby' => $params['orderby'],
'order' => $params['order'],
'posts_per_page' => $params['number_of_posts'],
'post__not_in' => get_option( 'sticky_posts' )
);
if ( ! empty( $params['category'] ) ) {
$queryArray['category_name'] = $params['category'];
}
return $queryArray;
}
public function getSliderClasses( $params ) {
$holderClasses = array();
$holderClasses[] = 'eltdf-bs-' . $params['slider_type'];
return implode( ' ', $holderClasses );
}
private function getSliderData( $params ) {
$type = $params['slider_type'];
$slider_data = array();
if($type == 'carousel') {
$slider_data['data-number-of-items'] = '2';
$slider_data['data-slider-margin'] = '80';
$slider_data['data-slider-padding'] = 'yes';
$slider_data['data-enable-navigation'] = 'no';
} else if ($type == 'carousel-centered') {
$slider_data['data-number-of-items'] = '2';
$slider_data['data-slider-margin'] = '30';
$slider_data['data-enable-center'] = 'yes';
$slider_data['data-enable-navigation'] = 'yes';
$slider_data['data-enable-pagination'] = 'yes';
} else {
$slider_data['data-number-of-items'] = '1';
$slider_data['data-enable-pagination'] = 'yes';
}
return $slider_data;
}
/**
* Filter categories
*
* @param $query
*
* @return array
*/
public function blogListCategoryAutocompleteSuggester( $query ) {
global $wpdb;
$post_meta_infos = $wpdb->get_results( $wpdb->prepare( "SELECT a.slug AS slug, a.name AS category_title
FROM {$wpdb->terms} AS a
LEFT JOIN ( SELECT term_id, taxonomy FROM {$wpdb->term_taxonomy} ) AS b ON b.term_id = a.term_id
WHERE b.taxonomy = 'category' AND a.name LIKE '%%%s%%'", stripslashes( $query ) ), ARRAY_A );
$results = array();
if ( is_array( $post_meta_infos ) && ! empty( $post_meta_infos ) ) {
foreach ( $post_meta_infos as $value ) {
$data = array();
$data['value'] = $value['slug'];
$data['label'] = ( ( strlen( $value['category_title'] ) > 0 ) ? esc_html__( 'Category', 'calla' ) . ': ' . $value['category_title'] : '' );
$results[] = $data;
}
}
return $results;
}
/**
* Find categories by slug
* @since 4.4
*
* @param $query
*
* @return bool|array
*/
public function blogListCategoryAutocompleteRender( $query ) {
$query = trim( $query['value'] ); // get value from requested
if ( ! empty( $query ) ) {
// get category
$category = get_term_by( 'slug', $query, 'category' );
if ( is_object( $category ) ) {
$category_slug = $category->slug;
$category_title = $category->name;
$category_title_display = '';
if ( ! empty( $category_title ) ) {
$category_title_display = esc_html__( 'Category', 'calla' ) . ': ' . $category_title;
}
$data = array();
$data['value'] = $category_slug;
$data['label'] = $category_title_display;
return ! empty( $data ) ? $data : false;
}
return false;
}
return false;
}
}

View File

@@ -0,0 +1,17 @@
<div class="eltdf-blog-slider-holder <?php echo esc_attr( $slider_classes ); ?>">
<ul class="eltdf-blog-slider eltdf-owl-slider" <?php echo calla_elated_get_inline_attrs( $slider_data ); ?>>
<?php
if ( $query_result->have_posts() ):
while ( $query_result->have_posts() ) : $query_result->the_post();
calla_elated_get_module_template_part( 'shortcodes/blog-slider/layout-collections/' . $slider_type, 'blog', '', $params );
endwhile;
else: ?>
<div class="eltdf-blog-slider-message">
<p><?php esc_html_e( 'No posts were found.', 'calla' ); ?></p>
</div>
<?php endif;
wp_reset_postdata();
?>
</ul>
</div>

View File

@@ -0,0 +1,37 @@
<li class="eltdf-blog-slider-item">
<div class="eltdf-blog-slider-item-inner">
<div class="eltdf-item-image">
<a itemprop="url" href="<?php echo get_permalink(); ?>">
<?php echo get_the_post_thumbnail(get_the_ID(), $image_size); ?>
</a>
</div>
<div class="eltdf-item-text-wrapper">
<div class="eltdf-item-text-holder">
<div class="eltdf-item-text-holder-inner">
<?php if($post_info_date == 'yes' || $post_info_category == 'yes' || $post_info_author == 'yes' || $post_info_comments == 'yes'){ ?>
<div class="eltdf-item-info-section">
<?php
if ($post_info_date == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/date', 'blog', '', $params);
}
if ($post_info_category == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/category', 'blog', '', $params);
}
if ($post_info_author == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/author', 'blog', '', $params);
}
if ($post_info_comments == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/comments', 'blog', '', $params);
}
?>
</div>
<?php } ?>
<?php calla_elated_get_module_template_part('templates/parts/title', 'blog', '', $params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/read-more', 'blog', '', $params); ?>
</div>
</div>
</div>
</div>
</li>

View File

@@ -0,0 +1,17 @@
<li class="eltdf-blog-slider-item">
<div class="eltdf-blog-slider-item-inner">
<div class="eltdf-item-image">
<a itemprop="url" href="<?php echo get_permalink(); ?>">
<?php echo get_the_post_thumbnail(get_the_ID(), $image_size); ?>
</a>
</div>
<div class="eltdf-bli-content">
<?php calla_elated_get_module_template_part('templates/parts/title', 'blog', '', $params); ?>
<div class="eltdf-bli-excerpt">
<?php calla_elated_get_module_template_part( 'templates/parts/excerpt', 'blog', '', $params ); ?>
<?php calla_elated_get_module_template_part( 'templates/parts/post-info/read-more', 'blog', '', $params ); ?>
</div>
</div>
</div>
</li>

View File

@@ -0,0 +1,37 @@
<li class="eltdf-blog-slider-item">
<div class="eltdf-blog-slider-item-inner">
<div class="eltdf-item-image">
<a itemprop="url" href="<?php echo get_permalink(); ?>">
<?php echo get_the_post_thumbnail(get_the_ID(), $image_size); ?>
</a>
</div>
<div class="eltdf-item-text-wrapper">
<div class="eltdf-item-text-holder">
<div class="eltdf-item-text-holder-inner">
<?php if($post_info_date == 'yes' || $post_info_category == 'yes' || $post_info_author == 'yes' || $post_info_comments == 'yes'){ ?>
<div class="eltdf-item-info-section">
<?php
if ($post_info_date == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/date', 'blog', '', $params);
}
if ($post_info_category == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/category', 'blog', '', $params);
}
if ($post_info_author == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/author', 'blog', '', $params);
}
if ($post_info_comments == 'yes') {
calla_elated_get_module_template_part('templates/parts/post-info/comments', 'blog', '', $params);
}
?>
</div>
<?php } ?>
<?php calla_elated_get_module_template_part('templates/parts/title', 'blog', '', $params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/read-more', 'blog', '', $params); ?>
</div>
</div>
</div>
</div>
</li>

View File

@@ -0,0 +1,45 @@
<?php
if ( ! function_exists( 'calla_elated_include_blog_shortcodes' ) ) {
function calla_elated_include_blog_shortcodes() {
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/shortcodes/blog-list/blog-list.php';
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR . '/blog/shortcodes/blog-slider/blog-slider.php';
}
if ( calla_elated_core_plugin_installed() ) {
add_action( 'calla_core_action_include_shortcodes_file', 'calla_elated_include_blog_shortcodes' );
}
}
if ( ! function_exists( 'calla_elated_add_blog_shortcodes' ) ) {
function calla_elated_add_blog_shortcodes( $shortcodes_class_name ) {
$shortcodes = array(
'CallaCore\CPT\Shortcodes\BlogList\BlogList',
'CallaCore\CPT\Shortcodes\BlogSlider\BlogSlider'
);
$shortcodes_class_name = array_merge( $shortcodes_class_name, $shortcodes );
return $shortcodes_class_name;
}
if ( calla_elated_core_plugin_installed() ) {
add_filter( 'calla_core_filter_add_vc_shortcode', 'calla_elated_add_blog_shortcodes' );
}
}
if ( ! function_exists( 'calla_elated_set_blog_list_icon_class_name_for_vc_shortcodes' ) ) {
/**
* Function that set custom icon class name for blog shortcodes to set our icon for Visual Composer shortcodes panel
*/
function calla_elated_set_blog_list_icon_class_name_for_vc_shortcodes( $shortcodes_icon_class_array ) {
$shortcodes_icon_class_array[] = '.icon-wpb-blog-list';
$shortcodes_icon_class_array[] = '.icon-wpb-blog-slider';
return $shortcodes_icon_class_array;
}
if ( calla_elated_core_plugin_installed() ) {
add_filter( 'calla_core_filter_add_vc_shortcodes_custom_icon_class', 'calla_elated_set_blog_list_icon_class_name_for_vc_shortcodes' );
}
}

View File

@@ -0,0 +1,10 @@
<div class="eltdf-grid-row <?php echo esc_attr($holder_classes); ?>">
<div <?php echo calla_elated_get_content_sidebar_class(); ?>>
<?php calla_elated_get_blog_type($blog_type); ?>
</div>
<?php if($sidebar_layout !== 'no-sidebar') { ?>
<div <?php echo calla_elated_get_sidebar_holder_class(); ?>>
<?php get_sidebar(); ?>
</div>
<?php } ?>
</div>

View File

@@ -0,0 +1,27 @@
<?php
if ( ! function_exists( 'calla_elated_register_blog_masonry_template_file' ) ) {
/**
* Function that register blog masonry template
*/
function calla_elated_register_blog_masonry_template_file( $templates ) {
$templates['blog-masonry'] = esc_html__( 'Blog: Masonry', 'calla' );
return $templates;
}
add_filter( 'calla_elated_register_blog_templates', 'calla_elated_register_blog_masonry_template_file' );
}
if ( ! function_exists( 'calla_elated_set_blog_masonry_type_global_option' ) ) {
/**
* Function that set blog list type value for global blog option map
*/
function calla_elated_set_blog_masonry_type_global_option( $options ) {
$options['masonry'] = esc_html__( 'Blog: Masonry', 'calla' );
return $options;
}
add_filter( 'calla_elated_blog_list_type_global_option', 'calla_elated_set_blog_masonry_type_global_option' );
}

View File

@@ -0,0 +1,65 @@
<?php
if ( ! function_exists( 'calla_elated_get_blog_holder_params' ) ) {
/**
* Function that generates params for holders on blog templates
*/
function calla_elated_get_blog_holder_params( $params ) {
$params_list = array();
$masonry_layout = calla_elated_get_meta_field_intersect( 'blog_masonry_layout' );
if ( $masonry_layout === 'in-grid' ) {
$params_list['holder'] = 'eltdf-container';
$params_list['inner'] = 'eltdf-container-inner clearfix';
} else {
$params_list['holder'] = 'eltdf-full-width';
$params_list['inner'] = 'eltdf-full-width-inner';
}
return $params_list;
}
add_filter( 'calla_elated_blog_holder_params', 'calla_elated_get_blog_holder_params' );
}
if ( ! function_exists( 'calla_elated_get_blog_list_classes' ) ) {
/**
* Function that generates blog list holder classes for blog list templates
*/
function calla_elated_get_blog_list_classes( $classes ) {
$list_classes = array();
$list_classes[] = 'eltdf-blog-type-masonry';
$number_of_columns = calla_elated_get_meta_field_intersect( 'blog_masonry_number_of_columns' );
if ( ! empty( $number_of_columns ) ) {
$list_classes[] = 'eltdf-blog-' . $number_of_columns . '-columns';
}
$space_between_items = calla_elated_get_meta_field_intersect( 'blog_masonry_space_between_items' );
if ( ! empty( $space_between_items ) ) {
$list_classes[] = 'eltdf-' . $space_between_items . '-space';
}
$masonry_layout = calla_elated_get_meta_field_intersect( 'blog_masonry_layout' );
$list_classes[] = 'eltdf-blog-masonry-' . $masonry_layout;
$classes = array_merge( $classes, $list_classes );
return $classes;
}
add_filter( 'calla_elated_blog_list_classes', 'calla_elated_get_blog_list_classes' );
}
if ( ! function_exists( 'calla_elated_blog_part_params' ) ) {
function calla_elated_blog_part_params( $params ) {
$part_params = array();
$part_params['title_tag'] = 'h5';
$part_params['link_tag'] = 'h5';
$part_params['quote_tag'] = 'h5';
return array_merge( $params, $part_params );
}
add_filter( 'calla_elated_blog_part_params', 'calla_elated_blog_part_params' );
}

View File

@@ -0,0 +1,17 @@
<div class="<?php echo esc_attr( $blog_classes ) ?>" <?php echo esc_attr( $blog_data_params ) ?>>
<div class="eltdf-blog-holder-inner eltdf-outer-space">
<div class="eltdf-blog-masonry-grid-sizer"></div>
<div class="eltdf-blog-masonry-grid-gutter"></div>
<?php
if ( $blog_query->have_posts() ) : while ( $blog_query->have_posts() ) : $blog_query->the_post();
calla_elated_get_post_format_html( $blog_type );
endwhile;
else:
calla_elated_get_module_template_part( 'templates/parts/no-posts', 'blog' );
endif;
wp_reset_postdata();
?>
</div>
<?php calla_elated_get_module_template_part( 'templates/parts/pagination/pagination', 'blog', '', $params ); ?>
</div>

View File

@@ -0,0 +1,17 @@
<?php
$post_classes[] = 'eltdf-item-space';
?>
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes);?>>
<div class="eltdf-post-content">
<div class="eltdf-post-text" <?php calla_elated_inline_style($post_background_image)?>>
<div class="eltdf-post-mark">
<span class="lnr lnr-link"></span>
</div>
<div class="eltdf-post-text-inner">
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/post-type/link', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,17 @@
<?php
$post_classes[] = 'eltdf-item-space';
?>
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes);?>>
<div class="eltdf-post-content">
<div class="eltdf-post-text" <?php calla_elated_inline_style($post_background_image)?>>
<div class="eltdf-post-mark">
<span class="eltdf-post-icon icon_quotations"></span>
</div>
<div class="eltdf-post-text-inner">
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/post-type/quote', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,24 @@
<?php
$post_classes[] = 'eltdf-item-space';
?>
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes); ?>>
<div class="eltdf-post-content">
<div class="eltdf-post-heading">
<?php calla_elated_get_module_template_part('templates/parts/media', 'blog', $post_format, $part_params); ?>
</div>
<div class="eltdf-post-text">
<div class="eltdf-post-text-inner">
<div class="eltdf-post-info-top">
<?php calla_elated_get_module_template_part('templates/parts/post-info/author', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/date', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/category', 'blog', '', $part_params); ?>
</div>
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/title', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/excerpt', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/read-more', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,18 @@
<?php
$eltdf_blog_type = 'masonry';
calla_elated_include_blog_helper_functions('lists', $eltdf_blog_type);
$eltdf_holder_params = calla_elated_get_holder_params_blog();
?>
<?php get_header(); ?>
<?php calla_elated_get_title(); ?>
<?php get_template_part('slider'); ?>
<?php do_action('calla_elated_before_main_content'); ?>
<div class="<?php echo esc_attr($eltdf_holder_params['holder']); ?>">
<?php do_action('calla_elated_after_container_open'); ?>
<div class="<?php echo esc_attr($eltdf_holder_params['inner']); ?>">
<?php calla_elated_get_blog($eltdf_blog_type); ?>
</div>
<?php do_action('calla_elated_before_container_close'); ?>
</div>
<?php do_action('calla_elated_blog_list_additional_tags'); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,27 @@
<?php
if ( ! function_exists( 'calla_elated_register_blog_standard_template_file' ) ) {
/**
* Function that register blog standard template
*/
function calla_elated_register_blog_standard_template_file( $templates ) {
$templates['blog-standard'] = esc_html__( 'Blog: Standard', 'calla' );
return $templates;
}
add_filter( 'calla_elated_register_blog_templates', 'calla_elated_register_blog_standard_template_file' );
}
if ( ! function_exists( 'calla_elated_set_blog_standard_type_global_option' ) ) {
/**
* Function that set blog list type value for global blog option map
*/
function calla_elated_set_blog_standard_type_global_option( $options ) {
$options['standard'] = esc_html__( 'Blog: Standard', 'calla' );
return $options;
}
add_filter( 'calla_elated_blog_list_type_global_option', 'calla_elated_set_blog_standard_type_global_option' );
}

View File

@@ -0,0 +1,45 @@
<?php
if ( ! function_exists( 'calla_elated_get_blog_holder_params' ) ) {
/**
* Function that generates params for holders on blog templates
*/
function calla_elated_get_blog_holder_params( $params ) {
$params_list = array();
$params_list['holder'] = 'eltdf-container';
$params_list['inner'] = 'eltdf-container-inner clearfix';
return $params_list;
}
add_filter( 'calla_elated_blog_holder_params', 'calla_elated_get_blog_holder_params' );
}
if ( ! function_exists( 'calla_elated_get_blog_holder_classes' ) ) {
/**
* Function that generates blog holder classes for blog page
*/
function calla_elated_get_blog_holder_classes( $classes ) {
$sidebar_classes = array();
$sidebar_classes[] = 'eltdf-grid-large-gutter';
return implode( ' ', $sidebar_classes );
}
add_filter( 'calla_elated_blog_holder_classes', 'calla_elated_get_blog_holder_classes' );
}
if ( ! function_exists( 'calla_elated_blog_part_params' ) ) {
function calla_elated_blog_part_params( $params ) {
$part_params = array();
$part_params['title_tag'] = 'h3';
$part_params['link_tag'] = 'h5';
$part_params['quote_tag'] = 'h5';
return array_merge( $params, $part_params );
}
add_filter( 'calla_elated_blog_part_params', 'calla_elated_blog_part_params' );
}

View File

@@ -0,0 +1,15 @@
<div class="<?php echo esc_attr( $blog_classes ) ?>" <?php echo esc_attr( $blog_data_params ) ?>>
<div class="eltdf-blog-holder-inner">
<?php
if ( $blog_query->have_posts() ) : while ( $blog_query->have_posts() ) : $blog_query->the_post();
calla_elated_get_post_format_html( $blog_type );
endwhile;
else:
calla_elated_get_module_template_part( 'templates/parts/no-posts', 'blog' );
endif;
wp_reset_postdata();
?>
</div>
<?php calla_elated_get_module_template_part( 'templates/parts/pagination/pagination', 'blog', '', $params ); ?>
</div>

View File

@@ -0,0 +1,14 @@
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes);?>>
<div class="eltdf-post-content">
<div class="eltdf-post-text" <?php calla_elated_inline_style($post_background_image)?>>
<div class="eltdf-post-mark">
<span class="lnr lnr-link"></span>
</div>
<div class="eltdf-post-text-inner">
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/post-type/link', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,14 @@
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes);?>>
<div class="eltdf-post-content">
<div class="eltdf-post-text" <?php calla_elated_inline_style($post_background_image)?>>
<div class="eltdf-post-mark">
<span class="eltdf-post-icon icon_quotations"></span>
</div>
<div class="eltdf-post-text-inner">
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/post-type/quote', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,22 @@
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes); ?>>
<div class="eltdf-post-content">
<div class="eltdf-post-heading">
<?php calla_elated_get_module_template_part('templates/parts/media', 'blog', $post_format, $part_params); ?>
</div>
<div class="eltdf-post-text">
<div class="eltdf-post-text-inner">
<div class="eltdf-post-info-top">
<?php calla_elated_get_module_template_part('templates/parts/post-info/author', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/date', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/category', 'blog', '', $part_params); ?>
</div>
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/title', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/excerpt', 'blog', '', $part_params); ?>
<?php do_action('calla_elated_single_link_pages'); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/read-more', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,18 @@
<?php
$eltdf_blog_type = 'standard';
calla_elated_include_blog_helper_functions('lists', $eltdf_blog_type);
$eltdf_holder_params = calla_elated_get_holder_params_blog();
?>
<?php get_header(); ?>
<?php calla_elated_get_title(); ?>
<?php get_template_part('slider'); ?>
<?php do_action('calla_elated_before_main_content'); ?>
<div class="<?php echo esc_attr($eltdf_holder_params['holder']); ?>">
<?php do_action('calla_elated_after_container_open'); ?>
<div class="<?php echo esc_attr($eltdf_holder_params['inner']); ?>">
<?php calla_elated_get_blog($eltdf_blog_type); ?>
</div>
<?php do_action('calla_elated_before_container_close'); ?>
</div>
<?php do_action('calla_elated_blog_list_additional_tags'); ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,15 @@
<?php
if(post_password_required()) {
echo get_the_password_form();
} else {
$excerpt_length = isset($params['excerpt_length']) ? $params['excerpt_length'] : '';
$excerpt = calla_elated_excerpt($excerpt_length);
if(!empty($excerpt)) { ?>
<div class="eltdf-post-excerpt-holder">
<p itemprop="description" class="eltdf-post-excerpt">
<?php echo wp_kses_post($excerpt); ?>
</p>
</div>
<?php }
} ?>

View File

@@ -0,0 +1,22 @@
<?php
$image_size = isset( $image_size ) ? $image_size : 'full';
$image_meta = get_post_meta( get_the_ID(), 'eltdf_blog_list_featured_image_meta', true );
$has_featured = ! empty( $image_meta ) || has_post_thumbnail();
$blog_list_image_id = ! empty( $image_meta ) && calla_elated_blog_item_has_link() ? calla_elated_get_attachment_id_from_url( $image_meta ) : '';
$background_image = '';
if ( ! empty( $blog_list_image_id ) ) {
$background_image_url = wp_get_attachment_image_src( $blog_list_image_id, $image_size );
if ( ! empty( $background_image_url ) ) {
$background_image = 'background-image: url( ' . esc_url( $background_image_url[0] ) . ')';
}
} else {
$background_image = 'background-image: url( ' . get_the_post_thumbnail_url( get_the_ID(), $image_size ) . ')';
}
?>
<?php if ( $has_featured ) { ?>
<div class="eltdf-post-image-background" <?php calla_elated_inline_style($background_image); ?>>
<a itemprop="url" href="<?php echo get_the_permalink(); ?>" title="<?php the_title_attribute(); ?>"></a>
</div>
<?php } ?>

View File

@@ -0,0 +1,23 @@
<?php
$image_size = isset( $image_size ) ? $image_size : 'full';
$image_meta = get_post_meta( get_the_ID(), 'eltdf_blog_list_featured_image_meta', true );
$has_featured = ! empty( $image_meta ) || has_post_thumbnail();
$blog_list_image_id = ! empty( $image_meta ) && calla_elated_blog_item_has_link() ? calla_elated_get_attachment_id_from_url( $image_meta ) : '';
?>
<?php if ( $has_featured ) { ?>
<div class="eltdf-post-image">
<?php if ( calla_elated_blog_item_has_link() ) { ?>
<a itemprop="url" href="<?php echo get_the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php } ?>
<?php if ( ! empty( $blog_list_image_id ) ) {
echo wp_get_attachment_image( $blog_list_image_id, $image_size );
} else {
the_post_thumbnail( $image_size );
} ?>
<?php if ( calla_elated_blog_item_has_link() ) { ?>
</a>
<?php } ?>
<?php do_action('calla_elated_action_blog_inside_image_tag')?>
</div>
<?php } ?>

View File

@@ -0,0 +1,4 @@
<?php
calla_elated_get_module_template_part('templates/parts/image', 'blog', '', $params);
calla_elated_get_module_template_part('templates/parts/post-type/audio', 'blog', '', $params);

View File

@@ -0,0 +1,3 @@
<?php
calla_elated_get_module_template_part('templates/parts/post-type/gallery', 'blog', '', $params);

View File

@@ -0,0 +1,81 @@
<?php
$post_format = isset( $post_format ) ? $post_format : '';
switch ( $post_format ) {
case 'standard':
echo calla_elated_icon_collections()->renderIcon( 'icon_image', 'font_elegant', array( 'icon_attributes' => array( 'class' => 'eltdf-post-image-icon' ) ) );
break;
case 'gallery':
echo calla_elated_icon_collections()->renderIcon( 'icon_images', 'font_elegant', array( 'icon_attributes' => array( 'class' => 'eltdf-post-image-icon' ) ) );
break;
case 'video':
echo calla_elated_icon_collections()->renderIcon( 'arrow_triangle-right_alt2', 'font_elegant', array( 'icon_attributes' => array( 'class' => 'eltdf-post-image-icon' ) ) );
break;
case 'audio':
echo calla_elated_icon_collections()->renderIcon( 'icon_music', 'font_elegant', array( 'icon_attributes' => array( 'class' => 'eltdf-post-image-icon' ) ) );
break;
case 'link':
echo "<svg class=\"eltdf-post-link-image eltdf-post-image-icon\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"
width=\"70.236px\" height=\"62.661px\" viewBox=\"0 0 70.236 62.661\" enable-background=\"new 0 0 70.236 62.661\" xml:space=\"preserve\">
<path fill=\"currentColor\" d=\"M40.527,27.871c0,0-0.007-0.08-0.02-0.238c-0.01,0.031,0.009,0.138,0.021,0.157
c-0.016-0.035-0.012-0.061-0.05-0.138c-0.098-0.262-0.482-0.9-1.112-1.596c-0.156-0.174-0.327-0.347-0.497-0.504l-0.121-0.111
l-0.053-0.043l-0.025-0.021l-0.012-0.011L38.65,25.36c-0.02-0.015,0.164,0.114,0.079,0.056c-0.135-0.093-0.272-0.188-0.416-0.285
c-0.267-0.163-0.77-0.396-1.34-0.52c-0.288-0.064-0.603-0.109-0.938-0.143l-0.258-0.014l-0.131-0.007l-0.063-0.004l-0.033-0.002
c0.033-0.001-0.098,0.002,0.069-0.002h-0.021c-0.218,0.006-0.437,0.011-0.659,0.017c-0.646,0.041-1.366,0.167-2.144,0.436
c-1.536,0.515-3.157,1.562-4.838,2.902c-1.67,1.348-3.53,2.909-5.311,4.484c-1.801,1.6-3.655,3.286-5.469,5.055
c-1.813,1.764-3.637,3.592-5.275,5.508c-1.663,1.916-3.19,3.904-3.861,6.011c-0.331,1.047-0.437,2.104-0.248,3.129
c0.173,0.954,0.628,1.929,1.288,2.669c0.655,0.754,1.495,1.331,2.411,1.646l0.169,0.062l0.045,0.017
c0.041,0.012-0.035-0.01-0.018-0.002l0.026,0.006l0.104,0.027l0.423,0.114c0.27,0.063,0.471,0.103,0.722,0.146
c0.506,0.071,1.01,0.127,1.515,0.119c2.021,0.018,3.961-0.553,5.645-1.287c3.387-1.52,5.792-3.67,7.268-5.258
c0.745-0.8,1.269-1.479,1.606-1.951c0.342-0.473,0.504-0.733,0.504-0.733c0.262-0.415,0.809-0.542,1.225-0.281
c0.406,0.255,0.535,0.786,0.295,1.199l-0.012,0.021c0,0-0.174,0.295-0.533,0.824c-0.355,0.53-0.905,1.29-1.688,2.182
c-1.561,1.77-4.045,4.152-7.765,5.959c-1.854,0.875-4.049,1.613-6.52,1.674c-0.615,0.023-1.244-0.021-1.879-0.094
c-0.314-0.043-0.683-0.106-0.98-0.17l-0.426-0.103l-0.104-0.024l-0.156-0.046l-0.247-0.077c-1.318-0.416-2.552-1.201-3.529-2.262
c-0.986-1.063-1.688-2.387-2.01-3.895c-0.307-1.441-0.196-2.998,0.206-4.399c0.83-2.838,2.556-5.093,4.213-7.144
c1.688-2.094,3.494-4.012,5.301-5.875c1.806-1.867,3.632-3.63,5.435-5.329c1.827-1.714,3.541-3.241,5.306-4.763
c1.767-1.496,3.686-2.885,5.839-3.698c1.058-0.402,2.185-0.663,3.313-0.752c0.222-0.013,0.44-0.024,0.657-0.037l0.468,0.005
l0.379,0.01c0.507,0.029,1.006,0.084,1.495,0.178c0.983,0.194,1.885,0.505,2.795,1.049c0.145,0.093,0.286,0.184,0.425,0.271
l0.229,0.168l0.14,0.108l0.24,0.2c0.3,0.262,0.557,0.51,0.789,0.752c0.925,0.972,1.549,1.842,1.946,2.693
c0.099,0.197,0.18,0.431,0.246,0.613c0.078,0.242,0.136,0.541,0.164,0.725c0.018,0.156,0.027,0.238,0.027,0.238
c0.133,1.173-0.71,2.232-1.885,2.365c-1.174,0.133-2.231-0.71-2.365-1.883c-0.003-0.02-0.004-0.039-0.007-0.058L40.527,27.871z\"/>
<path fill=\"#A16D8B\" d=\"M29.711,34.79c0,0,0.008,0.08,0.02,0.237c0.011-0.03-0.008-0.137-0.021-0.157
c0.016,0.035,0.012,0.063,0.05,0.141c0.099,0.262,0.483,0.898,1.113,1.595c0.155,0.172,0.327,0.347,0.497,0.505l0.121,0.11
l0.053,0.043l0.023,0.021l0.014,0.012l0.008,0.006c0.02,0.016-0.164-0.113-0.079-0.055c0.136,0.092,0.274,0.187,0.416,0.285
c0.267,0.161,0.771,0.395,1.341,0.52c0.287,0.064,0.604,0.109,0.938,0.142l0.257,0.017l0.131,0.006l0.065,0.004l0.031,0.001
c-0.031,0.001,0.1-0.001-0.068,0.003l0.02-0.001c0.218-0.005,0.438-0.011,0.659-0.015c0.646-0.041,1.368-0.17,2.144-0.437
c1.536-0.517,3.157-1.563,4.839-2.903c1.671-1.35,3.529-2.908,5.31-4.485c1.801-1.599,3.657-3.285,5.469-5.053
c1.814-1.766,3.637-3.593,5.276-5.508c1.664-1.918,3.189-3.905,3.86-6.011c0.331-1.047,0.437-2.104,0.249-3.129
c-0.173-0.954-0.629-1.928-1.288-2.669c-0.655-0.754-1.495-1.33-2.41-1.647l-0.171-0.061l-0.042-0.016
c-0.043-0.012,0.032,0.008,0.016,0.003l-0.03-0.009l-0.104-0.028L57.993,6.14c-0.27-0.062-0.471-0.101-0.723-0.145
c-0.504-0.072-1.01-0.126-1.515-0.12c-2.021-0.017-3.961,0.553-5.645,1.289c-3.386,1.518-5.792,3.668-7.268,5.255
c-0.745,0.801-1.268,1.481-1.606,1.954c-0.341,0.472-0.504,0.733-0.504,0.733c-0.261,0.415-0.809,0.541-1.224,0.281
c-0.407-0.255-0.536-0.786-0.296-1.199l0.013-0.021c0,0,0.174-0.295,0.532-0.825c0.356-0.53,0.906-1.289,1.687-2.18
c1.563-1.77,4.047-4.153,7.766-5.96c1.855-0.875,4.049-1.614,6.521-1.673c0.614-0.024,1.243,0.02,1.877,0.093
c0.314,0.043,0.684,0.107,0.98,0.171l0.426,0.101l0.106,0.026l0.156,0.044l0.245,0.078c1.317,0.416,2.554,1.2,3.529,2.26
c0.987,1.063,1.688,2.387,2.01,3.895c0.308,1.442,0.196,2.998-0.206,4.399c-0.83,2.837-2.556,5.091-4.213,7.144
c-1.688,2.093-3.494,4.01-5.301,5.875c-1.804,1.866-3.632,3.631-5.434,5.327c-1.828,1.717-3.541,3.241-5.306,4.764
c-1.768,1.496-3.687,2.885-5.839,3.697c-1.059,0.403-2.185,0.663-3.313,0.754c-0.223,0.012-0.441,0.023-0.658,0.035l-0.467-0.003
l-0.38-0.011c-0.506-0.03-1.005-0.084-1.493-0.18c-0.984-0.192-1.887-0.504-2.798-1.049c-0.144-0.093-0.284-0.183-0.424-0.271
l-0.229-0.167l-0.14-0.108l-0.239-0.2c-0.3-0.262-0.557-0.51-0.789-0.752c-0.926-0.972-1.548-1.842-1.947-2.693
c-0.099-0.196-0.18-0.43-0.246-0.612c-0.078-0.242-0.136-0.541-0.163-0.726c-0.019-0.156-0.027-0.236-0.027-0.236
c-0.134-1.174,0.711-2.232,1.885-2.367c1.173-0.133,2.231,0.711,2.365,1.885c0.002,0.019,0.004,0.037,0.006,0.057L29.711,34.79z\"/>
</svg>";
break;
case 'quote':
echo "<svg class=\"eltdf-post-quote-image eltdf-post-image-icon\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"
width=\"71.961px\" height=\"54.476px\" viewBox=\"3.518 5.309 71.961 54.476\" enable-background=\"new 3.518 5.309 71.961 54.476\"
xml:space=\"preserve\">
<g>
<path fill=\"currentColor\" d=\"M38.748,22.758c0,8.805-3.051,16.154-9.149,22.052c-6.104,5.9-13.153,10.151-21.15,12.75
c-0.802,0.401-1.5,0.6-2.1,0.6c-0.601,0-0.9-0.496-0.9-1.5c0-0.998,0.797-1.8,2.4-2.4c6-1.995,11.1-5.25,15.3-9.75
s6.699-9.945,7.5-16.35c-2.603,2.002-5.503,3-8.7,3c-3.202,0-5.803-1.199-7.8-3.6c-2.001-2.4-2.7-5.297-2.101-8.7
c0.398-3.398,2.049-6.3,4.95-8.7c2.897-2.4,6.197-3.6,9.9-3.6c3.699,0,6.6,1.604,8.7,4.8
C37.698,14.561,38.748,18.361,38.748,22.758z M74.448,22.758c0,8.805-3.052,16.154-9.15,22.052
c-6.104,5.9-13.152,10.151-21.149,12.75c-0.801,0.401-1.5,0.6-2.101,0.6c-0.6,0-0.951-0.496-1.05-1.5
c-0.103-0.998,0.75-1.8,2.55-2.4c6-1.995,11.101-5.25,15.301-9.75c4.199-4.5,6.697-9.945,7.5-16.35c-2.603,2.002-5.503,3-8.7,3
c-3.201,0-5.803-1.199-7.8-3.6c-2.001-2.4-2.7-5.297-2.101-8.7c0.398-3.398,2.048-6.3,4.95-8.7c2.897-2.4,6.197-3.6,9.9-3.6
c3.697,0,6.6,1.604,8.699,4.8C73.398,14.561,74.448,18.361,74.448,22.758z\"/>
</g>
</svg>";
break;
}

View File

@@ -0,0 +1,3 @@
<?php
calla_elated_get_module_template_part('templates/parts/post-type/video', 'blog', '', $params);

View File

@@ -0,0 +1,3 @@
<?php
calla_elated_get_module_template_part('templates/parts/image', 'blog', '', $params);

View File

@@ -0,0 +1 @@
<p class="eltdf-blog-no-posts"><?php esc_html_e('Sorry, no posts matched your criteria.', 'calla'); ?></p>

View File

@@ -0,0 +1,7 @@
<?php if($max_num_pages > 1) { ?>
<div class="eltdf-blog-pag-loading">
<div class="eltdf-blog-pag-bounce1"></div>
<div class="eltdf-blog-pag-bounce2"></div>
<div class="eltdf-blog-pag-bounce3"></div>
</div>
<?php }

View File

@@ -0,0 +1,17 @@
<?php if($max_num_pages > 1) { ?>
<div class="eltdf-blog-pag-loading">
<div class="eltdf-blog-pag-bounce1"></div>
<div class="eltdf-blog-pag-bounce2"></div>
<div class="eltdf-blog-pag-bounce3"></div>
</div>
<div class="eltdf-blog-pag-load-more">
<?php
$button_params = array(
'link' => 'javascript: void(0)',
'text' => esc_html__( 'Load More', 'calla' )
);
echo calla_elated_return_button_html( $button_params );
?>
</div>
<?php }

View File

@@ -0,0 +1,6 @@
<?php
$pagination_type = calla_elated_get_meta_field_intersect('blog_pagination_type');
if(!empty($pagination_type) && !empty($params)) {
calla_elated_get_module_template_part('templates/parts/pagination/'.$pagination_type, 'blog', '', $params);
}

View File

@@ -0,0 +1,35 @@
<?php if($max_num_pages > 1) { ?>
<div class="eltdf-blog-pag-loading">
<div class="eltdf-blog-pag-bounce1"></div>
<div class="eltdf-blog-pag-bounce2"></div>
<div class="eltdf-blog-pag-bounce3"></div>
</div>
<?php
$number_of_pages = $max_num_pages;
$current_page = $paged;
if($number_of_pages > 1){ ?>
<div class="eltdf-bl-standard-pagination">
<ul>
<li class="eltdf-bl-pag-prev">
<a href="#" data-paged="1"><span class="eltdf-icon-linear-icons lnr lnr-chevron-left"></span></a>
</li>
<?php for ($i=1; $i <= $number_of_pages; $i++) { ?>
<?php
$active_class = '';
if($current_page == $i) {
$active_class = 'eltdf-bl-pag-active';
}
?>
<li class="eltdf-bl-pag-number <?php echo esc_attr($active_class); ?>">
<a href="#" data-paged="<?php echo esc_attr($i); ?>"><?php echo esc_html($i); ?></a>
</li>
<?php } ?>
<li class="eltdf-bl-pag-next">
<a href="#" data-paged="2"><span class="eltdf-icon-linear-icons lnr lnr-chevron-right"></span></a>
</li>
</ul>
</div>
<?php }
?>
<?php }

View File

@@ -0,0 +1,61 @@
<?php
if($max_num_pages > 1) {
$number_of_pages = $max_num_pages;
$current_page = $paged;
$range = 3;
?>
<div class="eltdf-blog-pagination">
<ul>
<?php if($current_page > 2 && $current_page > $range && $range < $number_of_pages) { ?>
<li class="eltdf-pag-first">
<a itemprop="url" href="<?php echo esc_url(get_pagenum_link(1)); ?>">
<span class="eltdf-icon-linear-icons lnr lnr-chevron-left"></span>
<span class="eltdf-icon-linear-icons lnr lnr-chevron-left"></span>
</a>
</li>
<?php } ?>
<?php if ($current_page > 1) { ?>
<li class="eltdf-pag-prev">
<a itemprop="url" href="<?php echo esc_url(get_pagenum_link($current_page - 1)); ?>">
<span class="eltdf-icon-linear-icons lnr lnr-chevron-left"></span>
</a>
</li>
<?php } ?>
<?php for ($i=1; $i <= $number_of_pages; $i++) { ?>
<?php if (!($i >= $current_page + $range+1 || $i <= $current_page - $range-1) || $number_of_pages <= $range ) { ?>
<?php if($current_page == $i) { ?>
<li class="eltdf-pag-number">
<a class="eltdf-pag-active" href="#"><?php echo esc_attr($i); ?></a>
</li>
<?php } else { ?>
<li class="eltdf-pag-number">
<a itemprop="url" class="eltdf-pag-inactive" href="<?php echo get_pagenum_link($i); ?>"><?php echo esc_attr($i); ?></a>
</li>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if ($current_page < $number_of_pages) { ?>
<li class="eltdf-pag-next">
<a itemprop="url" href="<?php echo esc_url(get_pagenum_link($current_page + 1)); ?>">
<span class="eltdf-icon-linear-icons lnr lnr-chevron-right"></span>
</a>
</li>
<?php } ?>
<?php if ($current_page + 1 < $number_of_pages && $current_page + $range-1 < $number_of_pages && $range < $number_of_pages) { ?>
<li class="eltdf-pag-last">
<a itemprop="url" href="<?php echo esc_url(get_pagenum_link($number_of_pages)); ?>">
<span class="eltdf-icon-linear-icons lnr lnr-chevron-right"></span>
<span class="eltdf-icon-linear-icons lnr lnr-chevron-right"></span>
</a>
</li>
<?php } ?>
</ul>
</div>
<div class="eltdf-blog-pagination-wp">
<?php echo get_the_posts_pagination(); ?>
</div>
<?php
}

View File

@@ -0,0 +1,5 @@
<div class="eltdf-post-info-author">
<a itemprop="author" class="eltdf-post-info-author-link" href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) )); ?>">
<?php the_author_meta('display_name'); ?>
</a>
</div>

View File

@@ -0,0 +1,3 @@
<div class="eltdf-post-info-category">
<?php the_category(', '); ?>
</div>

View File

@@ -0,0 +1,8 @@
<?php if(comments_open()) { ?>
<div class="eltdf-post-info-comments-holder">
<a itemprop="url" class="eltdf-post-info-comments" href="<?php comments_link(); ?>" target="_self">
<span class="lnr lnr-bubble"></span>
<?php comments_number(' 0', ' 1', ' %'); ?>
</a>
</div>
<?php } ?>

View File

@@ -0,0 +1,16 @@
<?php
$month = get_the_time('m');
$year = get_the_time('Y');
$title = get_the_title();
?>
<div itemprop="dateCreated" class="eltdf-post-info-date entry-date published updated">
<?php if(empty($title) && calla_elated_blog_item_has_link()) { ?>
<a itemprop="url" href="<?php the_permalink() ?>">
<?php } else { ?>
<a itemprop="url" href="<?php echo get_month_link($year, $month); ?>">
<?php } ?>
<?php the_time(get_option('date_format')); ?>
</a>
<meta itemprop="interactionCount" content="UserComments: <?php echo get_comments_number(calla_elated_get_page_id()); ?>"/>
</div>

View File

@@ -0,0 +1,5 @@
<?php if(calla_elated_core_plugin_installed()) { ?>
<div class="eltdf-blog-like">
<?php if( function_exists('calla_elated_get_like') ) calla_elated_get_like(); ?>
</div>
<?php } ?>

View File

@@ -0,0 +1,14 @@
<?php if ( ! calla_elated_post_has_read_more() && ! post_password_required() ) { ?>
<div class="eltdf-post-read-more-button">
<?php
$button_params = array(
'type' => 'simple',
'link' => get_the_permalink(),
'text' => esc_html__( 'Przeczytaj całość', 'calla' ),
'custom_class' => 'eltdf-blog-list-button'
);
echo calla_elated_return_button_html( $button_params );
?>
</div>
<?php } ?>

View File

@@ -0,0 +1,8 @@
<?php
$share_type = isset($share_type) ? $share_type : 'list';
?>
<?php if ( calla_elated_core_plugin_installed() && calla_elated_options()->getOptionValue( 'enable_social_share' ) === 'yes' && calla_elated_options()->getOptionValue( 'enable_social_share_on_post' ) === 'yes' ) { ?>
<div class="eltdf-blog-share">
<?php echo calla_elated_get_social_share_html(array('type' => $share_type)); ?>
</div>
<?php } ?>

View File

@@ -0,0 +1,10 @@
<?php
$tags = get_the_tags();
?>
<?php if($tags) { ?>
<div class="eltdf-tags-holder">
<div class="eltdf-tags">
<?php the_tags('', ', ', ''); ?>
</div>
</div>
<?php } ?>

View File

@@ -0,0 +1,16 @@
<?php
$audio_type = get_post_meta( get_the_ID(), "eltdf_audio_type_meta", true );
$has_audio_link = get_post_meta(get_the_ID(), "eltdf_post_audio_custom_meta", true) !== '' || get_post_meta(get_the_ID(), "eltdf_post_audio_link_meta", true) !== '';
?>
<?php if($has_audio_link) { ?>
<div class="eltdf-blog-audio-holder">
<?php if ( $audio_type == 'social_networks' ) {
$audiolink = get_post_meta( get_the_ID(), "eltdf_post_audio_link_meta", true );
echo wp_oembed_get( esc_url($audiolink) );
} else if ( $audio_type == 'self' ) { ?>
<audio class="eltdf-blog-audio" src="<?php echo esc_url(get_post_meta(get_the_ID(), "eltdf_post_audio_custom_meta", true)) ?>" controls="controls">
<?php esc_html_e("Your browser don't support audio player", "calla"); ?>
</audio>
<?php } ?>
</div>
<?php } ?>

View File

@@ -0,0 +1,28 @@
<?php
$image_size = isset( $image_size ) ? $image_size : 'full';
$image_gallery_val = get_post_meta( get_the_ID(), 'eltdf_post_gallery_images_meta', true );
?>
<?php if ( ! empty( $image_gallery_val ) ) { ?>
<div class="eltdf-post-image">
<div class="eltdf-blog-gallery eltdf-owl-slider">
<?php
$image_gallery_array = explode( ',', $image_gallery_val );
if ( isset( $image_gallery_array ) && count( $image_gallery_array ) > 0 ):
foreach ( $image_gallery_array as $gimg_id ): ?>
<div>
<?php if ( calla_elated_blog_item_has_link() ) { ?>
<a itemprop="url" href="<?php the_permalink(); ?>">
<?php } ?>
<?php echo wp_get_attachment_image( $gimg_id, $image_size ); ?>
<?php if ( calla_elated_blog_item_has_link() ) { ?>
</a>
<?php } ?>
</div>
<?php endforeach;
endif;
?>
</div>
</div>
<?php } ?>

View File

@@ -0,0 +1,26 @@
<?php
$title_tag = isset($link_tag) ? $link_tag : 'h5';
$post_link_meta = get_post_meta(get_the_ID(), "eltdf_post_link_link_meta", true );
if(calla_elated_get_blog_module() == 'list') {
$post_link = get_the_permalink();
} else {
if(!empty($post_link_meta)) {
$post_link = esc_html($post_link_meta);
}
}
?>
<div class="eltdf-post-link-holder">
<div class="eltdf-post-link-holder-inner">
<<?php echo esc_attr($title_tag);?> itemprop="name" class="eltdf-link-title eltdf-post-title">
<?php if(isset($post_link) && $post_link != '') { ?>
<a itemprop="url" href="<?php echo esc_url($post_link); ?>" title="<?php the_title_attribute(); ?>" target="_blank">
<?php } ?>
<?php echo get_the_title(); ?>
<?php if(isset($post_link) && $post_link != '') { ?>
</a>
<?php } ?>
</<?php echo esc_attr($title_tag);?>>
</div>
</div>

View File

@@ -0,0 +1,27 @@
<?php
$title_tag = isset($quote_tag) ? $quote_tag : 'h5';
$quote_text_meta = get_post_meta(get_the_ID(), "eltdf_post_quote_text_meta", true );
$post_title = !empty($quote_text_meta) ? $quote_text_meta : get_the_title();
$post_author = get_post_meta(get_the_ID(), "eltdf_post_quote_author_meta", true );
?>
<div class="eltdf-post-quote-holder">
<div class="eltdf-post-quote-holder-inner">
<<?php echo esc_attr($title_tag);?> itemprop="name" class="eltdf-quote-title eltdf-post-title">
<?php if(calla_elated_blog_item_has_link()) { ?>
<a itemprop="url" href="<?php echo get_the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php } ?>
<?php echo esc_html($post_title); ?>
<?php if(calla_elated_blog_item_has_link()) { ?>
</a>
<?php } ?>
</<?php echo esc_attr($title_tag);?>>
<?php if($post_author != '') { ?>
<span class="eltdf-quote-author">
<?php echo esc_html($post_author); ?>
</span>
<?php } ?>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<?php
$video_type = get_post_meta( get_the_ID(), "eltdf_video_type_meta", true );
$has_video_link = get_post_meta(get_the_ID(), "eltdf_post_video_custom_meta", true) !== '' || get_post_meta(get_the_ID(), "eltdf_post_video_link_meta", true) !== '';
?>
<?php if($has_video_link) { ?>
<div class="eltdf-blog-video-holder">
<?php
if ( $video_type == 'social_networks' ) {
$videolink = get_post_meta( get_the_ID(), "eltdf_post_video_link_meta", true );
echo wp_oembed_get( esc_url($videolink) );
} else if ( $video_type == 'self' ) {
$videolink = get_post_meta(get_the_ID(), "eltdf_post_video_custom_meta", true);
$videoimage = get_post_meta(get_the_ID(), "eltdf_post_video_image_meta", true);
$flashmedia = get_template_directory_uri() . '/assets/js/flashmediaelement.swf';
?>
<div class="eltdf-self-hosted-video-holder">
<div class="eltdf-video-wrap">
<video class="eltdf-self-hosted-video" poster="<?php echo esc_url( $videoimage ); ?>" preload="auto">
<?php if ( ! empty( $videolink ) ) { ?> <source type="video/mp4" src="<?php echo esc_url( $videolink ); ?>"> <?php } ?>
<object width="320" height="240" type="application/x-shockwave-flash" data="<?php echo esc_url( $flashmedia ); ?>">
<param name="movie" value="<?php echo esc_url( $flashmedia ); ?>"/>
<param name="flashvars" value="controls=true&file=<?php echo esc_url( $videolink ); ?>" />
<img itemprop="image" src="<?php echo esc_url( $videoimage ); ?>" width="1920" height="800" title="<?php esc_attr_e( 'No video playback capabilities', 'calla' ); ?>" alt="<?php esc_attr_e( 'Video Thumb', 'calla' ); ?>"/>
</object>
</video>
</div>
</div>
<?php } ?>
</div>
<?php } ?>

View File

@@ -0,0 +1,54 @@
<?php
$author_info_box = esc_attr( calla_elated_options()->getOptionValue( 'blog_author_info' ) );
$author_info_email = esc_attr( calla_elated_options()->getOptionValue( 'blog_author_info_email' ) );
$author_id = esc_attr( get_the_author_meta( 'ID' ) );
$social_networks = calla_elated_core_plugin_installed() ? calla_elated_get_user_custom_fields() : false;
$display_author_social = calla_elated_options()->getOptionValue( 'blog_single_author_social' ) === 'no' ? false : true;
?>
<?php if ( $author_info_box === 'yes' && get_the_author_meta( 'description' ) !== "" ) { ?>
<div class="eltdf-author-description">
<div class="eltdf-author-description-inner">
<div class="eltdf-author-description-content">
<div class="eltdf-author-description-image">
<a itemprop="url" href="<?php echo esc_url( get_author_posts_url( $author_id ) ); ?>" title="<?php the_title_attribute(); ?>" target="_self">
<?php echo calla_elated_kses_img( get_avatar( get_the_author_meta( 'ID' ), 100 ) ); ?>
</a>
</div>
<div class="eltdf-author-description-text-holder">
<h4 class="eltdf-author-name vcard author">
<a itemprop="url" href="<?php echo esc_url( get_author_posts_url( $author_id ) ); ?>" title="<?php the_title_attribute(); ?>" target="_self">
<span class="fn">
<?php
if ( get_the_author_meta( 'first_name' ) != "" || get_the_author_meta( 'last_name' ) != "" ) {
echo esc_html( get_the_author_meta( 'first_name' ) ) . " " . esc_html( get_the_author_meta( 'last_name' ) );
} else {
echo esc_html( get_the_author_meta( 'display_name' ) );
}
?>
</span>
</a>
</h4>
<?php if ( get_the_author_meta( 'description' ) != "" ) { ?>
<div class="eltdf-author-text">
<div itemprop="description"><?php echo wp_kses_post(get_the_author_meta( 'description' )); ?></div>
</div>
<?php } ?>
<?php if ( $author_info_email === 'yes' && is_email( get_the_author_meta( 'email' ) ) ) { ?>
<p itemprop="email" class="eltdf-author-email"><?php echo sanitize_email( get_the_author_meta( 'email' ) ); ?></p>
<?php } ?>
<?php if ( $display_author_social ) { ?>
<?php if ( is_array( $social_networks ) && count( $social_networks ) ) { ?>
<div class="eltdf-author-social-icons clearfix">
<?php foreach ( $social_networks as $network ) { ?>
<a itemprop="url" href="<?php echo esc_url( $network['link'] ) ?>" target="_blank">
<?php echo calla_elated_icon_collections()->renderIcon( $network['class'], 'font_elegant' ); ?>
</a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>
<?php } ?>

View File

@@ -0,0 +1,4 @@
<?php
if(calla_elated_show_comments()){
comments_template('', true);
}

View File

@@ -0,0 +1,42 @@
<?php
$show_related = calla_elated_options()->getOptionValue('blog_single_related_posts') == 'yes' ? true : false;
$related_post_number = calla_elated_sidebar_layout() === 'no-sidebar' ? 4 : 3;
$related_posts_options = array(
'posts_per_page' => $related_post_number
);
$related_posts = calla_elated_get_blog_related_post_type(get_the_ID(), $related_posts_options);
$related_posts_image_size = isset($related_posts_image_size) ? $related_posts_image_size : 'full';
?>
<?php if($show_related) { ?>
<div class="eltdf-related-posts-holder clearfix">
<div class="eltdf-related-posts-holder-inner">
<?php if ( $related_posts && $related_posts->have_posts() ) : ?>
<div class="eltdf-related-posts-title">
<h3>Inne wpisy</h3>
</div>
<div class="eltdf-related-posts-inner clearfix">
<?php while ( $related_posts->have_posts() ) : $related_posts->the_post(); ?>
<div class="eltdf-related-post">
<div class="eltdf-related-post-inner">
<?php if (has_post_thumbnail()) { ?>
<div class="eltdf-related-post-image">
<a itemprop="url" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail($related_posts_image_size); ?>
</a>
</div>
<?php } ?>
<h5 itemprop="name" class="entry-title eltdf-post-title"><a itemprop="url" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
<div class="eltdf-post-info">
<?php calla_elated_get_module_template_part('templates/parts/post-info/author', 'blog', '', $params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/date', 'blog', '', $params); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php endif;
wp_reset_postdata();
?>
</div>
</div>
<?php } ?>

View File

@@ -0,0 +1,49 @@
<?php
$blog_single_navigation = calla_elated_options()->getOptionValue('blog_single_navigation') === 'no' ? false : true;
$blog_navigation_through_same_category = calla_elated_options()->getOptionValue('blog_navigation_through_same_category') === 'no' ? false : true;
?>
<?php if($blog_single_navigation){ ?>
<div class="eltdf-blog-single-navigation">
<div class="eltdf-blog-single-navigation-inner clearfix">
<?php
/* Single navigation section - SETTING PARAMS */
$post_navigation = array(
'prev' => array(
'mark' => '<span class="eltdf-icon-linear-icons lnr lnr-chevron-left"></span>',
'label' => '<span class="eltdf-blog-single-nav-label">'.esc_html__('previous', 'calla').'</span>'
),
'next' => array(
'mark' => '<span class="eltdf-icon-linear-icons lnr lnr-chevron-right"></span>',
'label' => '<span class="eltdf-blog-single-nav-label">'.esc_html__('next', 'calla').'</span>'
)
);
if($blog_navigation_through_same_category){
if(get_previous_post(true) !== ""){
$post_navigation['prev']['post'] = get_previous_post(true);
}
if(get_next_post(true) !== ""){
$post_navigation['next']['post'] = get_next_post(true);
}
} else {
if(get_previous_post() !== ""){
$post_navigation['prev']['post'] = get_previous_post();
}
if(get_next_post() !== ""){
$post_navigation['next']['post'] = get_next_post();
}
}
/* Single navigation section - RENDERING */
foreach (array('prev', 'next') as $nav_type) {
if (isset($post_navigation[$nav_type]['post'])) { ?>
<a itemprop="url" class="eltdf-blog-single-<?php echo esc_attr($nav_type); ?>" href="<?php echo get_permalink($post_navigation[$nav_type]['post']->ID); ?>">
<?php echo wp_kses($post_navigation[$nav_type]['mark'], array('span' => array('class' => true))); ?>
<?php echo wp_kses($post_navigation[$nav_type]['label'], array('span' => array('class' => true))); ?>
</a>
<?php }
}
?>
</div>
</div>
<?php } ?>

View File

@@ -0,0 +1,14 @@
<?php
$title_tag = isset( $title_tag ) ? $title_tag : 'h3';
$title_styles = isset( $this_object ) && isset( $params ) ? $this_object->getTitleStyles( $params ) : array();
?>
<<?php echo esc_attr($title_tag);?> itemprop="name" class="entry-title eltdf-post-title" <?php calla_elated_inline_style($title_styles); ?>>
<?php if(calla_elated_blog_item_has_link()) { ?>
<a itemprop="url" href="<?php echo get_the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php } ?>
<?php the_title(); ?>
<?php if(calla_elated_blog_item_has_link()) { ?>
</a>
<?php } ?>
</<?php echo esc_attr($title_tag);?>>

View File

@@ -0,0 +1,12 @@
<div class="eltdf-grid-row <?php echo esc_attr($holder_classes); ?>" <?php calla_elated_inline_style($blog_single_padding);?>>
<div <?php echo calla_elated_get_content_sidebar_class(); ?>>
<div class="eltdf-blog-holder eltdf-blog-single <?php echo esc_attr($blog_single_classes); ?>">
<?php calla_elated_get_blog_single_type($blog_single_type); ?>
</div>
</div>
<?php if($sidebar_layout !== 'no-sidebar') { ?>
<div <?php echo calla_elated_get_sidebar_holder_class(); ?>>
<?php get_sidebar(); ?>
</div>
<?php } ?>
</div>

View File

@@ -0,0 +1,56 @@
<?php
if( !function_exists('calla_elated_get_blog_holder_params') ) {
/**
* Function that generates params for holders on blog templates
*/
function calla_elated_get_blog_holder_params($params) {
$params_list = array();
$params_list['holder'] = 'eltdf-container';
$params_list['inner'] = 'eltdf-container-inner clearfix';
return $params_list;
}
add_filter( 'calla_elated_blog_holder_params', 'calla_elated_get_blog_holder_params' );
}
if( !function_exists('calla_elated_get_blog_single_holder_classes') ) {
/**
* Function that generates blog holder classes for single blog page
*/
function calla_elated_get_blog_single_holder_classes($classes) {
$sidebar_classes = array();
$sidebar_classes[] = 'eltdf-grid-large-gutter';
$classes = $classes . ' ' . implode(' ', $sidebar_classes);
return $classes;
}
function calla_elated_get_blog_single_holder_padding(){
$params = array();
$blog_single_padding = calla_elated_options()->getOptionValue('blog_single_grid_padding');
if(!empty($blog_single_padding)){
$params[] = "padding: ".$blog_single_padding;
}
return $params;
}
add_filter( 'calla_elated_blog_single_holder_classes', 'calla_elated_get_blog_single_holder_classes' );
}
if( !function_exists('calla_elated_blog_part_params') ) {
function calla_elated_blog_part_params($params) {
$part_params = array();
$part_params['title_tag'] = 'h2';
$part_params['link_tag'] = 'h5';
$part_params['quote_tag'] = 'h5';
return array_merge($params, $part_params);
}
add_filter( 'calla_elated_blog_part_params', 'calla_elated_blog_part_params' );
}

View File

@@ -0,0 +1,17 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="eltdf-post-content">
<div class="eltdf-post-text" <?php calla_elated_inline_style($post_background_image)?>>
<div class="eltdf-post-mark">
<span class="lnr lnr-link"></span>
</div>
<div class="eltdf-post-text-inner">
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/post-type/link', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
<div class="eltdf-post-additional-content">
<?php the_content(); ?>
</div>
</article>

View File

@@ -0,0 +1,17 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="eltdf-post-content">
<div class="eltdf-post-text" <?php calla_elated_inline_style($post_background_image)?>>
<div class="eltdf-post-text-inner">
<div class="eltdf-post-mark">
<span class="eltdf-post-icon icon_quotations"></span>
</div>
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/post-type/quote', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
<div class="eltdf-post-additional-content">
<?php the_content(); ?>
</div>
</article>

View File

@@ -0,0 +1,30 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="eltdf-post-content">
<div class="eltdf-post-heading">
<?php calla_elated_get_module_template_part('templates/parts/media', 'blog', $post_format, $part_params); ?>
</div>
<div class="eltdf-post-text">
<div class="eltdf-post-text-inner">
<div class="eltdf-post-info-top">
<?php calla_elated_get_module_template_part('templates/parts/post-info/author', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/date', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/category', 'blog', '', $part_params); ?>
<?php calla_elated_get_module_template_part('templates/parts/post-info/comments', 'blog', '', $part_params); ?>
</div>
<div class="eltdf-post-text-main">
<?php calla_elated_get_module_template_part('templates/parts/title', 'blog', '', $part_params); ?>
<?php the_content(); ?>
<?php do_action('calla_elated_single_link_pages'); ?>
</div>
<div class="eltdf-post-info-bottom clearfix">
<div class="eltdf-post-info-bottom-left">
<?php calla_elated_get_module_template_part('templates/parts/post-info/tags', 'blog', '', $part_params); ?>
</div>
<div class="eltdf-post-info-bottom-right">
<?php calla_elated_get_module_template_part('templates/parts/post-info/share', 'blog', '', $part_params); ?>
</div>
</div>
</div>
</div>
</div>
</article>

View File

@@ -0,0 +1,13 @@
<?php
calla_elated_get_single_post_format_html($blog_single_type);
do_action('calla_elated_after_article_content');
calla_elated_get_module_template_part('templates/parts/single/author-info', 'blog');
calla_elated_get_module_template_part('templates/parts/single/single-navigation', 'blog');
calla_elated_get_module_template_part('templates/parts/single/related-posts', 'blog', '', $single_info_params);
calla_elated_get_module_template_part('templates/parts/single/comments', 'blog');

View File

@@ -0,0 +1,24 @@
<?php
if ( ! function_exists('calla_elated_contact_form_map') ) {
/**
* Map Contact Form 7 shortcode
* Hooks on vc_after_init action
*/
function calla_elated_contact_form_map() {
vc_add_param('contact-form-7', array(
'type' => 'dropdown',
'heading' => esc_html__('Style', 'calla'),
'param_name' => 'html_class',
'value' => array(
esc_html__('Default', 'calla') => 'default',
esc_html__('Custom Style 1', 'calla') => 'cf7_custom_style_1',
esc_html__('Custom Style 2', 'calla') => 'cf7_custom_style_2',
esc_html__('Custom Style 3', 'calla') => 'cf7_custom_style_3'
),
'description' => esc_html__('You can style each form element individually in Elated Options > Contact Form 7', 'calla')
));
}
add_action('vc_after_init', 'calla_elated_contact_form_map');
}

View File

@@ -0,0 +1,811 @@
<?php
if ( ! function_exists( 'calla_elated_contact_form7_text_styles_1' ) ) {
/**
* Generates custom styles for Contact Form 7 elements
*/
function calla_elated_contact_form7_text_styles_1() {
$selector = array(
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-text',
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-number',
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-date',
'.cf7_custom_style_1 textarea.wpcf7-form-control.wpcf7-textarea',
'.cf7_custom_style_1 select.wpcf7-form-control.wpcf7-select',
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-quiz'
);
$styles = calla_elated_get_typography_styles( 'cf7_style_1_text' );
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_1_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_1_border_color' );
$border_opacity = 1;
if ( $border_color !== '' ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
$border_width = calla_elated_options()->getOptionValue( 'cf7_style_1_border_width' );
if ( $border_width !== '' ) {
$styles['border-width'] = calla_elated_filter_px( $border_width ) . 'px';
}
$border_radius = calla_elated_options()->getOptionValue( 'cf7_style_1_border_radius' );
if ( $border_radius !== '' ) {
$styles['border-radius'] = calla_elated_filter_px( $border_radius ) . 'px';
}
$padding_top = calla_elated_options()->getOptionValue( 'cf7_style_1_padding_top' );
if ( $padding_top !== '' ) {
$styles['padding-top'] = calla_elated_filter_px( $padding_top ) . 'px';
}
$padding_right = calla_elated_options()->getOptionValue( 'cf7_style_1_padding_right' );
if ( $padding_right !== '' ) {
$styles['padding-right'] = calla_elated_filter_px( $padding_right ) . 'px';
}
$padding_bottom = calla_elated_options()->getOptionValue( 'cf7_style_1_padding_bottom' );
if ( $padding_bottom !== '' ) {
$styles['padding-bottom'] = calla_elated_filter_px( $padding_bottom ) . 'px';
}
$padding_left = calla_elated_options()->getOptionValue( 'cf7_style_1_padding_left' );
if ( $padding_left !== '' ) {
$styles['padding-left'] = calla_elated_filter_px( $padding_left ) . 'px';
}
$margin_top = calla_elated_options()->getOptionValue( 'cf7_style_1_margin_top' );
if ( $margin_top !== '' ) {
$styles['margin-top'] = calla_elated_filter_px( $margin_top ) . 'px';
}
$margin_bottom = calla_elated_options()->getOptionValue( 'cf7_style_1_margin_bottom' );
if ( $margin_bottom !== '' ) {
$styles['margin-bottom'] = calla_elated_filter_px( $margin_bottom ) . 'px';
}
$textarea_height = calla_elated_options()->getOptionValue( 'cf7_style_1_textarea_height' );
if ( ! empty( $textarea_height ) ) {
echo calla_elated_dynamic_css( '.cf7_custom_style_1 textarea.wpcf7-form-control.wpcf7-textarea',
array( 'height' => calla_elated_filter_px( $textarea_height ) . 'px' )
);
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_text_styles_1' );
}
if ( ! function_exists( 'calla_elated_contact_form7_focus_styles_1' ) ) {
/**
* Generates custom styles for Contact Form 7 elements focus
*/
function calla_elated_contact_form7_focus_styles_1() {
$selector = array(
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-text:focus',
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-number:focus',
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-date:focus',
'.cf7_custom_style_1 textarea.wpcf7-form-control.wpcf7-textarea:focus',
'.cf7_custom_style_1 select.wpcf7-form-control.wpcf7-select:focus',
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-quiz:focus'
);
$styles = array();
$color = calla_elated_options()->getOptionValue( 'cf7_style_1_focus_text_color' );
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_1_focus_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_focus_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_1_focus_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_focus_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_focus_styles_1' );
}
if ( ! function_exists( 'calla_elated_contact_form7_label_styles_1' ) ) {
/**
* Generates custom styles for Contact Form 7 label
*/
function calla_elated_contact_form7_label_styles_1() {
$item_styles = calla_elated_get_typography_styles( 'cf7_style_1_label' );
$item_selector = array(
'.cf7_custom_style_1 p'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_label_styles_1' );
}
if ( ! function_exists( 'calla_elated_contact_form7_button_styles_1' ) ) {
/**
* Generates custom styles for Contact Form 7 button
*/
function calla_elated_contact_form7_button_styles_1() {
$selector = array(
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-submit'
);
$styles = calla_elated_get_typography_styles( 'cf7_style_1_button' );
$height = calla_elated_options()->getOptionValue( 'cf7_style_1_button_height' );
if ( $height !== '' ) {
$styles['padding-top'] = '0';
$styles['padding-bottom'] = '0';
$styles['height'] = calla_elated_filter_px( $height ) . 'px';
$styles['line-height'] = calla_elated_filter_px( $height ) . 'px';
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_1_button_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_button_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_1_button_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_button_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
$border_width = calla_elated_options()->getOptionValue( 'cf7_style_1_button_border_width' );
if ( $border_width !== '' ) {
$styles['border-width'] = calla_elated_filter_px( $border_width ) . 'px';
}
$border_radius = calla_elated_options()->getOptionValue( 'cf7_style_1_button_border_radius' );
if ( $border_radius !== '' ) {
$styles['border-radius'] = calla_elated_filter_px( $border_radius ) . 'px';
}
$padding_left_right = calla_elated_options()->getOptionValue( 'cf7_style_1_button_padding' );
if ( $padding_left_right !== '' ) {
$styles['padding-left'] = calla_elated_filter_px( $padding_left_right ) . 'px';
$styles['padding-right'] = calla_elated_filter_px( $padding_left_right ) . 'px';
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_button_styles_1' );
}
if ( ! function_exists( 'calla_elated_contact_form7_button_hover_styles_1' ) ) {
/**
* Generates custom styles for Contact Form 7 button
*/
function calla_elated_contact_form7_button_hover_styles_1() {
$selector = array(
'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-submit:not([disabled]):hover'
);
$styles = array();
$color = calla_elated_options()->getOptionValue( 'cf7_style_1_button_hover_color' );
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_1_button_hover_bckg_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_button_hover_bckg_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_1_button_hover_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_1_button_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_button_hover_styles_1' );
}
if ( ! function_exists( 'calla_elated_contact_form7_text_styles_2' ) ) {
/**
* Generates custom styles for Contact Form 7 elements
*/
function calla_elated_contact_form7_text_styles_2() {
$selector = array(
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-text',
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-number',
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-date',
'.cf7_custom_style_2 textarea.wpcf7-form-control.wpcf7-textarea',
'.cf7_custom_style_2 select.wpcf7-form-control.wpcf7-select',
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-quiz'
);
$styles = calla_elated_get_typography_styles( 'cf7_style_2_text' );
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_2_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_2_border_color' );
$border_opacity = 1;
if ( $border_color !== '' ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
$border_width = calla_elated_options()->getOptionValue( 'cf7_style_2_border_width' );
if ( $border_width !== '' ) {
$styles['border-width'] = calla_elated_filter_px( $border_width ) . 'px';
}
$border_radius = calla_elated_options()->getOptionValue( 'cf7_style_2_border_radius' );
if ( $border_radius !== '' ) {
$styles['border-radius'] = calla_elated_filter_px( $border_radius ) . 'px';
}
$padding_top = calla_elated_options()->getOptionValue( 'cf7_style_2_padding_top' );
if ( $padding_top !== '' ) {
$styles['padding-top'] = calla_elated_filter_px( $padding_top ) . 'px';
}
$padding_right = calla_elated_options()->getOptionValue( 'cf7_style_2_padding_right' );
if ( $padding_right !== '' ) {
$styles['padding-right'] = calla_elated_filter_px( $padding_right ) . 'px';
}
$padding_bottom = calla_elated_options()->getOptionValue( 'cf7_style_2_padding_bottom' );
if ( $padding_bottom !== '' ) {
$styles['padding-bottom'] = calla_elated_filter_px( $padding_bottom ) . 'px';
}
$padding_left = calla_elated_options()->getOptionValue( 'cf7_style_2_padding_left' );
if ( $padding_left !== '' ) {
$styles['padding-left'] = calla_elated_filter_px( $padding_left ) . 'px';
}
$margin_top = calla_elated_options()->getOptionValue( 'cf7_style_2_margin_top' );
if ( $margin_top !== '' ) {
$styles['margin-top'] = calla_elated_filter_px( $margin_top ) . 'px';
}
$margin_bottom = calla_elated_options()->getOptionValue( 'cf7_style_2_margin_bottom' );
if ( $margin_bottom !== '' ) {
$styles['margin-bottom'] = calla_elated_filter_px( $margin_bottom ) . 'px';
}
$textarea_height = calla_elated_options()->getOptionValue( 'cf7_style_2_textarea_height' );
if ( ! empty( $textarea_height ) ) {
echo calla_elated_dynamic_css( '.cf7_custom_style_2 textarea.wpcf7-form-control.wpcf7-textarea',
array( 'height' => calla_elated_filter_px( $textarea_height ) . 'px' )
);
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_text_styles_2' );
}
if ( ! function_exists( 'calla_elated_contact_form7_focus_styles_2' ) ) {
/**
* Generates custom styles for Contact Form 7 elements focus
*/
function calla_elated_contact_form7_focus_styles_2() {
$selector = array(
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-text:focus',
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-number:focus',
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-date:focus',
'.cf7_custom_style_2 textarea.wpcf7-form-control.wpcf7-textarea:focus',
'.cf7_custom_style_2 select.wpcf7-form-control.wpcf7-select:focus',
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-quiz:focus'
);
$styles = array();
$color = calla_elated_options()->getOptionValue( 'cf7_style_2_focus_text_color' );
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_2_focus_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_focus_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_2_focus_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_focus_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_focus_styles_2' );
}
if ( ! function_exists( 'calla_elated_contact_form7_label_styles_2' ) ) {
/**
* Generates custom styles for Contact Form 7 label
*/
function calla_elated_contact_form7_label_styles_2() {
$item_styles = calla_elated_get_typography_styles( 'cf7_style_2_label' );
$item_selector = array(
'.cf7_custom_style_2 p'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_label_styles_2' );
}
if ( ! function_exists( 'calla_elated_contact_form7_button_styles_2' ) ) {
/**
* Generates custom styles for Contact Form 7 button
*/
function calla_elated_contact_form7_button_styles_2() {
$selector = array(
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-submit'
);
$styles = calla_elated_get_typography_styles( 'cf7_style_2_button' );
$height = calla_elated_options()->getOptionValue( 'cf7_style_2_button_height' );
if ( $height !== '' ) {
$styles['padding-top'] = '0';
$styles['padding-bottom'] = '0';
$styles['height'] = calla_elated_filter_px( $height ) . 'px';
$styles['line-height'] = calla_elated_filter_px( $height ) . 'px';
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_2_button_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_button_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_2_button_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_button_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
$border_width = calla_elated_options()->getOptionValue( 'cf7_style_2_button_border_width' );
if ( $border_width !== '' ) {
$styles['border-width'] = calla_elated_filter_px( $border_width ) . 'px';
}
$border_radius = calla_elated_options()->getOptionValue( 'cf7_style_2_button_border_radius' );
if ( $border_radius !== '' ) {
$styles['border-radius'] = calla_elated_filter_px( $border_radius ) . 'px';
}
$padding_left_right = calla_elated_options()->getOptionValue( 'cf7_style_2_button_padding' );
if ( $padding_left_right !== '' ) {
$styles['padding-left'] = calla_elated_filter_px( $padding_left_right ) . 'px';
$styles['padding-right'] = calla_elated_filter_px( $padding_left_right ) . 'px';
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_button_styles_2' );
}
if ( ! function_exists( 'calla_elated_contact_form7_button_hover_styles_2' ) ) {
/**
* Generates custom styles for Contact Form 7 button
*/
function calla_elated_contact_form7_button_hover_styles_2() {
$selector = array(
'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-submit:not([disabled]):hover'
);
$styles = array();
$color = calla_elated_options()->getOptionValue( 'cf7_style_2_button_hover_color' );
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_2_button_hover_bckg_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_button_hover_bckg_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_2_button_hover_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_2_button_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_button_hover_styles_2' );
}
if ( ! function_exists( 'calla_elated_contact_form7_text_styles_3' ) ) {
/**
* Generates custom styles for Contact Form 7 elements
*/
function calla_elated_contact_form7_text_styles_3() {
$selector = array(
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-text',
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-number',
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-date',
'.cf7_custom_style_3 textarea.wpcf7-form-control.wpcf7-textarea',
'.cf7_custom_style_3 select.wpcf7-form-control.wpcf7-select',
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-quiz'
);
$styles = calla_elated_get_typography_styles( 'cf7_style_3_text' );
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_3_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_3_border_color' );
$border_opacity = 1;
if ( $border_color !== '' ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
$border_width = calla_elated_options()->getOptionValue( 'cf7_style_3_border_width' );
if ( $border_width !== '' ) {
$styles['border-width'] = calla_elated_filter_px( $border_width ) . 'px';
}
$border_radius = calla_elated_options()->getOptionValue( 'cf7_style_3_border_radius' );
if ( $border_radius !== '' ) {
$styles['border-radius'] = calla_elated_filter_px( $border_radius ) . 'px';
}
$padding_top = calla_elated_options()->getOptionValue( 'cf7_style_3_padding_top' );
if ( $padding_top !== '' ) {
$styles['padding-top'] = calla_elated_filter_px( $padding_top ) . 'px';
}
$padding_right = calla_elated_options()->getOptionValue( 'cf7_style_3_padding_right' );
if ( $padding_right !== '' ) {
$styles['padding-right'] = calla_elated_filter_px( $padding_right ) . 'px';
}
$padding_bottom = calla_elated_options()->getOptionValue( 'cf7_style_3_padding_bottom' );
if ( $padding_bottom !== '' ) {
$styles['padding-bottom'] = calla_elated_filter_px( $padding_bottom ) . 'px';
}
$padding_left = calla_elated_options()->getOptionValue( 'cf7_style_3_padding_left' );
if ( $padding_left !== '' ) {
$styles['padding-left'] = calla_elated_filter_px( $padding_left ) . 'px';
}
$margin_top = calla_elated_options()->getOptionValue( 'cf7_style_3_margin_top' );
if ( $margin_top !== '' ) {
$styles['margin-top'] = calla_elated_filter_px( $margin_top ) . 'px';
}
$margin_bottom = calla_elated_options()->getOptionValue( 'cf7_style_3_margin_bottom' );
if ( $margin_bottom !== '' ) {
$styles['margin-bottom'] = calla_elated_filter_px( $margin_bottom ) . 'px';
}
$textarea_height = calla_elated_options()->getOptionValue( 'cf7_style_3_textarea_height' );
if ( ! empty( $textarea_height ) ) {
echo calla_elated_dynamic_css( '.cf7_custom_style_3 textarea.wpcf7-form-control.wpcf7-textarea',
array( 'height' => calla_elated_filter_px( $textarea_height ) . 'px' )
);
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_text_styles_3' );
}
if ( ! function_exists( 'calla_elated_contact_form7_focus_styles_3' ) ) {
/**
* Generates custom styles for Contact Form 7 elements focus
*/
function calla_elated_contact_form7_focus_styles_3() {
$selector = array(
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-text:focus',
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-number:focus',
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-date:focus',
'.cf7_custom_style_3 textarea.wpcf7-form-control.wpcf7-textarea:focus',
'.cf7_custom_style_3 select.wpcf7-form-control.wpcf7-select:focus',
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-quiz:focus'
);
$styles = array();
$color = calla_elated_options()->getOptionValue( 'cf7_style_3_focus_text_color' );
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_3_focus_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_focus_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_3_focus_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_focus_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_focus_styles_3' );
}
if ( ! function_exists( 'calla_elated_contact_form7_label_styles_3' ) ) {
/**
* Generates custom styles for Contact Form 7 label
*/
function calla_elated_contact_form7_label_styles_3() {
$item_styles = calla_elated_get_typography_styles( 'cf7_style_3_label' );
$item_selector = array(
'.cf7_custom_style_3 p'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_label_styles_3' );
}
if ( ! function_exists( 'calla_elated_contact_form7_button_styles_3' ) ) {
/**
* Generates custom styles for Contact Form 7 button
*/
function calla_elated_contact_form7_button_styles_3() {
$selector = array(
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-submit'
);
$styles = calla_elated_get_typography_styles( 'cf7_style_3_button' );
$height = calla_elated_options()->getOptionValue( 'cf7_style_3_button_height' );
if ( $height !== '' ) {
$styles['padding-top'] = '0';
$styles['padding-bottom'] = '0';
$styles['height'] = calla_elated_filter_px( $height ) . 'px';
$styles['line-height'] = calla_elated_filter_px( $height ) . 'px';
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_3_button_background_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_button_background_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_3_button_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_button_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
$border_width = calla_elated_options()->getOptionValue( 'cf7_style_3_button_border_width' );
if ( $border_width !== '' ) {
$styles['border-width'] = calla_elated_filter_px( $border_width ) . 'px';
}
$border_radius = calla_elated_options()->getOptionValue( 'cf7_style_3_button_border_radius' );
if ( $border_radius !== '' ) {
$styles['border-radius'] = calla_elated_filter_px( $border_radius ) . 'px';
}
$padding_left_right = calla_elated_options()->getOptionValue( 'cf7_style_3_button_padding' );
if ( $padding_left_right !== '' ) {
$styles['padding-left'] = calla_elated_filter_px( $padding_left_right ) . 'px';
$styles['padding-right'] = calla_elated_filter_px( $padding_left_right ) . 'px';
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_button_styles_3' );
}
if ( ! function_exists( 'calla_elated_contact_form7_button_hover_styles_3' ) ) {
/**
* Generates custom styles for Contact Form 7 button
*/
function calla_elated_contact_form7_button_hover_styles_3() {
$selector = array(
'.cf7_custom_style_3 input.wpcf7-form-control.wpcf7-submit:not([disabled]):hover'
);
$styles = array();
$color = calla_elated_options()->getOptionValue( 'cf7_style_3_button_hover_color' );
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
$background_color = calla_elated_options()->getOptionValue( 'cf7_style_3_button_hover_bckg_color' );
$background_opacity = 1;
if ( ! empty( $background_color ) ) {
$background_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_button_hover_bckg_transparency' );
if ( $background_transparency !== '' ) {
$background_opacity = $background_transparency;
}
$styles['background-color'] = calla_elated_rgba_color( $background_color, $background_opacity );
}
$border_color = calla_elated_options()->getOptionValue( 'cf7_style_3_button_hover_border_color' );
$border_opacity = 1;
if ( ! empty( $border_color ) ) {
$border_transparency = calla_elated_options()->getOptionValue( 'cf7_style_3_button_border_transparency' );
if ( $border_transparency !== '' ) {
$border_opacity = $border_transparency;
}
$styles['border-color'] = calla_elated_rgba_color( $border_color, $border_opacity );
}
echo calla_elated_dynamic_css( $selector, $styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_contact_form7_button_hover_styles_3' );
}

View File

@@ -0,0 +1,7 @@
<?php
if (calla_elated_contact_form_7_installed()) {
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/contactform7/options-map/map.php';
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/contactform7/custom-styles/contact-form.php';
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/contactform7/contact-form-7-config.php';
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,77 @@
<?php
if ( ! function_exists( 'calla_elated_map_content_bottom_meta' ) ) {
function calla_elated_map_content_bottom_meta() {
$content_bottom_meta_box = calla_elated_create_meta_box(
array(
'scope' => apply_filters( 'calla_elated_set_scope_for_meta_boxes', array( 'page', 'post' ), 'content_bottom_meta' ),
'title' => esc_html__( 'Content Bottom', 'calla' ),
'name' => 'content_bottom_meta'
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_enable_content_bottom_area_meta',
'type' => 'select',
'default_value' => '',
'label' => esc_html__( 'Enable Content Bottom Area', 'calla' ),
'description' => esc_html__( 'This option will enable Content Bottom area on pages', 'calla' ),
'parent' => $content_bottom_meta_box,
'options' => calla_elated_get_yes_no_select_array()
)
);
$show_content_bottom_meta_container = calla_elated_add_admin_container(
array(
'parent' => $content_bottom_meta_box,
'name' => 'eltdf_show_content_bottom_meta_container',
'dependency' => array(
'show' => array(
'eltdf_enable_content_bottom_area_meta' => 'yes'
)
)
)
);
calla_elated_create_meta_box_field(
array(
'name' => 'eltdf_content_bottom_sidebar_custom_display_meta',
'type' => 'selectblank',
'default_value' => '',
'label' => esc_html__( 'Sidebar to Display', 'calla' ),
'description' => esc_html__( 'Choose a content bottom sidebar to display', 'calla' ),
'options' => calla_elated_get_custom_sidebars(),
'parent' => $show_content_bottom_meta_container,
'args' => array(
'select2' => true
)
)
);
calla_elated_create_meta_box_field(
array(
'type' => 'select',
'name' => 'eltdf_content_bottom_in_grid_meta',
'default_value' => '',
'label' => esc_html__( 'Display in Grid', 'calla' ),
'description' => esc_html__( 'Enabling this option will place content bottom in grid', 'calla' ),
'options' => calla_elated_get_yes_no_select_array(),
'parent' => $show_content_bottom_meta_container
)
);
calla_elated_create_meta_box_field(
array(
'type' => 'color',
'name' => 'eltdf_content_bottom_background_color_meta',
'label' => esc_html__( 'Background Color', 'calla' ),
'description' => esc_html__( 'Choose a background color for content bottom area', 'calla' ),
'parent' => $show_content_bottom_meta_container
)
);
}
add_action( 'calla_elated_meta_boxes_map', 'calla_elated_map_content_bottom_meta', 71 );
}

View File

@@ -0,0 +1,74 @@
<?php
if ( ! function_exists( 'calla_elated_content_bottom_options_map' ) ) {
function calla_elated_content_bottom_options_map() {
$panel_content_bottom = calla_elated_add_admin_panel(
array(
'page' => '_page_page',
'name' => 'panel_content_bottom',
'title' => esc_html__( 'Content Bottom Area Style', 'calla' )
)
);
calla_elated_add_admin_field(
array(
'name' => 'enable_content_bottom_area',
'type' => 'yesno',
'default_value' => 'no',
'label' => esc_html__( 'Enable Content Bottom Area', 'calla' ),
'description' => esc_html__( 'This option will enable Content Bottom area on pages', 'calla' ),
'parent' => $panel_content_bottom
)
);
$enable_content_bottom_area_container = calla_elated_add_admin_container(
array(
'parent' => $panel_content_bottom,
'name' => 'enable_content_bottom_area_container',
'dependency' => array(
'show' => array(
'enable_content_bottom_area' => 'yes'
)
)
)
);
$calla_custom_sidebars = calla_elated_get_custom_sidebars();
calla_elated_add_admin_field(
array(
'type' => 'selectblank',
'name' => 'content_bottom_sidebar_custom_display',
'default_value' => '',
'label' => esc_html__( 'Widget Area to Display', 'calla' ),
'description' => esc_html__( 'Choose a Content Bottom widget area to display', 'calla' ),
'options' => $calla_custom_sidebars,
'parent' => $enable_content_bottom_area_container
)
);
calla_elated_add_admin_field(
array(
'type' => 'yesno',
'name' => 'content_bottom_in_grid',
'default_value' => 'yes',
'label' => esc_html__( 'Display in Grid', 'calla' ),
'description' => esc_html__( 'Enabling this option will place Content Bottom in grid', 'calla' ),
'parent' => $enable_content_bottom_area_container
)
);
calla_elated_add_admin_field(
array(
'type' => 'color',
'name' => 'content_bottom_background_color',
'label' => esc_html__( 'Background Color', 'calla' ),
'description' => esc_html__( 'Choose a background color for Content Bottom area', 'calla' ),
'parent' => $enable_content_bottom_area_container
)
);
}
add_action( 'calla_elated_additional_page_options_map', 'calla_elated_content_bottom_options_map' );
}

View File

@@ -0,0 +1,30 @@
/* ==========================================================================
Content Bottom styles - begin
========================================================================== */
/* common mixins - start */
/* common mixins - end */
/* mixins styles - start */
/* mixins styles - end */
/* ==========================================================================
#Content bottom styles - begin
========================================================================== */
.eltdf-content-bottom .eltdf-content-bottom-inner {
box-sizing: border-box;
}
.eltdf-content-bottom .eltdf-content-bottom-inner.eltdf-grid {
padding: 20px 0;
}
.eltdf-content-bottom .eltdf-content-bottom-inner.eltdf-full-width {
padding: 20px 40px;
}
/* ==========================================================================
#Content bottom styles - end
========================================================================== */
/* ==========================================================================
Content Bottom styles - end
========================================================================== */
/*# sourceMappingURL=content-bottom-map.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"file":"content-bottom-map.css","sources":["content-bottom/assets/css/scss/content-bottom-map.scss","../../assets/css/scss/_variables.scss","../../assets/css/scss/_mixins.scss","content-bottom/assets/css/scss/default/_content-bottom.scss"],"names":[],"mappings":"AAAA;;gFAEgF;AEkKhF,2BAA2B;AAqL3B,yBAAyB;AAEzB,2BAA2B;AA+B3B,yBAAyB;AC1XzB;;gFAEgF;AAEhF,AAEC,qBAFoB,CAEpB,2BAA2B,CAAC;EAC3B,UAAU,EAAE,UAAU;CAStB;;AAZF,AAKE,qBALmB,CAEpB,2BAA2B,AAGzB,WAAW,CAAC;EACZ,OAAO,EAAE,MAAM;CACf;;AAPH,AASE,qBATmB,CAEpB,2BAA2B,AAOzB,iBAAiB,CAAC;EAClB,OAAO,EAAE,SAAS;CAClB;;AAIH;;gFAEgF;AHbhF;;gFAEgF","sourceRoot":"../../../../../css"}

View File

@@ -0,0 +1,38 @@
<?php
if ( ! function_exists( 'calla_elated_get_content_bottom_area' ) ) {
/**
* Loads content bottom area HTML with all needed parameters
*/
function calla_elated_get_content_bottom_area() {
$parameters = array();
//Current page id
$id = calla_elated_get_page_id();
//is content bottom area enabled for current page?
$parameters['content_bottom_area'] = calla_elated_get_meta_field_intersect( 'enable_content_bottom_area', $id );
if ( $parameters['content_bottom_area'] === 'yes' ) {
//Sidebar for content bottom area
$parameters['content_bottom_area_sidebar'] = calla_elated_get_meta_field_intersect( 'content_bottom_sidebar_custom_display', $id );
//Content bottom area in grid
$parameters['grid_class'] = ( calla_elated_get_meta_field_intersect( 'content_bottom_in_grid', $id ) ) === 'yes' ? 'eltdf-grid' : 'eltdf-full-width';
$parameters['content_bottom_style'] = array();
//Content bottom area background color
$background_color = calla_elated_get_meta_field_intersect( 'content_bottom_background_color', $id );
if ( $background_color !== '' ) {
$parameters['content_bottom_style'][] = 'background-color: ' . $background_color . ';';
}
if ( is_active_sidebar( $parameters['content_bottom_area_sidebar'] ) ) {
calla_elated_get_module_template_part( 'templates/content-bottom-area', 'content-bottom', '', $parameters );
}
}
}
add_action( 'calla_elated_before_footer_content', 'calla_elated_get_content_bottom_area' );
}

View File

@@ -0,0 +1,9 @@
<?php
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/content-bottom/functions.php';
//load global content bottom options
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/content-bottom/admin/options-map/content-bottom-map.php';
//load per page content bottom options
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/content-bottom/admin/meta-boxes/content-bottom-meta-boxes.php';

View File

@@ -0,0 +1,5 @@
<div class="eltdf-content-bottom" <?php calla_elated_inline_style( $content_bottom_style ); ?>>
<div class="eltdf-content-bottom-inner <?php echo esc_attr( $grid_class ); ?>">
<?php dynamic_sidebar( $content_bottom_area_sidebar ); ?>
</div>
</div>

View File

@@ -0,0 +1,17 @@
<?php
if ( ! function_exists( 'calla_elated_load_modules' ) ) {
/**
* Loades all modules by going through all folders that are placed directly in modules folder
* and loads load.php file in each. Hooks to calla_elated_after_options_map action
*
* @see http://php.net/manual/en/function.glob.php
*/
function calla_elated_load_modules() {
foreach ( glob( ELATED_FRAMEWORK_ROOT_DIR . '/modules/*/load.php' ) as $module_load ) {
include_once $module_load;
}
}
add_action( 'calla_elated_before_options_map', 'calla_elated_load_modules' );
}

View File

@@ -0,0 +1,134 @@
<?php
if ( ! function_exists( 'calla_elated_404_header_general_styles' ) ) {
/**
* Generates general custom styles for 404 header area
*/
function calla_elated_404_header_general_styles() {
$background_color = calla_elated_options()->getOptionValue( '404_menu_area_background_color_header' );
$background_transparency = calla_elated_options()->getOptionValue( '404_menu_area_background_transparency_header' );
$header_styles = array();
$menu_selector = array(
'.error404 .eltdf-page-header .eltdf-menu-area'
);
if ( ! empty( $background_color ) ) {
$header_styles['background-color'] = $background_color;
$header_styles['background-transparency'] = 1;
if ( $background_transparency !== '' ) {
$header_styles['background-transparency'] = $background_transparency;
}
echo calla_elated_dynamic_css( $menu_selector, array( 'background-color' => calla_elated_rgba_color( $header_styles['background-color'], $header_styles['background-transparency'] ) . ' !important' ) );
}
if ( empty( $background_color ) && $background_transparency !== '' ) {
$header_styles['background-color'] = '#fff';
$header_styles['background-transparency'] = $background_transparency;
echo calla_elated_dynamic_css( $menu_selector, array( 'background-color' => calla_elated_rgba_color( $header_styles['background-color'], $header_styles['background-transparency'] ) . ' !important' ) );
}
$border_color = calla_elated_options()->getOptionValue( '404_menu_area_border_color_header' );
$menu_styles = array();
if ( ! empty( $border_color ) ) {
$menu_styles['border-color'] = $border_color;
}
echo calla_elated_dynamic_css( $menu_selector, $menu_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_404_header_general_styles' );
}
if ( ! function_exists( 'calla_elated_404_page_general_styles' ) ) {
/**
* Generates general custom styles for 404 page
*/
function calla_elated_404_page_general_styles() {
$background_color = calla_elated_options()->getOptionValue( '404_page_background_color' );
$background_image = calla_elated_options()->getOptionValue( '404_page_background_image' );
$pattern_background_image = calla_elated_options()->getOptionValue( '404_page_background_pattern_image' );
$item_styles = array();
if ( ! empty( $background_color ) ) {
$item_styles['background-color'] = $background_color;
}
if ( ! empty( $background_image ) ) {
$item_styles['background-image'] = 'url(' . $background_image . ')';
$item_styles['background-position'] = 'center 0';
$item_styles['background-size'] = 'cover';
$item_styles['background-repeat'] = 'no-repeat';
}
if ( ! empty( $pattern_background_image ) ) {
$item_styles['background-image'] = 'url(' . $pattern_background_image . ')';
$item_styles['background-position'] = '0 0';
$item_styles['background-repeat'] = 'repeat';
}
$item_selector = array(
'.error404 .eltdf-content'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_404_page_general_styles' );
}
if ( ! function_exists( 'calla_elated_404_title_styles' ) ) {
/**
* Generates styles for 404 page title
*/
function calla_elated_404_title_styles() {
$item_styles = calla_elated_get_typography_styles( '404_title' );
$item_selector = array(
'.error404 .eltdf-page-not-found .eltdf-404-title'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_404_title_styles' );
}
if ( ! function_exists( 'calla_elated_404_subtitle_styles' ) ) {
/**
* Generates styles for 404 page subtitle
*/
function calla_elated_404_subtitle_styles() {
$item_styles = calla_elated_get_typography_styles( '404_subtitle' );
$item_selector = array(
'.error404 .eltdf-page-not-found .eltdf-404-subtitle'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_404_subtitle_styles' );
}
if ( ! function_exists( 'calla_elated_404_text_styles' ) ) {
/**
* Generates styles for 404 page text
*/
function calla_elated_404_text_styles() {
$item_styles = calla_elated_get_typography_styles( '404_text' );
$item_selector = array(
'.error404 .eltdf-page-not-found .eltdf-404-text'
);
echo calla_elated_dynamic_css( $item_selector, $item_styles );
}
add_action( 'calla_elated_style_dynamic', 'calla_elated_404_text_styles' );
}

Some files were not shown because too many files have changed in this diff Show More