consultstreet
This commit is contained in:
31
wp-content/themes/consultstreet/404.php
Normal file
31
wp-content/themes/consultstreet/404.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying 404 pages (not found)
|
||||
*
|
||||
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
get_header();
|
||||
get_template_part('template-parts/site','breadcrumb');
|
||||
?>
|
||||
<!-- 404 Errror -->
|
||||
<section class="theme-error-page">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12">
|
||||
<div class="text-center">
|
||||
<h2 class="error-title">4<b>0</b>4</h2>
|
||||
<h3 class="error-sub-title"><?php esc_html_e("OOPS, SORRY WE CAN'T FIND THAT PAGE !",'consultstreet');?></h3>
|
||||
<div class="mx-auto pt-4">
|
||||
<a href="<?php echo esc_url(home_url());?>" class="btn-small btn-border"><i class="fa fa-arrow-left pr-2"></i><?php esc_html_e('Go Back Now','consultstreet');?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /End of 404 Errror -->
|
||||
<?php
|
||||
get_footer();
|
||||
75
wp-content/themes/consultstreet/archive.php
Normal file
75
wp-content/themes/consultstreet/archive.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying archive pages
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
get_header();
|
||||
get_template_part('template-parts/site','breadcrumb');
|
||||
$consultstreet_archive_blog_pages_layout = get_theme_mod('consultstreet_archive_blog_pages_layout', 'consultstreet_right_sidebar');
|
||||
?>
|
||||
|
||||
<section class="theme-block theme-blog theme-blog-large theme-bg-grey">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<?php if($consultstreet_archive_blog_pages_layout == 'consultstreet_left_sidebar' || !$consultstreet_archive_blog_pages_layout == 'consultstreet_no_sidebar'): ?>
|
||||
<!--/Blog Section-->
|
||||
<?php get_sidebar(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($consultstreet_archive_blog_pages_layout == 'consultstreet_no_sidebar'): ?>
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<?php else: ?>
|
||||
<div class="col-lg-<?php echo ( !is_active_sidebar( 'sidebar-main' ) ? '12' :'8' ); ?> col-md-<?php echo ( !is_active_sidebar( 'sidebar-main' ) ? '12' :'8' ); ?> col-sm-12">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
// Start the loop.
|
||||
while ( have_posts() ) : the_post();
|
||||
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_type() );
|
||||
|
||||
endwhile;
|
||||
|
||||
// End the loop.
|
||||
|
||||
|
||||
// Pgination.
|
||||
the_posts_pagination( array(
|
||||
'prev_text' => '<i class="fa fa-angle-double-left"></i>',
|
||||
'next_text' => '<i class="fa fa-angle-double-right"></i>'
|
||||
) );
|
||||
|
||||
// If no content, include the "No posts found" template.
|
||||
|
||||
else :
|
||||
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
|
||||
endif;
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if($consultstreet_archive_blog_pages_layout == 'consultstreet_right_sidebar' || !$consultstreet_archive_blog_pages_layout == 'consultstreet_no_sidebar'): ?>
|
||||
<?php get_sidebar(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<?php get_footer(); ?>
|
||||
153
wp-content/themes/consultstreet/assets/css/admin.css
Normal file
153
wp-content/themes/consultstreet/assets/css/admin.css
Normal file
@ -0,0 +1,153 @@
|
||||
#accordion-section-header_image {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.customize-control-hidden {
|
||||
margin: 0 -12px;
|
||||
margin-bottom: 12px;
|
||||
display: block;
|
||||
padding: 13px 12px;
|
||||
border-width: 1px 0;
|
||||
border-style: solid;
|
||||
border-color: #dddddd;
|
||||
background-color: #fff;
|
||||
font-weight: 500;
|
||||
letter-spacing: 1px;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
color: #3292db;
|
||||
}
|
||||
|
||||
.customize-control-hidden label {
|
||||
margin-bottom: 0;
|
||||
line-height: 1;
|
||||
font-size: 11.5px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.consultstreet-getting-started-notice {
|
||||
padding: 20px 10px;
|
||||
display: -webkit-flex;
|
||||
display: -moz-flex;
|
||||
display: -ms-flex;
|
||||
display: -o-flex;
|
||||
display: flex;
|
||||
-ms-align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.consultstreet-theme-screenshot img {
|
||||
width: 100%;
|
||||
max-width: 200px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
border: 2px solid #ddd;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.consultstreet-theme-notice-content {
|
||||
width: 70%;
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
h2.consultstreet-notice-h2 {
|
||||
margin: 0 0 10px;
|
||||
font-weight: 400;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.consultstreet-push-down {
|
||||
padding-top: 15px;
|
||||
display: inline-block;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.consultstreet-button-padding.updating-message::before {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Upsale */
|
||||
.pro_info ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pro_info ul li {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.pro_info ul li a, .up-to-pro {
|
||||
font-family: 'Noto Sans', sans-serif;
|
||||
font-weight: bold;
|
||||
padding: 12px 10px;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
color: #ffffff;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
letter-spacing: 1px;
|
||||
overflow: hidden;
|
||||
-webkit-transition: .3s;
|
||||
transition: .3s;
|
||||
background: #009efa; /* fallback for old browsers */
|
||||
background: -webkit-linear-gradient(to right, #233fe7, #009efa); /* Chrome 10-25, Safari 5.1-6 */
|
||||
background: linear-gradient(to right, #233fe7, #009efa);/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
||||
z-index: 2;
|
||||
}
|
||||
.pro_info ul li a:hover, .pro_info ul li a:focus,
|
||||
.up-to-pro:hover, .up-to-pro:focus {
|
||||
transform: translateY(-3px);
|
||||
color: #fff;
|
||||
box-shadow: 0 0.5rem 1.875rem rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.show-love {
|
||||
background-image: -webkit-linear-gradient( 90deg, #e4aa00 0%, #fddb3e 100%) !important;
|
||||
background: #FF512F; /* fallback for old browsers */
|
||||
background: -webkit-linear-gradient(to right, #DD2476, #FF512F) !important; /* Chrome 10-25, Safari 5.1-6 */
|
||||
background: linear-gradient(to right, #DD2476, #FF512F) !important; /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
||||
}
|
||||
.up-to-pro {
|
||||
padding: 9px 58px;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
.pro_info ul li a i{
|
||||
font-size: 15px;
|
||||
margin-top: 1px;
|
||||
margin-right: 7px;
|
||||
}
|
||||
.pro_info .upgrade-to-pro, .up-to-pro{
|
||||
background: #780206; /* fallback for old browsers */
|
||||
background: -webkit-linear-gradient(to right, #061161, #780206); /* Chrome 10-25, Safari 5.1-6 */
|
||||
background: linear-gradient(to right, #061161, #780206); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
||||
|
||||
}
|
||||
li#accordion-section-upgrade_premium .accordion-section-title:after {
|
||||
content: "\f174" !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
li#accordion-section-upgrade_premium .accordion-section-title,
|
||||
li#accordion-section-upgrade_premium .accordion-section-title:hover {
|
||||
color: #ffffff !important;
|
||||
border-left: none;
|
||||
background: #009efa; /* fallback for old browsers */
|
||||
background: -webkit-linear-gradient(to right, #233fe7, #009efa) !important; /* Chrome 10-25, Safari 5.1-6 */
|
||||
background: linear-gradient(to right, #233fe7, #009efa) !important;/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
||||
}
|
||||
#customize-controls .control-section .accordion-section-title button:focus, #customize-controls .control-section .accordion-section-title button:hover, #customize-controls .control-section.open .accordion-section-title, #customize-controls .control-section:hover>.accordion-section-title {
|
||||
color: unset;
|
||||
background: unset;
|
||||
}
|
||||
/*customizer Setting*/
|
||||
.updated.notice-get-started-class {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.notice.notice-success {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.notice-success .notice-text{ font-size : 17px;}
|
||||
3623
wp-content/themes/consultstreet/assets/css/animate.css
vendored
Normal file
3623
wp-content/themes/consultstreet/assets/css/animate.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
476
wp-content/themes/consultstreet/assets/css/bootstrap-smartmenus.css
vendored
Normal file
476
wp-content/themes/consultstreet/assets/css/bootstrap-smartmenus.css
vendored
Normal file
@ -0,0 +1,476 @@
|
||||
/*
|
||||
Name: bootstrap-smartmenus.css
|
||||
*/
|
||||
|
||||
/* Carets in collapsible mode (make them look like +/- buttons) */
|
||||
|
||||
.navbar {
|
||||
background-color: transparent;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
padding-left: 0rem;
|
||||
padding-right: 0rem;
|
||||
opacity: 1;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
||||
z-index: 2;
|
||||
}
|
||||
.m-right-auto {
|
||||
margin-right: unset!important;
|
||||
margin-left: auto;
|
||||
}
|
||||
.navbar>.container {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Site Branding Text & Navar Brand
|
||||
--------------------------------------------------*/
|
||||
|
||||
.navbar-brand {
|
||||
padding-top: 0.375rem;
|
||||
padding-bottom: 0.375rem;
|
||||
}
|
||||
.navbar-brand, .sticky-navbar-brand {
|
||||
float: left;
|
||||
}
|
||||
.site-branding-text {
|
||||
margin-right: 1rem;
|
||||
display: inline-block;
|
||||
}
|
||||
.site-branding-text .site-title {
|
||||
font-size: 1.6rem;
|
||||
line-height: inherit;
|
||||
white-space: normal;
|
||||
line-height: 1.2;
|
||||
margin: -2px 0 0;
|
||||
}
|
||||
.site-branding-text .site-description {
|
||||
line-height: 1.4;
|
||||
padding-top: 0.063rem;
|
||||
}
|
||||
.navbar-brand .custom-logo,
|
||||
.navbar.header-fixed-top .sticky-navbar-brand .custom-logo {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .site-branding-text .site-title a {
|
||||
color: #000;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .site-branding-text .site-description {
|
||||
color: #404040;
|
||||
}
|
||||
.navbar .row.align-self-center {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
/*Toggle Button*/
|
||||
.navbar .navbar-toggler {
|
||||
float: right;
|
||||
margin-top: 0.238rem;
|
||||
border-color: unset;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
color: transparent;
|
||||
}
|
||||
.navbar.navbar-header-wrap .navbar-toggler {
|
||||
border-color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .navbar-toggler {
|
||||
border-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.navbar-toggler:hover,
|
||||
.navbar-toggler:focus {
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbar-toggler:focus {
|
||||
outline: 1px dotted #fff;
|
||||
}
|
||||
.header-fixed-top .navbar-toggler:focus {
|
||||
outline: 1px dotted #000;
|
||||
}
|
||||
.navbar .navbar-toggler-icon {
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(1, 1, 47, 0)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
|
||||
width: 4rem;
|
||||
}
|
||||
|
||||
/*Menu & Dropdown Css*/
|
||||
.navbar .nav .menu-item {
|
||||
margin-right: 0;
|
||||
}
|
||||
.navbar .nav .menu-item:last-child {
|
||||
margin-right: 0px;
|
||||
}
|
||||
.navbar .nav .menu-item .nav-link {
|
||||
font-weight: 600;
|
||||
color: #061018;
|
||||
padding: 0;
|
||||
}
|
||||
.navbar .nav .dropdown-menu {
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
padding: 0.438rem 0.625rem;
|
||||
font-size: 0.938rem;
|
||||
}
|
||||
.navbar .nav .dropdown-item {
|
||||
padding: .30rem 0.75rem;
|
||||
}
|
||||
.navbar .nav .dropdown-menu .menu-item {
|
||||
margin-right: 0;
|
||||
}
|
||||
.navbar .nav .dropdown-item.active, .navbar .nav .dropdown-item:active {
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
}
|
||||
a.bg-light:focus, a.bg-light:hover {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.navbar .nav .dropdown-menu > .menu-item > ul.dropdown-menu > .menu-item > .dropdown-item {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
/*Navbar Header Wrap*/
|
||||
|
||||
.navbar-header-wrap {
|
||||
background-color: rgba(0, 0, 0, .4);
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
.navbar-header-wrap.not-sticky .site-branding-text .site-title a,
|
||||
.navbar-header-wrap.not-sticky .site-branding-text .site-description {
|
||||
color: #fff;
|
||||
}
|
||||
.navbar.navbar-header-wrap .navbar-toggler-icon {
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='3' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .navbar-toggler-icon {
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(1, 1, 47, 1)' stroke-width='3' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link,
|
||||
.navbar.navbar-header-wrap .nav a.cart-icon,
|
||||
.navbar.navbar-header-wrap .nav .theme-search-block a {
|
||||
color: #fff;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .btn-border {
|
||||
background: transparent;
|
||||
color: #ffffff;
|
||||
border: 2px solid #ffffff;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .btn-border:hover,
|
||||
.navbar.navbar-header-wrap .nav .btn-border:focus,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .btn-border:hover,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .btn-border:focus {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .menu-item .nav-link,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav a.cart-icon,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .theme-search-block a {
|
||||
color: #000;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .menu-item.active .nav-link {
|
||||
color: #fff;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .btn-border {
|
||||
background: transparent;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/*Header Sticky*/
|
||||
.header-fixed-top {
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
width: 100%;
|
||||
z-index: 3;
|
||||
box-shadow: 0 8px 20px 0 rgba(0,0,0,.1);
|
||||
opacity: 1;
|
||||
-webkit-animation: slide-down 1.07s;
|
||||
animation: slide-down 1.07s;
|
||||
}
|
||||
@keyframes slide-down {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.navbar.header-fixed-top .nav {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.navbar.header-fixed-top .site-branding-text {
|
||||
padding-top: 0.670rem;
|
||||
padding-bottom: 0.670rem;
|
||||
}
|
||||
.navbar.header-fixed-top .nav .themes-header-top {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
.navbar.header-fixed-top .nav .menu-item .nav-link {
|
||||
padding: 1.400rem 1rem;
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
/*When we add more menus then show vertical scroll in mobiles*/
|
||||
.navbar-collapse{
|
||||
max-height: 400px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.navbar .nav .menu-item {
|
||||
margin-right: 28px;
|
||||
}
|
||||
.navbar .container {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.row.align-self-center .align-self-center {
|
||||
width: 100%;
|
||||
}
|
||||
.site-branding-text {
|
||||
padding-top: 0.375rem;
|
||||
padding-bottom: 0.375rem;
|
||||
}
|
||||
.navbar.header-fixed-top .site-branding-text {
|
||||
padding-top: 0.175rem;
|
||||
padding-bottom: 0.175rem;
|
||||
}
|
||||
.navbar-brand, .sticky-navbar-brand {
|
||||
float: left;
|
||||
}
|
||||
.sticky-navbar-brand {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
.navbar .nav {
|
||||
margin-top: 1.25rem;
|
||||
margin-bottom: 1.25rem;
|
||||
margin-left: 0;
|
||||
position: relative;
|
||||
}
|
||||
.navbar .nav .menu-item {
|
||||
margin-right: 0;
|
||||
}
|
||||
.navbar .nav .menu-item .nav-link {
|
||||
line-height: 40px;
|
||||
margin-right: 2px;
|
||||
margin-left: 2px;
|
||||
display: block;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
border-radius: 0;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.navbar .nav .dropdown-item:focus,
|
||||
.navbar .nav .dropdown-item:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.themes-header-top.align-self-center {
|
||||
align-self: auto !important;
|
||||
padding: 0;
|
||||
}
|
||||
.navbar.header-fixed-top {
|
||||
padding-top: 9px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.navbar.header-fixed-top .nav .themes-header-top {
|
||||
padding: 0 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.navbar-brand {
|
||||
padding-top: 1.750rem;
|
||||
padding-bottom: 1.750rem;
|
||||
}
|
||||
.site-branding-text {
|
||||
padding-top: 1.5rem;
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
.navbar.header-fixed-top .navbar-brand {
|
||||
padding-top: 0.900rem;
|
||||
padding-bottom: 0.900rem;
|
||||
}
|
||||
.navbar.header-fixed-top .sticky-navbar-brand {
|
||||
padding-top: 0.900rem;
|
||||
padding-bottom: 0.900rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
.navbar {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.navbar .nav .menu-item .nav-link {
|
||||
padding: 2.220rem 1rem;
|
||||
}
|
||||
.navbar .nav .dropdown-menu {
|
||||
padding: 0;
|
||||
top: 99px !important;
|
||||
}
|
||||
.navbar.header-fixed-top .nav .dropdown-menu {
|
||||
top: 73px !important;
|
||||
}
|
||||
.navbar .nav .dropdown-menu {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 12px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
.navbar .nav .dropdown-item {
|
||||
color: #000;
|
||||
border-bottom: 1px solid rgb(242, 242, 242);
|
||||
padding: 7px 25px;
|
||||
}
|
||||
.navbar .nav .dropdown-item:focus,
|
||||
.navbar .nav .dropdown-item:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbar .nav .dropdown-menu ul.dropdown-menu {
|
||||
top: auto !important;
|
||||
}
|
||||
.navbar.header-fixed-top .nav .dropdown-menu ul.dropdown-menu {
|
||||
top: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/*End Css*/
|
||||
|
||||
.navbar-nav.sm-collapsible .sub-arrow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
margin: -0.7em 0.5em 0 0;
|
||||
border: 1px solid rgba(0, 0, 0, .1);
|
||||
border-radius: .25rem;
|
||||
padding: 0;
|
||||
width: 2em;
|
||||
height: 1.4em;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.2em;
|
||||
text-align: center;
|
||||
}
|
||||
.navbar-nav.sm-collapsible .sub-arrow::before {
|
||||
content: '+';
|
||||
}
|
||||
.navbar-nav.sm-collapsible .show > a > .sub-arrow::before {
|
||||
content: '-';
|
||||
}
|
||||
.navbar-dark .navbar-nav.sm-collapsible .nav-link .sub-arrow {
|
||||
border-color: rgba(255, 255, 255, .1);
|
||||
}
|
||||
/* make sure there's room for the carets */
|
||||
.navbar-nav.sm-collapsible .has-submenu {
|
||||
padding-right: 3em;
|
||||
}
|
||||
/* keep the carets properly positioned */
|
||||
.navbar-nav.sm-collapsible .nav-link,
|
||||
.navbar-nav.sm-collapsible .dropdown-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Nav carets in expanded mode */
|
||||
.navbar-nav:not(.sm-collapsible) .nav-link .sub-arrow {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: .255em;
|
||||
vertical-align: .255em;
|
||||
border-top: .3em solid;
|
||||
border-right: .3em solid transparent;
|
||||
border-left: .3em solid transparent;
|
||||
}
|
||||
/* point the arrows up for .fixed-bottom navbars */
|
||||
.fixed-bottom .navbar-nav:not(.sm-collapsible) .nav-link .sub-arrow,
|
||||
.fixed-bottom .navbar-nav:not(.sm-collapsible):not([data-sm-skip]) .dropdown-toggle::after {
|
||||
border-top: 0;
|
||||
border-bottom: .3em solid;
|
||||
}
|
||||
|
||||
/* Dropdown carets in expanded mode */
|
||||
.navbar-nav:not(.sm-collapsible) .dropdown-item .sub-arrow,
|
||||
.navbar-nav:not(.sm-collapsible):not([data-sm-skip]) .dropdown-menu .dropdown-toggle::after {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-top: -.3em;
|
||||
margin-right: 1em;
|
||||
border-top: .3em solid transparent;
|
||||
border-bottom: .3em solid transparent;
|
||||
border-left: .3em solid;
|
||||
}
|
||||
/* make sure there's room for the carets */
|
||||
.navbar-nav:not(.sm-collapsible) .dropdown-item.has-submenu {
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
|
||||
/* Scrolling arrows for tall menus */
|
||||
.navbar-nav .scroll-up,
|
||||
.navbar-nav .scroll-down {
|
||||
position: absolute;
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
.navbar-nav .scroll-up-arrow,
|
||||
.navbar-nav .scroll-down-arrow {
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
border-top: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid;
|
||||
border-left: 7px solid transparent;
|
||||
}
|
||||
.navbar-nav .scroll-down-arrow {
|
||||
top: 6px;
|
||||
border-top: 7px solid;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid transparent;
|
||||
border-left: 7px solid transparent;
|
||||
}
|
||||
|
||||
/* Add some spacing for 2+ level sub menus in collapsible mode */
|
||||
.navbar-nav.sm-collapsible .dropdown-menu .dropdown-menu {
|
||||
margin: .5em;
|
||||
}
|
||||
|
||||
/* Fix SmartMenus sub menus auto width (subMenusMinWidth/subMenusMaxWidth options) */
|
||||
.navbar-nav:not([data-sm-skip]) .dropdown-item {
|
||||
white-space: normal;
|
||||
}
|
||||
.navbar-nav:not(.sm-collapsible) .sm-nowrap > li > .dropdown-item {
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
|
||||
/*Add Menu*/
|
||||
.navbar .nav .menu-item .nav-link.add-menu {
|
||||
text-transform: capitalize;
|
||||
background-color: #ffffff;
|
||||
padding: 0.313rem 1.3rem;
|
||||
margin: 1.75rem 0;
|
||||
text-align: center;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .menu-item .nav-link.add-menu {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
.navbar .nav .menu-item .nav-link.add-menu:hover,
|
||||
.navbar .nav .menu-item .nav-link.add-menu:focus {
|
||||
color: #fff;
|
||||
}
|
||||
.navbar .nav .menu-item .nav-link.add-menu:before {
|
||||
font-family: "FontAwesome";
|
||||
content: "\f055";
|
||||
padding-right: 0.438rem;
|
||||
}
|
||||
8975
wp-content/themes/consultstreet/assets/css/bootstrap.css
vendored
Normal file
8975
wp-content/themes/consultstreet/assets/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2337
wp-content/themes/consultstreet/assets/css/font-awesome/css/font-awesome.css
vendored
Normal file
2337
wp-content/themes/consultstreet/assets/css/font-awesome/css/font-awesome.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
wp-content/themes/consultstreet/assets/css/font-awesome/css/font-awesome.min.css
vendored
Normal file
4
wp-content/themes/consultstreet/assets/css/font-awesome/css/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
186
wp-content/themes/consultstreet/assets/css/owl.carousel.css
Normal file
186
wp-content/themes/consultstreet/assets/css/owl.carousel.css
Normal file
@ -0,0 +1,186 @@
|
||||
/**
|
||||
* Owl Carousel v2.3.4
|
||||
* Copyright 2013-2018 David Deutsch
|
||||
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
||||
*/
|
||||
/*
|
||||
* Owl Carousel - Core
|
||||
*/
|
||||
.owl-carousel {
|
||||
display: none;
|
||||
width: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
/* position relative and z-index fix webkit rendering fonts issue */
|
||||
position: relative;
|
||||
z-index: 1; }
|
||||
.owl-carousel .owl-stage {
|
||||
position: relative;
|
||||
-ms-touch-action: pan-Y;
|
||||
touch-action: manipulation;
|
||||
-moz-backface-visibility: hidden;
|
||||
/* fix firefox animation glitch */ }
|
||||
.owl-carousel .owl-stage:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
line-height: 0;
|
||||
height: 0; }
|
||||
.owl-carousel .owl-stage-outer {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* fix for flashing background */
|
||||
-webkit-transform: translate3d(0px, 0px, 0px); }
|
||||
.owl-carousel .owl-wrapper,
|
||||
.owl-carousel .owl-item {
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
-ms-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
-moz-transform: translate3d(0, 0, 0);
|
||||
-ms-transform: translate3d(0, 0, 0); }
|
||||
.owl-carousel .owl-item {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
float: left;
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none; }
|
||||
.owl-carousel .owl-item img {
|
||||
display: block;
|
||||
width: 100%; }
|
||||
.owl-carousel .owl-nav.disabled,
|
||||
.owl-carousel .owl-dots.disabled {
|
||||
display: none; }
|
||||
.owl-carousel .owl-nav .owl-prev,
|
||||
.owl-carousel .owl-nav .owl-next,
|
||||
.owl-carousel .owl-dot {
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.owl-carousel .owl-nav button.owl-prev,
|
||||
.owl-carousel .owl-nav button.owl-next,
|
||||
.owl-carousel button.owl-dot {
|
||||
background: none;
|
||||
color: inherit;
|
||||
border: none;
|
||||
padding: 0 !important;
|
||||
font: inherit; }
|
||||
.owl-carousel.owl-loaded {
|
||||
display: block; }
|
||||
.owl-carousel.owl-loading {
|
||||
opacity: 0;
|
||||
display: block; }
|
||||
.owl-carousel.owl-hidden {
|
||||
opacity: 0; }
|
||||
.owl-carousel.owl-refresh .owl-item {
|
||||
visibility: hidden; }
|
||||
.owl-carousel.owl-drag .owl-item {
|
||||
-ms-touch-action: pan-y;
|
||||
touch-action: pan-y;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.owl-carousel.owl-grab {
|
||||
cursor: move;
|
||||
cursor: grab; }
|
||||
.owl-carousel.owl-rtl {
|
||||
direction: rtl; }
|
||||
.owl-carousel.owl-rtl .owl-item {
|
||||
float: right; }
|
||||
|
||||
/* No Js */
|
||||
.no-js .owl-carousel {
|
||||
display: block; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Animate Plugin
|
||||
*/
|
||||
.owl-carousel .animated {
|
||||
animation-duration: 1000ms;
|
||||
animation-fill-mode: both; }
|
||||
|
||||
.owl-carousel .owl-animated-in {
|
||||
z-index: 0; }
|
||||
|
||||
.owl-carousel .owl-animated-out {
|
||||
z-index: 1; }
|
||||
|
||||
.owl-carousel .fadeOut {
|
||||
animation-name: fadeOut; }
|
||||
|
||||
@keyframes fadeOut {
|
||||
0% {
|
||||
opacity: 1; }
|
||||
100% {
|
||||
opacity: 0; } }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Auto Height Plugin
|
||||
*/
|
||||
.owl-height {
|
||||
transition: height 500ms ease-in-out; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Lazy Load Plugin
|
||||
*/
|
||||
.owl-carousel .owl-item {
|
||||
/**
|
||||
This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
|
||||
calculation of the height of the owl-item that breaks page layouts
|
||||
*/ }
|
||||
.owl-carousel .owl-item .owl-lazy {
|
||||
opacity: 0;
|
||||
transition: opacity 400ms ease; }
|
||||
.owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
|
||||
max-height: 0; }
|
||||
.owl-carousel .owl-item img.owl-lazy {
|
||||
transform-style: preserve-3d; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Video Plugin
|
||||
*/
|
||||
.owl-carousel .owl-video-wrapper {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
background: #000; }
|
||||
|
||||
.owl-carousel .owl-video-play-icon {
|
||||
position: absolute;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -40px;
|
||||
margin-top: -40px;
|
||||
background: url("owl.video.play.png") no-repeat;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
-webkit-backface-visibility: hidden;
|
||||
transition: transform 100ms ease; }
|
||||
|
||||
.owl-carousel .owl-video-play-icon:hover {
|
||||
-ms-transform: scale(1.3, 1.3);
|
||||
transform: scale(1.3, 1.3); }
|
||||
|
||||
.owl-carousel .owl-video-playing .owl-video-tn,
|
||||
.owl-carousel .owl-video-playing .owl-video-play-icon {
|
||||
display: none; }
|
||||
|
||||
.owl-carousel .owl-video-tn {
|
||||
opacity: 0;
|
||||
height: 100%;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
transition: opacity 400ms ease; }
|
||||
|
||||
.owl-carousel .owl-video-frame {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 100%;
|
||||
width: 100%; }
|
||||
752
wp-content/themes/consultstreet/assets/css/theme-default.css
Normal file
752
wp-content/themes/consultstreet/assets/css/theme-default.css
Normal file
@ -0,0 +1,752 @@
|
||||
/*
|
||||
theme-default.css
|
||||
*/
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Common - Begining Css
|
||||
--------------------------------------------------*/
|
||||
|
||||
|
||||
blockquote {
|
||||
border-left: 3px solid #ff5d20;
|
||||
}
|
||||
.wp-block-pullquote blockquote {
|
||||
border-left: 0;
|
||||
border-top: 3px solid #ff5d20;
|
||||
}
|
||||
td a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
button,
|
||||
input[type="button"],
|
||||
input[type="submit"] {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.btn-default,
|
||||
.btn-default-dark {
|
||||
background: #ff5d20;
|
||||
}
|
||||
.btn-border,
|
||||
.btn-border:hover,
|
||||
.btn-border:focus {
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.btn-border:hover,
|
||||
.btn-border:focus {
|
||||
background: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Navbar
|
||||
--------------------------------------------------*/
|
||||
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .btn-border {
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .btn-border:hover,
|
||||
.navbar.navbar-header-wrap .nav .btn-border:focus,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .btn-border:hover,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .btn-border:focus {
|
||||
background: #ff5d20;
|
||||
color: #ffffff;
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.navbar .nav .menu-item:hover .nav-link {
|
||||
color: #ff5d20;
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbar .nav .menu-item.active .nav-link {
|
||||
color: #fff;
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.navbar .nav .dropdown-item:focus,
|
||||
.navbar .nav .dropdown-item:hover {
|
||||
color: #ff5d20;
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.navbar .nav .dropdown-menu {
|
||||
border-bottom: 3px solid #ff5d20 !important;
|
||||
}
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.navbar .nav .menu-item.active .nav-link {
|
||||
color: #ff5d20;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
/*Add Menu*/
|
||||
.navbar .nav .menu-item .nav-link.add-menu {
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.navbar .nav .menu-item .nav-link.add-menu:hover,
|
||||
.navbar .nav .menu-item .nav-link.add-menu:focus {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link.add-menu {
|
||||
background: transparent;
|
||||
border: 2px solid #fff;
|
||||
}
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .menu-item .nav-link.add-menu {
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link.add-menu:hover,
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link.add-menu:focus,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .menu-item .nav-link.add-menu:hover,
|
||||
.navbar.navbar-header-wrap.header-fixed-top .nav .menu-item .nav-link.add-menu:focus {
|
||||
background: #ff5d20;
|
||||
color: #ffffff !important;
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link:hover,
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link:focus {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
.navbar.navbar-header-wrap .nav .menu-item.active .nav-link {
|
||||
color: #fff !important;
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link:hover,
|
||||
.navbar.navbar-header-wrap .nav .menu-item .nav-link:focus,
|
||||
.navbar.navbar-header-wrap .nav .menu-item.active .nav-link {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
}
|
||||
.navbar .nav .dropdown-menu .menu-item.active .dropdown-item {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
.navbar .nav .dropdown-menu > .menu-item > ul.dropdown-menu .menu-item.active .dropdown-item {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
|
||||
/*Multilevel Dropdown Active Colors*/
|
||||
|
||||
.navbar .nav .dropdown-menu > .menu-item > ul.dropdown-menu > .menu-item > .dropdown-item:hover,
|
||||
.navbar .nav .dropdown-menu > .menu-item > ul.dropdown-menu > .menu-item > .dropdown-item:focus {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
.navbar .nav .dropdown-menu .menu-item.active .dropdown-item {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
.navbar .nav .dropdown-menu > .menu-item > ul.dropdown-menu .menu-item.active .dropdown-item {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Search Popup Box For Header
|
||||
--------------------------------------------------*/
|
||||
|
||||
#search-popup .btn {
|
||||
background-color: #ff5d20;
|
||||
border-color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Site Header Contact Info
|
||||
--------------------------------------------------*/
|
||||
.site-header {
|
||||
background: #ff5d20;
|
||||
}
|
||||
.custom-social-icons li a.social-hover:hover,
|
||||
.custom-social-icons li a.social-hover:focus {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Combined Classes
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-bg-default { background-color: #ff5d20 !important; }
|
||||
.text-default { color: #ff5d20 !important; }
|
||||
|
||||
.entry-header .entry-title a:hover,
|
||||
.entry-header .entry-title a:focus {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> WooCommerce Menubar Cart Info
|
||||
--------------------------------------------------*/
|
||||
|
||||
.woo-cart-block > a .cart-total {
|
||||
background: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Main Slider
|
||||
--------------------------------------------------*/
|
||||
|
||||
#theme-main-slider.owl-carousel .owl-prev,
|
||||
#theme-main-slider.owl-carousel .owl-next {
|
||||
background-color: rgba(255, 93, 32,.6);
|
||||
border: 2px solid rgba(255, 93, 32,.1);
|
||||
color: #fff;
|
||||
}
|
||||
#theme-main-slider.owl-carousel .owl-prev:hover,
|
||||
#theme-main-slider.owl-carousel .owl-prev:focus,
|
||||
#theme-main-slider.owl-carousel .owl-next:hover,
|
||||
#theme-main-slider.owl-carousel .owl-next:focus {
|
||||
background-color: rgba(255, 93, 32,1);
|
||||
border: 2px solid rgba(255, 93, 32,1);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Slider Next/Prev Button Styles
|
||||
--------------------------------------------------*/
|
||||
|
||||
.owl-carousel .owl-prev:hover,
|
||||
.owl-carousel .owl-prev:focus,
|
||||
.owl-carousel .owl-next:hover,
|
||||
.owl-carousel .owl-next:focus {
|
||||
background-color: rgba(255, 93, 32, 1);
|
||||
border: 2px solid rgba(255, 93, 32, 1);
|
||||
}
|
||||
.owl-carousel .owl-prev:hover,
|
||||
.owl-carousel .owl-prev:focus,
|
||||
.owl-carousel .owl-next:hover,
|
||||
.owl-carousel .owl-next:focus,
|
||||
.theme-sponsors .owl-carousel .owl-prev:hover,
|
||||
.theme-sponsors .owl-carousel .owl-next:hover {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.owl-theme .owl-dots .owl-dot.active span {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.testimonial.bg-default .owl-theme .owl-dots .owl-dot.active span {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Section Title & Subtitle
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-separator-line-horrizontal-full {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Info Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-info-area i.icon {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.theme-info-area .media {
|
||||
border-bottom: 3px solid #ff5d20;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Service Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-services .service-content:hover {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.theme-services .service-content-thumbnail a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Project Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-project .theme-project-content a.popup:hover,
|
||||
.theme-project .theme-project-content a.popup:focus {
|
||||
background-color: #ff5d20;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Testimonial Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-testimonial-block .position {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Contact Page Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-contact-widget {
|
||||
border-bottom: 3px solid #ff5d20;
|
||||
}
|
||||
.theme-contact-widget i.fa {
|
||||
color: #ff5d20;
|
||||
}
|
||||
input[type="text"]:focus,
|
||||
input[type="email"]:focus,
|
||||
input[type="url"]:focus,
|
||||
input[type="password"]:focus,
|
||||
input[type="search"]:focus,
|
||||
input[type="number"]:focus,
|
||||
input[type="tel"]:focus,
|
||||
input[type="range"]:focus,
|
||||
input[type="date"]:focus,
|
||||
input[type="month"]:focus,
|
||||
input[type="week"]:focus,
|
||||
input[type="time"]:focus,
|
||||
input[type="datetime"]:focus,
|
||||
input[type="datetime-local"]:focus,
|
||||
input[type="color"]:focus,
|
||||
textarea:focus,
|
||||
select:focus,
|
||||
.form-control:focus {
|
||||
border-color: rgb(255, 93, 32);
|
||||
box-shadow: 0 0 5px rgba(255, 93, 32, 1) !important;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> 404 Error Page Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.theme-error-page .error-title b,
|
||||
.theme-error-page .error-title i {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Blog Sidebar
|
||||
--------------------------------------------------*/
|
||||
|
||||
.entry-content a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Blog Meta Info
|
||||
--------------------------------------------------*/
|
||||
|
||||
.entry-meta .posted-on::before,
|
||||
.entry-meta .author::before,
|
||||
.entry-meta .cat-links::before,
|
||||
.entry-meta .comment-links::before {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.entry-meta a:hover,
|
||||
.entry-meta a:focus {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
.entry-meta .cat-links a {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.entry-meta .tag-links a:hover,
|
||||
.entry-meta .tag-links a:focus {
|
||||
background-color: #ff5d20;
|
||||
border: 1px solid #ff5d20;
|
||||
}
|
||||
.entry-content .more-link:hover,
|
||||
.entry-content .more-link:focus {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
.pagination a:hover,
|
||||
.pagination a.active,
|
||||
.page-links a:hover,
|
||||
.post-nav-links a:hover,
|
||||
.post-nav-links .post-page-numbers.current {
|
||||
background-color: #ff5d20;
|
||||
border: 1px solid #ff5d20;
|
||||
}
|
||||
.pagination .nav-links .page-numbers.current {
|
||||
background-color: #ff5d20;
|
||||
border: 1px solid #ff5d20;
|
||||
}
|
||||
.comment-date,
|
||||
.comment-date a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.comment-detail p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.reply a {
|
||||
border: 2px solid #ff5d20;
|
||||
}
|
||||
.reply a:hover, .reply a:focus {
|
||||
border: 2px solid #ff5d20;
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.logged-in-as a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.logged-in-color a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Widgets Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.widget a:hover,
|
||||
.widget a:focus {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.widget button[type="submit"],
|
||||
.btn-success {
|
||||
background-color: #ff5d20;
|
||||
border-color: #ff5d20;
|
||||
}
|
||||
.widget .tagcloud a {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.widget .widget-title:after,
|
||||
.widget .wp-block-heading:after {
|
||||
background: #ff5d20;
|
||||
}
|
||||
address i {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget td a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.textwidget a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .textwidget a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .textwidget > address > a:hover,
|
||||
.footer-sidebar .textwidget > address > a:focus {
|
||||
color: #ff5d20 !important;
|
||||
}
|
||||
/*wp-block-search*/
|
||||
.wp-block-search .wp-block-search__button {
|
||||
background: #ff5d20;
|
||||
border: 1px solid #ff5d20;
|
||||
}
|
||||
/*wp-calendar-nav widget*/
|
||||
.wp-calendar-nav .wp-calendar-nav-prev > a,
|
||||
.wp-calendar-nav .wp-calendar-nav-next > a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.wp-calendar-nav .wp-calendar-nav-prev > a:hover,
|
||||
.wp-calendar-nav .wp-calendar-nav-next > a:hover,
|
||||
.wp-calendar-nav .wp-calendar-nav-prev > a:focus,
|
||||
.wp-calendar-nav .wp-calendar-nav-next > a:focus {
|
||||
color: #ff5d20;
|
||||
box-shadow: 0 1px 0 0 currentColor;
|
||||
}
|
||||
/*wp-block-latest-comments*/
|
||||
.wp-block-latest-comments__comment-date {
|
||||
color: #ff5d20;
|
||||
}
|
||||
/*rsswidget title color*/
|
||||
.widget_rss ul li .rsswidget {
|
||||
color: #ff5d20;
|
||||
}
|
||||
/*Recent Comment list style color*/
|
||||
.widget_recent_comments .recentcomments {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
## Blog Author
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.theme-blog-author .website-url a { color: #ff5d20; }
|
||||
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
## Captions
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.wp-caption-text a { color: #ff5d20; }
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Site Footer Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.footer-sidebar .widget a:hover,
|
||||
.footer-sidebar .widget a:focus {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Theme Site Info Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.site-info a,
|
||||
.site-info a:hover,
|
||||
.site-info a:focus {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Sidebar Widget Style Css According to WordPress 5.8
|
||||
--------------------------------------------------*/
|
||||
|
||||
.sidebar .widget .wp-block-search .wp-block-search__label:after {
|
||||
background: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-tag-cloud a {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .logged-in a, .sidebar .widget .wp-block-group .logged-out a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-pullquote cite a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-media-text a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-code a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group pre.wp-block-verse a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-table figcaption a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-preformatted a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .is-nowrap p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .is-vertical p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group a.wp-block-read-more {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget.widget_block .wp-block-group p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.theme-blog .post .entry-content .wp-block-file .wp-block-file__button {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.theme-blog .post .wp-block-latest-comments .wp-block-latest-comments__comment-author:hover,
|
||||
.theme-blog .post .wp-block-latest-comments .wp-block-latest-comments__comment-link:hover {
|
||||
color: #FF5D20;
|
||||
}
|
||||
.entry-content .wp-caption-text a:hover,
|
||||
.entry-content figcaption a:hover { color: #FF5D20; }
|
||||
.sidebar .widget .wp-block-group .wp-block-image figcaption a {
|
||||
color: #FF5D20;
|
||||
}
|
||||
.sidebar .widget .wp-block-group .wp-block-quote cite a {
|
||||
color: #FF5D20;
|
||||
}
|
||||
.wp-block-cover.has-background-dim-60.has-background-dim .wp-block-cover-text a:hover {
|
||||
color: #FF5D20;
|
||||
}
|
||||
.entry-content blockquote cite a:hover,
|
||||
.entry-content blockquote cite a:focus {
|
||||
color: #ff5d20;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.theme-blog .post .entry-content ul.wp-block-page-list li.wp-block-navigation-item a:hover {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-file .wp-block-file__button {
|
||||
background: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-embed .wp-element-caption a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
/*Woocommerce Styles*/
|
||||
.wp-block-woocommerce-cart .wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button {
|
||||
background: #ff5d20;
|
||||
border: solid 1px #ff5d20;
|
||||
}
|
||||
.wp-block-woocommerce-cart .wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button:hover,
|
||||
.wp-block-woocommerce-cart .wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button:focus {
|
||||
background: #ff5d20;
|
||||
border: solid 1px #ff5d20;
|
||||
}
|
||||
.widget .wp-block-heading a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.sidebar .widget .wp-block-list a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
=>> Footer Sidebar Widget Style Css According to WordPress 5.8
|
||||
------------------------------------------------------------*/
|
||||
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-tag-cloud a {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .logged-in a,
|
||||
.footer-sidebar .widget .wp-block-group .logged-out a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-media-text a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-pullquote cite a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-code a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group pre.wp-block-verse a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-table figcaption a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-preformatted a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .is-nowrap p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .is-vertical p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget.widget_block .wp-block-group p a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .is-nowrap a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-image figcaption a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-group .wp-block-quote cite a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget dl a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .wp-block-embed .wp-element-caption a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-read-more {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.footer-sidebar .widget .wp-block-file .wp-block-file__button {
|
||||
background: #ff5d20;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Page Scroll Up/Down Area
|
||||
--------------------------------------------------*/
|
||||
|
||||
.page-scroll-up a,
|
||||
.page-scroll-up a:hover,
|
||||
.page-scroll-up a:active {
|
||||
background: #ff5d20;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
=>> Shop Products
|
||||
--------------------------------------------------*/
|
||||
|
||||
/*Product Buttons*/
|
||||
|
||||
.woocommerce ul.products li.product .button.add_to_cart_button,
|
||||
.woocommerce ul.products li.product .button.product_type_grouped,
|
||||
.woocommerce ul.products li.product .button.product_type_simple,
|
||||
.woocommerce ul.products li.product .button.product_type_external,
|
||||
.woocommerce ul.products li.product .button.product_type_variable,
|
||||
.theme-block.shop .product .button.add_to_cart_button,
|
||||
.theme-block.shop .product .button.product_type_grouped,
|
||||
.theme-block.shop .product .button.product_type_simple,
|
||||
.theme-block.shop .product .button.product_type_external,
|
||||
.theme-block.shop .product .button.product_type_variable {
|
||||
background-color: rgba(255, 93, 32, .6);
|
||||
border: 2px solid rgba(255, 93, 32, .1);
|
||||
}
|
||||
.woocommerce ul.products li.product .button:hover,
|
||||
.woocommerce ul.products li.product .button:focus,
|
||||
.theme-block.shop .product .button:hover,
|
||||
.theme-block.shop .product .button:focus {
|
||||
background-color: rgba(255, 93, 32, 1);
|
||||
border: 2px solid rgba(255, 93, 32, 1);
|
||||
}
|
||||
.woocommerce ul.products li.product .button.add_to_cart_button,
|
||||
.woocommerce ul.products li.product .button.product_type_simple {
|
||||
background-color: rgba(255, 93, 32,.6);
|
||||
border: 2px solid rgba(255, 93, 32,.1);
|
||||
}
|
||||
.woocommerce ul.products li.product .button.add_to_cart_button:hover,
|
||||
.woocommerce ul.products li.product .button.add_to_cart_button:focus,
|
||||
.woocommerce ul.products li.product .button.product_type_simple:hover,
|
||||
.woocommerce ul.products li.product .button.product_type_simple:focus {
|
||||
background-color: rgba(255, 93, 32,1);
|
||||
border: 2px solid rgba(255, 93, 32,1);
|
||||
}
|
||||
/*Product Single View*/
|
||||
.woocommerce div.product form.cart .button:hover,
|
||||
.woocommerce div.product form.cart .button:hover {
|
||||
background: #ff5d20;
|
||||
}
|
||||
.woocommerce table.shop_table td.product-name,
|
||||
.woocommerce table.shop_table td.product-name a {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.product_meta .posted_in a:hover,
|
||||
.product_meta .tagged_as a:hover {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.woocommerce #review_form #respond .form-submit input:hover {
|
||||
background: #ff5d20;
|
||||
}
|
||||
/*Product Cart View*/
|
||||
.woocommerce .woocommerce-error .button,
|
||||
.woocommerce .woocommerce-info .button,
|
||||
.woocommerce .woocommerce-message .button,
|
||||
.woocommerce-page .woocommerce-error .button,
|
||||
.woocommerce-page .woocommerce-info .button,
|
||||
.woocommerce-page .woocommerce-message .button {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
/*Product Cart Table*/
|
||||
.woocommerce table.shop_table td.product-name a:hover,
|
||||
.woocommerce table.shop_table td.product-subtotal .woocommerce-Price-amount {
|
||||
color: #ff5d20;
|
||||
}
|
||||
.woocommerce-cart table.cart td.actions .coupon button.button:hover {
|
||||
background: #ff5d20;
|
||||
color: #fff;
|
||||
}
|
||||
.woocommerce-cart table.cart td.actions button.button {
|
||||
background: #ff5d20;
|
||||
color: #fff;
|
||||
}
|
||||
#add_payment_method .wc-proceed-to-checkout a.checkout-button,
|
||||
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
|
||||
.woocommerce-checkout .wc-proceed-to-checkout a.checkout-button,
|
||||
.woocommerce .woocommerce-form-login .woocommerce-form-login__submit,
|
||||
.woocommerce button.button.woocommerce-Button {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.checkout_coupon.woocommerce-form-coupon .form-row button.button:hover {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.woocommerce #payment #place_order,
|
||||
.woocommerce-page #payment #place_order {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
/*WooCommerce Widgets*/
|
||||
.woocommerce .widget_price_filter .ui-slider .ui-slider-handle {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.woocommerce .widget_price_filter .price_slider_amount .button {
|
||||
background-color: #ff5d20;
|
||||
}
|
||||
.woocommerce-mini-cart__buttons.buttons a.button,
|
||||
.widget .woocommerce-mini-cart__buttons.buttons a.button:hover,
|
||||
.widget .woocommerce-mini-cart__buttons.buttons a.button:focus {
|
||||
background-color: #ff5d20;
|
||||
color: #fff;
|
||||
}
|
||||
/*WooCommerce Pagination*/
|
||||
.woocommerce nav.woocommerce-pagination ul li a:focus,
|
||||
.woocommerce nav.woocommerce-pagination ul li a:hover,
|
||||
.woocommerce nav.woocommerce-pagination ul li span.current {
|
||||
background-color: #ff5d20;
|
||||
border: 1px solid #ff5d20;
|
||||
color: #fff;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
wp-content/themes/consultstreet/assets/img/page-header-bg.jpg
Normal file
BIN
wp-content/themes/consultstreet/assets/img/page-header-bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 250 KiB |
BIN
wp-content/themes/consultstreet/assets/img/shadow.png
Normal file
BIN
wp-content/themes/consultstreet/assets/img/shadow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
@ -0,0 +1,8 @@
|
||||
jQuery(function($) {'use strict';
|
||||
|
||||
//Initiat WOW JS
|
||||
new WOW().init();
|
||||
//smoothScroll
|
||||
//smoothScroll.init();
|
||||
|
||||
});
|
||||
3894
wp-content/themes/consultstreet/assets/js/bootstrap.js
vendored
Normal file
3894
wp-content/themes/consultstreet/assets/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,26 @@
|
||||
( function( $ ){
|
||||
$( document ).ready( function(){
|
||||
$( '.consultstreet-btn-get-started' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
$( this ).html( 'Processing.. Please wait' ).addClass( 'updating-message' );
|
||||
$.post( consultstreet_ajax_object.ajax_url, { 'action' : 'install_act_plugin' }, function( response ){
|
||||
location.href = 'customize.php?arile_notice=dismiss-get-started';
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
$( document ).on( 'click', '.notice-get-started-class .notice-dismiss', function () {
|
||||
// Read the "data-notice" information to track which notice
|
||||
// is being dismissed and send it via AJAX
|
||||
var type = $( this ).closest( '.notice-get-started-class' ).data( 'notice' );
|
||||
// Make an AJAX call
|
||||
$.ajax( ajaxurl,
|
||||
{
|
||||
type: 'POST',
|
||||
data: {
|
||||
action: 'consultstreet_dismissed_notice_handler',
|
||||
type: type,
|
||||
}
|
||||
} );
|
||||
} );
|
||||
}( jQuery ) )
|
||||
101
wp-content/themes/consultstreet/assets/js/custom.js
Normal file
101
wp-content/themes/consultstreet/assets/js/custom.js
Normal file
@ -0,0 +1,101 @@
|
||||
// OWL SLIDER CUSTOM JS
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/* ---------------------------------------------- /*
|
||||
* Header Sticky
|
||||
/* ---------------------------------------------- */
|
||||
|
||||
jQuery(window).scroll(function(){
|
||||
if (jQuery(window).scrollTop() >= 100) {
|
||||
jQuery('.header-sticky').addClass('header-fixed-top');
|
||||
jQuery('.header-sticky').removeClass('not-sticky');
|
||||
}
|
||||
else {
|
||||
jQuery('.header-sticky').removeClass('header-fixed-top');
|
||||
jQuery('.header-sticky').addClass('not-sticky');
|
||||
}
|
||||
});
|
||||
|
||||
/* ---------------------------------------------- /*
|
||||
* Scroll top
|
||||
/* ---------------------------------------------- */
|
||||
|
||||
jQuery(window).scroll(function() {
|
||||
if (jQuery(this).scrollTop() > 100) {
|
||||
jQuery('.page-scroll-up').fadeIn();
|
||||
} else {
|
||||
jQuery('.page-scroll-up').fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('a[href="#totop"]').click(function() {
|
||||
jQuery('html, body').animate({ scrollTop: 0 }, 'slow');
|
||||
return false;
|
||||
});
|
||||
|
||||
// This JS added for the Toggle button to work with the focus element.
|
||||
if (window.innerWidth < 992) {
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
let isTabPressed = e.key === 'Tab' || e.keyCode === 9;
|
||||
if (!isTabPressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const focusableElements =
|
||||
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
||||
const modal = document.querySelector('.navbar.navbar-expand-lg'); // select the modal by it's id
|
||||
|
||||
const firstFocusableElement = modal.querySelectorAll(focusableElements)[1]; // get first element to be focused inside modal
|
||||
const focusableContent = modal.querySelectorAll(focusableElements);
|
||||
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal
|
||||
|
||||
if (e.shiftKey) { // if shift key pressed for shift + tab combination
|
||||
if (document.activeElement === firstFocusableElement) {
|
||||
lastFocusableElement.focus(); // add focus for the last focusable element
|
||||
e.preventDefault();
|
||||
}
|
||||
} else { // if tab key is pressed
|
||||
if (document.activeElement === lastFocusableElement) { // if focused has reached to last focusable element then focus first focusable element after pressing tab
|
||||
firstFocusableElement.focus(); // add focus for the first focusable element
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Accodian Js
|
||||
function toggleIcon(e) {
|
||||
jQuery(e.target)
|
||||
.prev('.panel-heading')
|
||||
.find(".more-less")
|
||||
.toggleClass('fa-plus-square-o fa-minus-square-o');
|
||||
}
|
||||
jQuery('.panel-group').on('hidden.bs.collapse', toggleIcon);
|
||||
jQuery('.panel-group').on('shown.bs.collapse', toggleIcon);
|
||||
|
||||
|
||||
jQuery("#theme-main-slider").owlCarousel({
|
||||
navigation : true, // Show next and prev buttons
|
||||
slideSpeed : 300,
|
||||
autoplay : 7000,
|
||||
smartSpeed: 1000,
|
||||
autoplayTimeout: 2500,
|
||||
autoplayHoverPause:true,
|
||||
singleItem:true,
|
||||
mouseDrag: true,
|
||||
loop:true, // loop is true up to 1199px screen.
|
||||
nav:true, // is true across all sizes
|
||||
margin:0, // margin 10px till 960 breakpoint
|
||||
autoHeight: true,
|
||||
responsiveClass:true, // Optional helper class. Add 'owl-reponsive-' + 'breakpoint' class to main element.
|
||||
items: 1,
|
||||
dots: false,
|
||||
navText: ["<i class='fa fa-long-arrow-left'></i>","<i class='fa fa-long-arrow-right'></i>"]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
3448
wp-content/themes/consultstreet/assets/js/owl.carousel.js
Normal file
3448
wp-content/themes/consultstreet/assets/js/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load Diff
6
wp-content/themes/consultstreet/assets/js/owl.carousel.min.css
vendored
Normal file
6
wp-content/themes/consultstreet/assets/js/owl.carousel.min.css
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Owl Carousel v2.3.4
|
||||
* Copyright 2013-2018 David Deutsch
|
||||
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
||||
*/
|
||||
.owl-carousel,.owl-carousel .owl-item{-webkit-tap-highlight-color:transparent;position:relative}.owl-carousel{display:none;width:100%;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y;touch-action:manipulation;-moz-backface-visibility:hidden}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0,0,0)}.owl-carousel .owl-item,.owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.owl-carousel .owl-item{min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%}.owl-carousel .owl-dots.disabled,.owl-carousel .owl-nav.disabled{display:none}.no-js .owl-carousel,.owl-carousel.owl-loaded{display:block}.owl-carousel .owl-dot,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-nav .owl-prev{cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel .owl-nav button.owl-next,.owl-carousel .owl-nav button.owl-prev,.owl-carousel button.owl-dot{background:0 0;color:inherit;border:none;padding:0!important;font:inherit}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-ms-touch-action:pan-y;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.owl-carousel .animated{animation-duration:1s;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height .5s ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity .4s ease}.owl-carousel .owl-item .owl-lazy:not([src]),.owl-carousel .owl-item .owl-lazy[src^=""]{max-height:0}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform .1s ease}.owl-carousel .owl-video-play-icon:hover{-ms-transform:scale(1.3,1.3);transform:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity .4s ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}
|
||||
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* File skip-link-focus-fix.js.
|
||||
*
|
||||
* Helps with accessibility for keyboard only users.
|
||||
*
|
||||
* Learn more: https://git.io/vWdr2
|
||||
*/
|
||||
( function() {
|
||||
var isIe = /(trident|msie)/i.test( navigator.userAgent );
|
||||
|
||||
if ( isIe && document.getElementById && window.addEventListener ) {
|
||||
window.addEventListener( 'hashchange', function() {
|
||||
var id = location.hash.substring( 1 ),
|
||||
element;
|
||||
|
||||
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
element = document.getElementById( id );
|
||||
|
||||
if ( element ) {
|
||||
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
|
||||
element.tabIndex = -1;
|
||||
}
|
||||
|
||||
element.focus();
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
} )();
|
||||
166
wp-content/themes/consultstreet/assets/js/smartmenus/bootstrap-smartmenus.js
vendored
Normal file
166
wp-content/themes/consultstreet/assets/js/smartmenus/bootstrap-smartmenus.js
vendored
Normal file
@ -0,0 +1,166 @@
|
||||
/*!
|
||||
* SmartMenus jQuery Plugin Bootstrap 4 Addon - v0.1.0 - September 17, 2017
|
||||
* http://www.smartmenus.org/
|
||||
*
|
||||
* Copyright Vasil Dinkov, Vadikom Web Ltd.
|
||||
* http://vadikom.com
|
||||
*
|
||||
* Licensed MIT
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery', 'smartmenus'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Global jQuery
|
||||
factory(jQuery);
|
||||
}
|
||||
} (function($) {
|
||||
|
||||
$.extend($.SmartMenus.Bootstrap = {}, {
|
||||
keydownFix: false,
|
||||
init: function() {
|
||||
// init all navbars that don't have the "data-sm-skip" attribute set
|
||||
var $navbars = $('ul.navbar-nav:not([data-sm-skip])');
|
||||
$navbars.each(function() {
|
||||
var $this = $(this),
|
||||
obj = $this.data('smartmenus');
|
||||
// if this navbar is not initialized
|
||||
if (!obj) {
|
||||
var skipBehavior = $this.is('[data-sm-skip-collapsible-behavior]'),
|
||||
rightAligned = $this.hasClass('ml-auto') || $this.prevAll('.mr-auto').length > 0;
|
||||
|
||||
$this.smartmenus({
|
||||
// these are some good default options that should work for all
|
||||
subMenusSubOffsetX: 2,
|
||||
subMenusSubOffsetY: -9,
|
||||
subIndicators: !skipBehavior,
|
||||
collapsibleShowFunction: null,
|
||||
collapsibleHideFunction: null,
|
||||
rightToLeftSubMenus: rightAligned,
|
||||
bottomToTopSubMenus: $this.closest('.fixed-bottom').length > 0
|
||||
// custom option(s) for the Bootstrap 4 addon
|
||||
//bootstrapHighlightClasses: 'text-dark bg-light'
|
||||
})
|
||||
.on({
|
||||
// set/unset proper Bootstrap classes for some menu elements
|
||||
'show.smapi': function(e, menu) {
|
||||
var $menu = $(menu),
|
||||
$scrollArrows = $menu.dataSM('scroll-arrows');
|
||||
if ($scrollArrows) {
|
||||
$scrollArrows.css('background-color', $menu.css('background-color'));
|
||||
}
|
||||
$menu.parent().addClass('show');
|
||||
if (obj.opts.keepHighlighted && $menu.dataSM('level') > 2) {
|
||||
$menu.prevAll('a').addClass(obj.opts.bootstrapHighlightClasses);
|
||||
}
|
||||
},
|
||||
'hide.smapi': function(e, menu) {
|
||||
var $menu = $(menu);
|
||||
$menu.parent().removeClass('show');
|
||||
if (obj.opts.keepHighlighted && $menu.dataSM('level') > 2) {
|
||||
$menu.prevAll('a').removeClass(obj.opts.bootstrapHighlightClasses);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
obj = $this.data('smartmenus');
|
||||
|
||||
function onInit() {
|
||||
// set Bootstrap's "active" class to SmartMenus "current" items (should someone decide to enable markCurrentItem: true)
|
||||
$this.find('a.current').each(function() {
|
||||
var $this = $(this);
|
||||
// dropdown items require the class to be set to the A's while for nav items it should be set to the parent LI's
|
||||
($this.hasClass('dropdown-item') ? $this : $this.parent()).addClass('active');
|
||||
});
|
||||
// parent items fixes
|
||||
$this.find('a.has-submenu').each(function() {
|
||||
var $this = $(this);
|
||||
// remove Bootstrap required attributes that might cause conflicting issues with the SmartMenus script
|
||||
if ($this.is('[data-toggle="dropdown"]')) {
|
||||
$this.dataSM('bs-data-toggle-dropdown', true).removeAttr('data-toggle');
|
||||
}
|
||||
// remove Bootstrap's carets generating class
|
||||
if (!skipBehavior && $this.hasClass('dropdown-toggle')) {
|
||||
$this.dataSM('bs-dropdown-toggle', true).removeClass('dropdown-toggle');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onInit();
|
||||
|
||||
function onBeforeDestroy() {
|
||||
$this.find('a.current').each(function() {
|
||||
var $this = $(this);
|
||||
($this.hasClass('active') ? $this : $this.parent()).removeClass('active');
|
||||
});
|
||||
$this.find('a.has-submenu').each(function() {
|
||||
var $this = $(this);
|
||||
if ($this.dataSM('bs-dropdown-toggle')) {
|
||||
$this.addClass('dropdown-toggle').removeDataSM('bs-dropdown-toggle');
|
||||
}
|
||||
if ($this.dataSM('bs-data-toggle-dropdown')) {
|
||||
$this.attr('data-toggle', 'dropdown').removeDataSM('bs-data-toggle-dropdown');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// custom "refresh" method for Bootstrap
|
||||
obj.refresh = function() {
|
||||
$.SmartMenus.prototype.refresh.call(this);
|
||||
onInit();
|
||||
// update collapsible detection
|
||||
detectCollapsible(true);
|
||||
};
|
||||
|
||||
// custom "destroy" method for Bootstrap
|
||||
obj.destroy = function(refresh) {
|
||||
onBeforeDestroy();
|
||||
$.SmartMenus.prototype.destroy.call(this, refresh);
|
||||
};
|
||||
|
||||
// keep Bootstrap's default behavior (i.e. use the whole item area just as a sub menu toggle)
|
||||
if (skipBehavior) {
|
||||
obj.opts.collapsibleBehavior = 'toggle';
|
||||
}
|
||||
|
||||
// onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class
|
||||
var winW;
|
||||
function detectCollapsible(force) {
|
||||
var newW = obj.getViewportWidth();
|
||||
if (newW != winW || force) {
|
||||
if (obj.isCollapsible()) {
|
||||
$this.addClass('sm-collapsible');
|
||||
} else {
|
||||
$this.removeClass('sm-collapsible');
|
||||
}
|
||||
winW = newW;
|
||||
}
|
||||
}
|
||||
detectCollapsible();
|
||||
$(window).on('resize.smartmenus' + obj.rootId, detectCollapsible);
|
||||
}
|
||||
});
|
||||
// keydown fix for Bootstrap 4 conflict
|
||||
if ($navbars.length && !$.SmartMenus.Bootstrap.keydownFix) {
|
||||
// unhook BS keydown handler for all dropdowns
|
||||
$(document).off('keydown.bs.dropdown.data-api', '.dropdown-menu');
|
||||
// restore BS keydown handler for dropdowns that are not inside SmartMenus navbars
|
||||
// SmartMenus won't add the "show" class so it's handy here
|
||||
if ($.fn.dropdown && $.fn.dropdown.Constructor) {
|
||||
$(document).on('keydown.bs.dropdown.data-api', '.dropdown-menu.show', $.fn.dropdown.Constructor._dataApiKeydownHandler);
|
||||
}
|
||||
$.SmartMenus.Bootstrap.keydownFix = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// init ondomready
|
||||
$($.SmartMenus.Bootstrap.init);
|
||||
|
||||
return $;
|
||||
}));
|
||||
File diff suppressed because it is too large
Load Diff
509
wp-content/themes/consultstreet/assets/js/wow.js
Normal file
509
wp-content/themes/consultstreet/assets/js/wow.js
Normal file
@ -0,0 +1,509 @@
|
||||
(function() {
|
||||
var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,
|
||||
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
Util = (function() {
|
||||
function Util() {}
|
||||
|
||||
Util.prototype.extend = function(custom, defaults) {
|
||||
var key, value;
|
||||
for (key in defaults) {
|
||||
value = defaults[key];
|
||||
if (custom[key] == null) {
|
||||
custom[key] = value;
|
||||
}
|
||||
}
|
||||
return custom;
|
||||
};
|
||||
|
||||
Util.prototype.isMobile = function(agent) {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
|
||||
};
|
||||
|
||||
Util.prototype.createEvent = function(event, bubble, cancel, detail) {
|
||||
var customEvent;
|
||||
if (bubble == null) {
|
||||
bubble = false;
|
||||
}
|
||||
if (cancel == null) {
|
||||
cancel = false;
|
||||
}
|
||||
if (detail == null) {
|
||||
detail = null;
|
||||
}
|
||||
if (document.createEvent != null) {
|
||||
customEvent = document.createEvent('CustomEvent');
|
||||
customEvent.initCustomEvent(event, bubble, cancel, detail);
|
||||
} else if (document.createEventObject != null) {
|
||||
customEvent = document.createEventObject();
|
||||
customEvent.eventType = event;
|
||||
} else {
|
||||
customEvent.eventName = event;
|
||||
}
|
||||
return customEvent;
|
||||
};
|
||||
|
||||
Util.prototype.emitEvent = function(elem, event) {
|
||||
if (elem.dispatchEvent != null) {
|
||||
return elem.dispatchEvent(event);
|
||||
} else if (event in (elem != null)) {
|
||||
return elem[event]();
|
||||
} else if (("on" + event) in (elem != null)) {
|
||||
return elem["on" + event]();
|
||||
}
|
||||
};
|
||||
|
||||
Util.prototype.addEvent = function(elem, event, fn) {
|
||||
if (elem.addEventListener != null) {
|
||||
return elem.addEventListener(event, fn, false);
|
||||
} else if (elem.attachEvent != null) {
|
||||
return elem.attachEvent("on" + event, fn);
|
||||
} else {
|
||||
return elem[event] = fn;
|
||||
}
|
||||
};
|
||||
|
||||
Util.prototype.removeEvent = function(elem, event, fn) {
|
||||
if (elem.removeEventListener != null) {
|
||||
return elem.removeEventListener(event, fn, false);
|
||||
} else if (elem.detachEvent != null) {
|
||||
return elem.detachEvent("on" + event, fn);
|
||||
} else {
|
||||
return delete elem[event];
|
||||
}
|
||||
};
|
||||
|
||||
Util.prototype.innerHeight = function() {
|
||||
if ('innerHeight' in window) {
|
||||
return window.innerHeight;
|
||||
} else {
|
||||
return document.documentElement.clientHeight;
|
||||
}
|
||||
};
|
||||
|
||||
return Util;
|
||||
|
||||
})();
|
||||
|
||||
WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
|
||||
function WeakMap() {
|
||||
this.keys = [];
|
||||
this.values = [];
|
||||
}
|
||||
|
||||
WeakMap.prototype.get = function(key) {
|
||||
var i, item, j, len, ref;
|
||||
ref = this.keys;
|
||||
for (i = j = 0, len = ref.length; j < len; i = ++j) {
|
||||
item = ref[i];
|
||||
if (item === key) {
|
||||
return this.values[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WeakMap.prototype.set = function(key, value) {
|
||||
var i, item, j, len, ref;
|
||||
ref = this.keys;
|
||||
for (i = j = 0, len = ref.length; j < len; i = ++j) {
|
||||
item = ref[i];
|
||||
if (item === key) {
|
||||
this.values[i] = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.keys.push(key);
|
||||
return this.values.push(value);
|
||||
};
|
||||
|
||||
return WeakMap;
|
||||
|
||||
})());
|
||||
|
||||
MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
|
||||
function MutationObserver() {
|
||||
if (typeof console !== "undefined" && console !== null) {
|
||||
console.warn('MutationObserver is not supported by your browser.');
|
||||
}
|
||||
if (typeof console !== "undefined" && console !== null) {
|
||||
console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');
|
||||
}
|
||||
}
|
||||
|
||||
MutationObserver.notSupported = true;
|
||||
|
||||
MutationObserver.prototype.observe = function() {};
|
||||
|
||||
return MutationObserver;
|
||||
|
||||
})());
|
||||
|
||||
getComputedStyle = this.getComputedStyle || function(el, pseudo) {
|
||||
this.getPropertyValue = function(prop) {
|
||||
var ref;
|
||||
if (prop === 'float') {
|
||||
prop = 'styleFloat';
|
||||
}
|
||||
if (getComputedStyleRX.test(prop)) {
|
||||
prop.replace(getComputedStyleRX, function(_, _char) {
|
||||
return _char.toUpperCase();
|
||||
});
|
||||
}
|
||||
return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null;
|
||||
};
|
||||
return this;
|
||||
};
|
||||
|
||||
getComputedStyleRX = /(\-([a-z]){1})/g;
|
||||
|
||||
this.WOW = (function() {
|
||||
WOW.prototype.defaults = {
|
||||
boxClass: 'wow',
|
||||
animateClass: 'animated',
|
||||
offset: 0,
|
||||
mobile: true,
|
||||
live: true,
|
||||
callback: null
|
||||
};
|
||||
|
||||
function WOW(options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
this.scrollCallback = bind(this.scrollCallback, this);
|
||||
this.scrollHandler = bind(this.scrollHandler, this);
|
||||
this.resetAnimation = bind(this.resetAnimation, this);
|
||||
this.start = bind(this.start, this);
|
||||
this.scrolled = true;
|
||||
this.config = this.util().extend(options, this.defaults);
|
||||
this.animationNameCache = new WeakMap();
|
||||
this.wowEvent = this.util().createEvent(this.config.boxClass);
|
||||
}
|
||||
|
||||
WOW.prototype.init = function() {
|
||||
var ref;
|
||||
this.element = window.document.documentElement;
|
||||
if ((ref = document.readyState) === "interactive" || ref === "complete") {
|
||||
this.start();
|
||||
} else {
|
||||
this.util().addEvent(document, 'DOMContentLoaded', this.start);
|
||||
}
|
||||
return this.finished = [];
|
||||
};
|
||||
|
||||
WOW.prototype.start = function() {
|
||||
var box, j, len, ref;
|
||||
this.stopped = false;
|
||||
this.boxes = (function() {
|
||||
var j, len, ref, results;
|
||||
ref = this.element.querySelectorAll("." + this.config.boxClass);
|
||||
results = [];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
box = ref[j];
|
||||
results.push(box);
|
||||
}
|
||||
return results;
|
||||
}).call(this);
|
||||
this.all = (function() {
|
||||
var j, len, ref, results;
|
||||
ref = this.boxes;
|
||||
results = [];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
box = ref[j];
|
||||
results.push(box);
|
||||
}
|
||||
return results;
|
||||
}).call(this);
|
||||
if (this.boxes.length) {
|
||||
if (this.disabled()) {
|
||||
this.resetStyle();
|
||||
} else {
|
||||
ref = this.boxes;
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
box = ref[j];
|
||||
this.applyStyle(box, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.disabled()) {
|
||||
this.util().addEvent(window, 'scroll', this.scrollHandler);
|
||||
this.util().addEvent(window, 'resize', this.scrollHandler);
|
||||
this.interval = setInterval(this.scrollCallback, 50);
|
||||
}
|
||||
if (this.config.live) {
|
||||
return new MutationObserver((function(_this) {
|
||||
return function(records) {
|
||||
var k, len1, node, record, results;
|
||||
results = [];
|
||||
for (k = 0, len1 = records.length; k < len1; k++) {
|
||||
record = records[k];
|
||||
results.push((function() {
|
||||
var l, len2, ref1, results1;
|
||||
ref1 = record.addedNodes || [];
|
||||
results1 = [];
|
||||
for (l = 0, len2 = ref1.length; l < len2; l++) {
|
||||
node = ref1[l];
|
||||
results1.push(this.doSync(node));
|
||||
}
|
||||
return results1;
|
||||
}).call(_this));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
})(this)).observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.stop = function() {
|
||||
this.stopped = true;
|
||||
this.util().removeEvent(window, 'scroll', this.scrollHandler);
|
||||
this.util().removeEvent(window, 'resize', this.scrollHandler);
|
||||
if (this.interval != null) {
|
||||
return clearInterval(this.interval);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.sync = function(element) {
|
||||
if (MutationObserver.notSupported) {
|
||||
return this.doSync(this.element);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.doSync = function(element) {
|
||||
var box, j, len, ref, results;
|
||||
if (element == null) {
|
||||
element = this.element;
|
||||
}
|
||||
if (element.nodeType !== 1) {
|
||||
return;
|
||||
}
|
||||
element = element.parentNode || element;
|
||||
ref = element.querySelectorAll("." + this.config.boxClass);
|
||||
results = [];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
box = ref[j];
|
||||
if (indexOf.call(this.all, box) < 0) {
|
||||
this.boxes.push(box);
|
||||
this.all.push(box);
|
||||
if (this.stopped || this.disabled()) {
|
||||
this.resetStyle();
|
||||
} else {
|
||||
this.applyStyle(box, true);
|
||||
}
|
||||
results.push(this.scrolled = true);
|
||||
} else {
|
||||
results.push(void 0);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
WOW.prototype.show = function(box) {
|
||||
this.applyStyle(box);
|
||||
box.className = box.className + " " + this.config.animateClass;
|
||||
if (this.config.callback != null) {
|
||||
this.config.callback(box);
|
||||
}
|
||||
this.util().emitEvent(box, this.wowEvent);
|
||||
this.util().addEvent(box, 'animationend', this.resetAnimation);
|
||||
this.util().addEvent(box, 'oanimationend', this.resetAnimation);
|
||||
this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);
|
||||
this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);
|
||||
return box;
|
||||
};
|
||||
|
||||
WOW.prototype.applyStyle = function(box, hidden) {
|
||||
var delay, duration, iteration;
|
||||
duration = box.getAttribute('data-wow-duration');
|
||||
delay = box.getAttribute('data-wow-delay');
|
||||
iteration = box.getAttribute('data-wow-iteration');
|
||||
return this.animate((function(_this) {
|
||||
return function() {
|
||||
return _this.customStyle(box, hidden, duration, delay, iteration);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
WOW.prototype.animate = (function() {
|
||||
if ('requestAnimationFrame' in window) {
|
||||
return function(callback) {
|
||||
return window.requestAnimationFrame(callback);
|
||||
};
|
||||
} else {
|
||||
return function(callback) {
|
||||
return callback();
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
WOW.prototype.resetStyle = function() {
|
||||
var box, j, len, ref, results;
|
||||
ref = this.boxes;
|
||||
results = [];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
box = ref[j];
|
||||
results.push(box.style.visibility = 'visible');
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
WOW.prototype.resetAnimation = function(event) {
|
||||
var target;
|
||||
if (event.type.toLowerCase().indexOf('animationend') >= 0) {
|
||||
target = event.target || event.srcElement;
|
||||
return target.className = target.className.replace(this.config.animateClass, '').trim();
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
|
||||
if (hidden) {
|
||||
this.cacheAnimationName(box);
|
||||
}
|
||||
box.style.visibility = hidden ? 'hidden' : 'visible';
|
||||
if (duration) {
|
||||
this.vendorSet(box.style, {
|
||||
animationDuration: duration
|
||||
});
|
||||
}
|
||||
if (delay) {
|
||||
this.vendorSet(box.style, {
|
||||
animationDelay: delay
|
||||
});
|
||||
}
|
||||
if (iteration) {
|
||||
this.vendorSet(box.style, {
|
||||
animationIterationCount: iteration
|
||||
});
|
||||
}
|
||||
this.vendorSet(box.style, {
|
||||
animationName: hidden ? 'none' : this.cachedAnimationName(box)
|
||||
});
|
||||
return box;
|
||||
};
|
||||
|
||||
WOW.prototype.vendors = ["moz", "webkit"];
|
||||
|
||||
WOW.prototype.vendorSet = function(elem, properties) {
|
||||
var name, results, value, vendor;
|
||||
results = [];
|
||||
for (name in properties) {
|
||||
value = properties[name];
|
||||
elem["" + name] = value;
|
||||
results.push((function() {
|
||||
var j, len, ref, results1;
|
||||
ref = this.vendors;
|
||||
results1 = [];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
vendor = ref[j];
|
||||
results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);
|
||||
}
|
||||
return results1;
|
||||
}).call(this));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
WOW.prototype.vendorCSS = function(elem, property) {
|
||||
var j, len, ref, result, style, vendor;
|
||||
style = getComputedStyle(elem);
|
||||
result = style.getPropertyCSSValue(property);
|
||||
ref = this.vendors;
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
vendor = ref[j];
|
||||
result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
WOW.prototype.animationName = function(box) {
|
||||
var animationName;
|
||||
try {
|
||||
animationName = this.vendorCSS(box, 'animation-name').cssText;
|
||||
} catch (_error) {
|
||||
animationName = getComputedStyle(box).getPropertyValue('animation-name');
|
||||
}
|
||||
if (animationName === 'none') {
|
||||
return '';
|
||||
} else {
|
||||
return animationName;
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.cacheAnimationName = function(box) {
|
||||
return this.animationNameCache.set(box, this.animationName(box));
|
||||
};
|
||||
|
||||
WOW.prototype.cachedAnimationName = function(box) {
|
||||
return this.animationNameCache.get(box);
|
||||
};
|
||||
|
||||
WOW.prototype.scrollHandler = function() {
|
||||
return this.scrolled = true;
|
||||
};
|
||||
|
||||
WOW.prototype.scrollCallback = function() {
|
||||
var box;
|
||||
if (this.scrolled) {
|
||||
this.scrolled = false;
|
||||
this.boxes = (function() {
|
||||
var j, len, ref, results;
|
||||
ref = this.boxes;
|
||||
results = [];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
box = ref[j];
|
||||
if (!(box)) {
|
||||
continue;
|
||||
}
|
||||
if (this.isVisible(box)) {
|
||||
this.show(box);
|
||||
continue;
|
||||
}
|
||||
results.push(box);
|
||||
}
|
||||
return results;
|
||||
}).call(this);
|
||||
if (!(this.boxes.length || this.config.live)) {
|
||||
return this.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.offsetTop = function(element) {
|
||||
var top;
|
||||
while (element.offsetTop === void 0) {
|
||||
element = element.parentNode;
|
||||
}
|
||||
top = element.offsetTop;
|
||||
while (element = element.offsetParent) {
|
||||
top += element.offsetTop;
|
||||
}
|
||||
return top;
|
||||
};
|
||||
|
||||
WOW.prototype.isVisible = function(box) {
|
||||
var bottom, offset, top, viewBottom, viewTop;
|
||||
offset = box.getAttribute('data-wow-offset') || this.config.offset;
|
||||
viewTop = window.pageYOffset;
|
||||
viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;
|
||||
top = this.offsetTop(box);
|
||||
bottom = top + box.clientHeight;
|
||||
return top <= viewBottom && bottom >= viewTop;
|
||||
};
|
||||
|
||||
WOW.prototype.util = function() {
|
||||
return this._util != null ? this._util : this._util = new Util();
|
||||
};
|
||||
|
||||
WOW.prototype.disabled = function() {
|
||||
return !this.config.mobile && this.util().isMobile(navigator.userAgent);
|
||||
};
|
||||
|
||||
return WOW;
|
||||
|
||||
})();
|
||||
|
||||
}).call(this);
|
||||
74
wp-content/themes/consultstreet/comments.php
Normal file
74
wp-content/themes/consultstreet/comments.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying comments
|
||||
*
|
||||
* This is the template that displays the area of the page that contains both the current comments
|
||||
* and the comment form.
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the current post is protected by a password and
|
||||
* the visitor has not yet entered the password we will
|
||||
* return early without loading the comments.
|
||||
*/
|
||||
?>
|
||||
<?php if ( post_password_required() ) : ?>
|
||||
<p class="nopassword"><?php esc_html_e( 'This post is password protected. Enter the password to view any comments.', 'consultstreet' ); ?></p>
|
||||
<?php return; endif; ?>
|
||||
<?php if ( have_comments() ) : ?>
|
||||
<article class="theme-comment-section wow animate fadeInUp" data-wow-delay=".3s">
|
||||
<div class="theme-comment-title">
|
||||
<h3>
|
||||
<?php echo esc_html ( comments_number(__( 'No Comments', 'consultstreet'), __('One comment','consultstreet'), __('% comments', 'consultstreet'))); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
|
||||
<?php endif; ?>
|
||||
<?php wp_list_comments( array( 'callback' => 'consultstreet_comment' ) ); ?>
|
||||
</article>
|
||||
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
|
||||
<nav id="comment-nav-below">
|
||||
<h1 class="assistive-text"><?php esc_html_e( 'Comment navigation', 'consultstreet' ); ?></h1>
|
||||
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'consultstreet' ) ); ?></div>
|
||||
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'consultstreet' ) ); ?></div>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<?php elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) :
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php if ('open' == $post->comment_status) : ?>
|
||||
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
|
||||
<article class="logged-in-color"><p><?php
|
||||
/* translators: %1$s %2$s: logged in */
|
||||
echo sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment','consultstreet' ), esc_url(home_url( 'wp-login.php' ) . '?redirect_to=' . urlencode(get_permalink()))); ?></p></article>
|
||||
</p>
|
||||
<?php else : ?>
|
||||
<article class="theme-comment-form wow animate fadeInUp" data-wow-delay=".3s">
|
||||
<?php
|
||||
$fields=array(
|
||||
'author' => '<div class="form-group"><label>'.esc_html__("Name",'consultstreet').'<span class="required">*</span></label><input class="form-control" name="author" id="author" value="" type="text"/></div>',
|
||||
'email' => '<div class="form-group"><label>'.esc_html__("Email",'consultstreet').'<span class="required">*</span></label><input class="form-control" name="email" id="email" value="" type="email" ></div>',
|
||||
);
|
||||
function my_fields($fields) {
|
||||
return $fields;
|
||||
}
|
||||
add_filter('comment_form_default_fields','my_fields');
|
||||
$defaults = array(
|
||||
'fields'=> apply_filters( 'comment_form_default_fields', $fields ),
|
||||
'comment_field'=> '<div class="form-group"><label>'.esc_html__("Comment",'consultstreet').'</label>
|
||||
<textarea id="comments" rows="5" class="form-control" name="comment" type="text"></textarea></div>',
|
||||
'logged_in_as' => '<p class="logged-in-as">' . esc_html__( "Logged in as",'consultstreet' ).' '.'<a href="'. admin_url( 'profile.php' ).'">'. esc_html( $user_identity ).'</a>'. ' '. '<a href="'. wp_logout_url( get_permalink() ).'" title="'. esc_attr__("Log out of this account",'consultstreet').'">'.esc_html__("Logout",'consultstreet').'</a>' . '</p>',
|
||||
'id_submit'=> 'send_button',
|
||||
'label_submit'=>esc_html__( 'Submit','consultstreet'),
|
||||
'comment_notes_after'=> '',
|
||||
'title_reply'=> '<div class="theme-comment-title"><h3>'.esc_html__('Leave a Reply','consultstreet').'</h3></div>',
|
||||
'id_form'=> 'action'
|
||||
);
|
||||
comment_form($defaults);?>
|
||||
<?php endif; // If registration required and not logged in ?>
|
||||
<?php endif; ?>
|
||||
49
wp-content/themes/consultstreet/footer.php
Normal file
49
wp-content/themes/consultstreet/footer.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying the footer
|
||||
*
|
||||
* Contains the closing of the #content div and all content after.
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
$consultstreet_footer_widgets_enabled = get_theme_mod('consultstreet_footer_widgets_enabled', true);
|
||||
$consultstreet_footer_container_size = get_theme_mod('consultstreet_footer_container_size', 'container-full');
|
||||
$consultstreet_footer_copright_enabled = get_theme_mod('consultstreet_footer_copright_enabled', true);
|
||||
$consultstreet_footer_copright_text = get_theme_mod('consultstreet_footer_copright_text', __('Copyright © 2026 | Powered by <a href="//wordpress.org/">WordPress</a> <span class="sep"> | </span> ConsultStreet theme by <a target="_blank" href="//themearile.com/">ThemeArile</a>', 'consultstreet'));
|
||||
|
||||
?>
|
||||
<!--Footer-->
|
||||
<footer class="site-footer dark">
|
||||
|
||||
<?php if($consultstreet_footer_widgets_enabled == true): ?>
|
||||
<div class="<?php echo esc_attr($consultstreet_footer_container_size); ?>">
|
||||
<!--Footer Widgets-->
|
||||
<div class="row footer-sidebar">
|
||||
<?php get_template_part('sidebar','footer');?>
|
||||
</div>
|
||||
</div>
|
||||
<!--/Footer Widgets-->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if($consultstreet_footer_copright_enabled == true): ?>
|
||||
<!--Site Info-->
|
||||
<div class="site-info text-center">
|
||||
<?php echo wp_kses_post($consultstreet_footer_copright_text); ?>
|
||||
</div>
|
||||
<!--/Site Info-->
|
||||
<?php endif; ?>
|
||||
|
||||
</footer>
|
||||
<!--/End of Footer-->
|
||||
<!--Page Scroll Up-->
|
||||
<div class="page-scroll-up"><a href="#totop"><i class="fa fa-angle-up"></i></a></div>
|
||||
<!--/Page Scroll Up-->
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
271
wp-content/themes/consultstreet/functions.php
Normal file
271
wp-content/themes/consultstreet/functions.php
Normal file
@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/**
|
||||
* consultstreet functions and definitions
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/theme-functions/
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'consultstreet_setup' ) ) :
|
||||
/**
|
||||
* Sets up theme defaults and registers support for various WordPress features.
|
||||
*
|
||||
* Note that this function is hooked into the after_setup_theme hook, which
|
||||
* runs before the init hook. The init hook is too late for some features, such
|
||||
* as indicating support for post thumbnails.
|
||||
*/
|
||||
function consultstreet_setup() {
|
||||
/*
|
||||
* Make theme available for translation.
|
||||
* Translations can be filed in the /languages/ directory.
|
||||
* If you're building a theme based on consultstreet, use a find and replace
|
||||
* to change 'consultstreet' to the name of your theme in all the template files.
|
||||
*/
|
||||
load_theme_textdomain( 'consultstreet', get_template_directory() . '/languages' );
|
||||
|
||||
// Add default posts and comments RSS feed links to head.
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
|
||||
/*
|
||||
* Let WordPress manage the document title.
|
||||
* By adding theme support, we declare that this theme does not use a
|
||||
* hard-coded <title> tag in the document head, and expect WordPress to
|
||||
* provide it for us.
|
||||
*/
|
||||
add_theme_support( 'title-tag' );
|
||||
|
||||
/*
|
||||
* Enable support for Post Thumbnails on posts and pages.
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
|
||||
*/
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
|
||||
// This theme uses wp_nav_menu() in one location.
|
||||
// This theme uses wp_nav_menu() in one location.
|
||||
register_nav_menus( array(
|
||||
'primary' => esc_html__( 'Primary', 'consultstreet' ),
|
||||
) );
|
||||
|
||||
// Add theme support for selective refresh for widgets.
|
||||
add_theme_support( 'customize-selective-refresh-widgets' );
|
||||
|
||||
// woocommerce support
|
||||
|
||||
add_theme_support( 'woocommerce' );
|
||||
|
||||
// Woocommerce Gallery Support
|
||||
add_theme_support( 'wc-product-gallery-zoom' );
|
||||
add_theme_support( 'wc-product-gallery-lightbox' );
|
||||
add_theme_support( 'wc-product-gallery-slider' );
|
||||
|
||||
/**
|
||||
* Add support for core custom logo.
|
||||
*
|
||||
* @link https://codex.wordpress.org/Theme_Logo
|
||||
*/
|
||||
add_theme_support( 'custom-logo', array(
|
||||
'height' => 42,
|
||||
'width' => 257,
|
||||
'flex-height' => true,
|
||||
'flex-width' => true,
|
||||
'header-text' => array( 'site-title', 'site-description' ),
|
||||
|
||||
) );
|
||||
|
||||
/**
|
||||
* Enable support for Post Formats.
|
||||
*
|
||||
* See: https://codex.wordpress.org/Post_Formats
|
||||
*/
|
||||
add_theme_support( 'post-formats', array(
|
||||
'aside',
|
||||
'image',
|
||||
'video',
|
||||
'quote',
|
||||
'link',
|
||||
'gallery',
|
||||
'status',
|
||||
'audio',
|
||||
'chat',
|
||||
) );
|
||||
|
||||
/**
|
||||
* Custom background support.
|
||||
*/
|
||||
add_theme_support( 'custom-background', apply_filters( 'consultstreet_custom_background_args', array(
|
||||
'default-color' => 'ffffff',
|
||||
'default-image' => '',
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Set default content width.
|
||||
*/
|
||||
if ( ! isset( $content_width ) ) {
|
||||
$content_width = 800;
|
||||
}
|
||||
|
||||
}
|
||||
endif;
|
||||
add_action( 'after_setup_theme', 'consultstreet_setup' );
|
||||
|
||||
/**
|
||||
* Register widget area.
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
|
||||
*/
|
||||
|
||||
function consultstreet_widgets_init() {
|
||||
$sidebars = apply_filters( 'consultstreet_sidebars_data', array(
|
||||
'sidebar-main' => esc_html__( 'Sidebar', 'consultstreet' ),
|
||||
'footer-sidebar-one' => esc_html__( 'Footer Sidebar One', 'consultstreet' ),
|
||||
'footer-sidebar-two' => esc_html__( 'Footer Sidebar Two', 'consultstreet' ),
|
||||
'footer-sidebar-three' => esc_html__( 'Footer Sidebar Three', 'consultstreet' ),
|
||||
'footer-sidebar-four' => esc_html__( 'Footer Sidebar Four', 'consultstreet' ),
|
||||
) );
|
||||
|
||||
if ( class_exists( 'WooCommerce' ) ) {
|
||||
$sidebars['woocommerce'] = esc_html__( 'WooCommerce Sidebar', 'consultstreet' );
|
||||
}
|
||||
|
||||
foreach ( $sidebars as $id => $name ) :
|
||||
|
||||
register_sidebar( array(
|
||||
'id' => $id,
|
||||
'name' => $name,
|
||||
'description' => esc_html__( 'Add widgets here.', 'consultstreet' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget text_widget %2$s wow animate fadeInUp" data-wow-delay=".3s">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h4 class="widget-title">',
|
||||
'after_title' => '</h4>',
|
||||
) );
|
||||
|
||||
endforeach;
|
||||
|
||||
}
|
||||
add_action( 'widgets_init', 'consultstreet_widgets_init');
|
||||
|
||||
add_filter('woocommerce_show_page_title', '__return_false');
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles.
|
||||
*/
|
||||
function consultstreet_scripts() {
|
||||
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
||||
/**
|
||||
* Styles.
|
||||
*/
|
||||
|
||||
wp_enqueue_style('bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css');
|
||||
// Fontawesome.
|
||||
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/css/font-awesome/css/font-awesome.css', false, '4.7.0' );
|
||||
// Theme style.
|
||||
wp_enqueue_style( 'consultstreet-style', get_stylesheet_uri() );
|
||||
wp_enqueue_style('consultstreet-theme-default', get_template_directory_uri() . '/assets/css/theme-default.css');
|
||||
wp_enqueue_style('animate-css', get_template_directory_uri() . '/assets/css/animate.css');
|
||||
wp_enqueue_style('owl.carousel-css', get_template_directory_uri() . '/assets/css/owl.carousel.css');
|
||||
wp_enqueue_style('bootstrap-smartmenus-css', get_template_directory_uri() . '/assets/css/bootstrap-smartmenus.css');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Scripts.
|
||||
*/
|
||||
wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery'));
|
||||
// Theme JavaScript.
|
||||
wp_enqueue_script('consultstreet-smartmenus-js', get_template_directory_uri() . '/assets/js/smartmenus/jquery.smartmenus.js');
|
||||
wp_enqueue_script( 'consultstreet-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '20151215', true );
|
||||
wp_enqueue_script('consultstreet-custom-js', get_template_directory_uri() . '/assets/js/custom.js');
|
||||
wp_enqueue_script('bootstrap-smartmenus-js', get_template_directory_uri() . '/assets/js/smartmenus/bootstrap-smartmenus.js');
|
||||
wp_enqueue_script('owl-carousel-js', get_template_directory_uri() . '/assets/js/owl.carousel.js');
|
||||
if(get_theme_mod('consultstreet_animation_disabled', true) == true):
|
||||
wp_enqueue_script('animate-js', get_template_directory_uri() . '/assets/js/animation/animate.js');
|
||||
wp_enqueue_script('wow-js', get_template_directory_uri() . '/assets/js/wow.js');
|
||||
endif;
|
||||
|
||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'consultstreet_scripts' );
|
||||
|
||||
/**
|
||||
* Enqueue admin scripts and styles.
|
||||
*/
|
||||
function consultstreet_admin_enqueue_scripts(){
|
||||
wp_enqueue_style('consultstreet-admin-style', get_template_directory_uri() . '/assets/css/admin.css');
|
||||
wp_enqueue_script( 'consultstreet-admin-script', get_template_directory_uri() . '/assets/js/consultstreet-admin-script.js', array( 'jquery' ), '', true );
|
||||
wp_localize_script( 'consultstreet-admin-script', 'consultstreet_ajax_object',
|
||||
array( 'ajax_url' => admin_url( 'admin-ajax.php' ) )
|
||||
);
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'consultstreet_admin_enqueue_scripts' );
|
||||
|
||||
/**
|
||||
* Enqueue customizer scripts and styles.
|
||||
*/
|
||||
function consultstreet_customizer_script() {
|
||||
wp_enqueue_style( 'consultstreet-customize',get_template_directory_uri().'/inc/customizer/assets/css/customize.css', CONSULTSTREET_THEME_VERSION, 'screen' );
|
||||
wp_enqueue_script( 'consultstreet-customizer-script', get_template_directory_uri() .'/inc/customizer/assets/js/customizer-section.js', array("jquery"),'', true );
|
||||
}
|
||||
add_action( 'customize_controls_enqueue_scripts', 'consultstreet_customizer_script' );
|
||||
|
||||
|
||||
/**
|
||||
* Define constants
|
||||
*/
|
||||
// Root path/URI.
|
||||
define( 'CONSULTSTREET_PARENT_DIR', get_template_directory() );
|
||||
define( 'CONSULTSTREET_PARENT_URI', get_template_directory_uri() );
|
||||
|
||||
// Include path/URI.
|
||||
define( 'CONSULTSTREET_PARENT_INC_DIR', CONSULTSTREET_PARENT_DIR . '/inc' );
|
||||
define( 'CONSULTSTREET_PARENT_INC_URI', CONSULTSTREET_PARENT_URI . '/inc' );
|
||||
|
||||
// Icons path.
|
||||
define( 'CONSULTSTREET_PARENT_INC_ICON_URI', CONSULTSTREET_PARENT_URI . '/assets/img/icons' );
|
||||
// Customizer path.
|
||||
define( 'CONSULTSTREET_PARENT_CUSTOMIZER_DIR', CONSULTSTREET_PARENT_INC_DIR . '/customizer' );
|
||||
|
||||
// Theme version.
|
||||
$consultstreet_theme = wp_get_theme();
|
||||
define( 'CONSULTSTREET_THEME_VERSION', $consultstreet_theme->get( 'Version' ) );
|
||||
define ( 'CONSULTSTREET_THEME_NAME', $consultstreet_theme->get( 'Name' ) );
|
||||
|
||||
/**
|
||||
* Implement the Custom Header feature.
|
||||
*/
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/custom-header.php';
|
||||
|
||||
/**
|
||||
* Custom template tags for this theme.
|
||||
*/
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/template-tags.php';
|
||||
|
||||
/**
|
||||
* Customizer additions.
|
||||
*/
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/consultstreet-customizer.php';
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/consultstreet-customizer-options.php';
|
||||
|
||||
|
||||
/**
|
||||
* Pgge layout setting.
|
||||
*/
|
||||
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/metabox.php';
|
||||
|
||||
|
||||
/**
|
||||
* Pgge layout setting.
|
||||
*/
|
||||
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/theme-custom-typography.php';
|
||||
|
||||
|
||||
/**
|
||||
* Bootstrap class navwalker.
|
||||
*/
|
||||
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/consultstreet-class-bootstrap-navwalker.php';
|
||||
28
wp-content/themes/consultstreet/header.php
Normal file
28
wp-content/themes/consultstreet/header.php
Normal file
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
|
||||
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' )); ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<?php
|
||||
$class='theme-wide';
|
||||
?>
|
||||
<body <?php body_class(esc_attr($class)); ?> >
|
||||
<?php
|
||||
if ( function_exists( 'wp_body_open' ) ) {
|
||||
wp_body_open();
|
||||
} else {
|
||||
do_action( 'wp_body_open' );
|
||||
}
|
||||
?>
|
||||
<a class="screen-reader-text skip-link" href="#content"><?php esc_html_e( 'Skip to content', 'consultstreet' ); ?></a>
|
||||
<div id="wrapper">
|
||||
<?php do_action( 'arileextra_consultstreet_top_header', false);
|
||||
get_template_part('template-parts/site','navbar'); ?>
|
||||
@ -0,0 +1,217 @@
|
||||
<?php
|
||||
/**
|
||||
* Class Name: consultstreet_wp_bootstrap_navwalker
|
||||
* GitHub URI: https://github.com/twittem/wp-bootstrap-navwalker
|
||||
* Description: A custom WordPress nav walker class to implement the Bootstrap 3 navigation style in a custom theme
|
||||
* using the WordPress built in menu manager. Version: 2.0.4 Author: Edward McIntyre - @twittem License: GPL-2.0+
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
*/
|
||||
class consultstreet_wp_bootstrap_navwalker extends Walker_Nav_Menu {
|
||||
|
||||
/**
|
||||
* @see Walker::start_lvl()
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $output Passed by reference. Used to append additional content.
|
||||
* @param int $depth Depth of page. Used for padding.
|
||||
*/
|
||||
public function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
$indent = str_repeat( "\t", $depth );
|
||||
$output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Walker::start_el()
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $output Passed by reference. Used to append additional content.
|
||||
* @param object $item Menu item data object.
|
||||
* @param int $depth Depth of menu item. Used for padding.
|
||||
* @param int $current_page Menu item ID.
|
||||
* @param object $args
|
||||
*/
|
||||
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
||||
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
|
||||
|
||||
/**
|
||||
* Dividers, Headers or Disabled
|
||||
* =============================
|
||||
* Determine whether the item is a Divider, Header, Disabled or regular
|
||||
* menu item. To prevent errors we use the strcasecmp() function to so a
|
||||
* comparison that is not case sensitive. The strcasecmp() function returns
|
||||
* a 0 if the strings are equal.
|
||||
*/
|
||||
if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) {
|
||||
$output .= $indent . '<li role="presentation" class="divider">';
|
||||
} else if ( strcasecmp( $item->title, 'divider' ) == 0 && $depth === 1 ) {
|
||||
$output .= $indent . '<li role="presentation" class="divider">';
|
||||
} else if ( strcasecmp( $item->attr_title, 'dropdown-header' ) == 0 && $depth === 1 ) {
|
||||
$output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr( $item->title );
|
||||
} else if ( strcasecmp( $item->attr_title, 'disabled' ) == 0 ) {
|
||||
$output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr( $item->title ) . '</a>';
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
|
||||
$class_names = $value = '';
|
||||
|
||||
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
|
||||
$classes[] = 'menu-item-' . $item->ID;
|
||||
|
||||
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
|
||||
|
||||
if ( $args->has_children ) {
|
||||
$class_names .= ' dropdown';
|
||||
}
|
||||
|
||||
if ( in_array('current-menu-item', $classes ) OR in_array( 'current-menu-ancestor', $classes ) ){
|
||||
$class_names .= ' active';
|
||||
}
|
||||
|
||||
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
|
||||
|
||||
$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args );
|
||||
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
|
||||
|
||||
$output .= $indent . '<li' . $id . $value . $class_names . '>';
|
||||
|
||||
$atts = array();
|
||||
$atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : $item->title;
|
||||
$atts['target'] = ! empty( $item->target ) ? $item->target : '';
|
||||
$atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
|
||||
|
||||
// If item has_children add atts to a.
|
||||
if ( $args->has_children && $depth === 0 ) {
|
||||
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
|
||||
$atts['data-toggle'] = 'dropdown';
|
||||
$atts['class'] = 'dropdown-toggle';
|
||||
} else {
|
||||
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
|
||||
}
|
||||
|
||||
$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
|
||||
|
||||
$attributes = '';
|
||||
foreach ( $atts as $attr => $value ) {
|
||||
if ( ! empty( $value ) ) {
|
||||
$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
|
||||
$attributes .= ' ' . $attr . '="' . $value . '"';
|
||||
}
|
||||
}
|
||||
|
||||
$item_output = $args->before;
|
||||
|
||||
/*
|
||||
* Glyphicons
|
||||
* ===========
|
||||
* Since the the menu item is NOT a Divider or Header we check the see
|
||||
* if there is a value in the attr_title property. If the attr_title
|
||||
* property is NOT null we apply it as the class name for the glyphicon.
|
||||
*/
|
||||
if ( ! empty( $item->attr_title ) ) {
|
||||
$item_output .= '<a' . $attributes . '><span class="glyphicon ' . esc_attr( $item->attr_title ) . '"></span> ';
|
||||
} elseif($depth === 0) {
|
||||
$item_output .= '<a class="nav-link"' . $attributes . '>';
|
||||
}else{
|
||||
$item_output .= '<a class="dropdown-item"' . $attributes . '>';
|
||||
}
|
||||
|
||||
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
|
||||
$item_output .= ( $args->has_children && 0 === $depth ) ? ' </a>' : '</a>';
|
||||
$item_output .= $args->after;
|
||||
|
||||
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traverse elements to create list from elements.
|
||||
*
|
||||
* Display one element if the element doesn't have any children otherwise,
|
||||
* display the element and its children. Will only traverse up to the max
|
||||
* depth and no ignore elements under that depth.
|
||||
*
|
||||
* This method shouldn't be called directly, use the walk() method instead.
|
||||
*
|
||||
* @see Walker::start_el()
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param object $element Data object
|
||||
* @param array $children_elements List of elements to continue traversing.
|
||||
* @param int $max_depth Max depth to traverse.
|
||||
* @param int $depth Depth of current element.
|
||||
* @param array $args
|
||||
* @param string $output Passed by reference. Used to append additional content.
|
||||
*
|
||||
* @return null Null on failure with no changes to parameters.
|
||||
*/
|
||||
public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
|
||||
if ( ! $element ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$id_field = $this->db_fields['id'];
|
||||
|
||||
// Display this element.
|
||||
if ( is_object( $args[0] ) ) {
|
||||
$args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] );
|
||||
}
|
||||
|
||||
parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu Fallback
|
||||
* =============
|
||||
* If this function is assigned to the wp_nav_menu's fallback_cb variable
|
||||
* and a manu has not been assigned to the theme location in the WordPress
|
||||
* menu manager the function with display nothing to a non-logged in user,
|
||||
* and will add a link to the WordPress menu manager if logged in as an admin.
|
||||
*
|
||||
* @param array $args passed from the wp_nav_menu function.
|
||||
*
|
||||
*/
|
||||
public static function fallback( $args ) {
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
|
||||
extract( $args );
|
||||
|
||||
$fb_output = NULL;
|
||||
|
||||
if ( $container ) {
|
||||
$fb_output = '<' . $container;
|
||||
|
||||
if ( $container_id ) {
|
||||
$fb_output .= ' id="' . $container_id . '"';
|
||||
}
|
||||
|
||||
if ( $container_class ) {
|
||||
$fb_output .= ' class="' . $container_class . '"';
|
||||
}
|
||||
|
||||
$fb_output .= '>';
|
||||
}
|
||||
|
||||
$fb_output .= '<ul';
|
||||
|
||||
if ( $menu_id ) {
|
||||
$fb_output .= ' id="' . $menu_id . '"';
|
||||
}
|
||||
|
||||
if ( $menu_class ) {
|
||||
$fb_output .= ' class="' . $menu_class . '"';
|
||||
}
|
||||
|
||||
$fb_output .= '>';
|
||||
$fb_output .= '<li class="menu-item"><a class="nav-link add-menu" href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">' . esc_html__( 'Add a menu', 'consultstreet' ) . '</a></li>';
|
||||
$fb_output .= '</ul>';
|
||||
|
||||
if ( $container ) {
|
||||
$fb_output .= '</' . $container . '>';
|
||||
}
|
||||
|
||||
echo $fb_output;
|
||||
}
|
||||
}
|
||||
}
|
||||
78
wp-content/themes/consultstreet/inc/custom-header.php
Normal file
78
wp-content/themes/consultstreet/inc/custom-header.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Sample implementation of the Custom Header feature
|
||||
*
|
||||
* You can add an optional custom header image to header.php like so ...
|
||||
*
|
||||
* <?php the_header_image_tag(); ?>
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set up the WordPress core custom header feature.
|
||||
*
|
||||
* @uses consultstreet_header_style()
|
||||
*/
|
||||
function consultstreet_custom_header_setup() {
|
||||
add_theme_support( 'custom-header', apply_filters( 'consultstreet_custom_header_args', array(
|
||||
'default-image' => get_stylesheet_directory_uri() . '/assets/img/page-header-bg.jpg',
|
||||
'default-text-color' => '#fff',
|
||||
'width' => 1920,
|
||||
'height' => 500,
|
||||
'flex-height' => true,
|
||||
'flex-width' => true,
|
||||
'wp-head-callback' => 'consultstreet_header_style',
|
||||
) ) );
|
||||
}
|
||||
|
||||
add_action( 'after_setup_theme', 'consultstreet_custom_header_setup' );
|
||||
|
||||
if ( ! function_exists( 'consultstreet_header_style' ) ) :
|
||||
/**
|
||||
* Styles the header image and text displayed on the blog.
|
||||
*
|
||||
* @see consultstreet_custom_header_setup().
|
||||
*/
|
||||
function consultstreet_header_style() {
|
||||
$header_text_color = get_header_textcolor();
|
||||
|
||||
/*
|
||||
* If no custom options for text are set, let's bail.
|
||||
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ).
|
||||
*/
|
||||
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we get this far, we have custom styles. Let's do this.
|
||||
?>
|
||||
<style type="text/css">
|
||||
<?php
|
||||
// Has the text been hidden?
|
||||
if ( ! display_header_text() ) :
|
||||
?>
|
||||
.site-title,
|
||||
.site-description {
|
||||
position: absolute;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
}
|
||||
|
||||
<?php
|
||||
// If the user has set a custom color for the text use that.
|
||||
else :
|
||||
?>
|
||||
.site-title a,
|
||||
.site-description {
|
||||
color: #<?php echo esc_attr( $header_text_color ); ?>;
|
||||
}
|
||||
.navbar-header-wrap.not-sticky .site-branding-text .site-title a,
|
||||
.navbar-header-wrap.not-sticky .site-branding-text .site-description{color: #<?php echo esc_attr( $header_text_color ); ?>;}
|
||||
|
||||
<?php endif; ?>
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
endif;
|
||||
@ -0,0 +1,19 @@
|
||||
/*User stick note*/
|
||||
.control-section-consultstreet-plugin-section .accordion-section-title .button {
|
||||
margin-top: -4px;
|
||||
font-weight: 700;
|
||||
margin-left: 8px;
|
||||
background: #fff;
|
||||
color: #061018;
|
||||
border-color: #fff;
|
||||
padding: 0 20px 1px;
|
||||
}
|
||||
|
||||
.control-section-consultstreet-plugin-section .accordion-section-title .button:hover,
|
||||
.control-section-consultstreet-plugin-section .accordion-section-title .button:focus{
|
||||
background: #fff;
|
||||
border-color: #fff;
|
||||
}
|
||||
#customize-controls .control-section-consultstreet-plugin-section.cannot-expand .accordion-section-title, #customize-controls .control-section-plugin-section.cannot-expand:hover .accordion-section-title{
|
||||
background: #0085ba; color:#fff;
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
|
||||
#customize-theme-controls .customize-pane-child.current-section-parent {
|
||||
-webkit-transform: translateX(-100%);
|
||||
-ms-transform: translateX(-100%);
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
/* Nested Customizer Section CSS */
|
||||
#customize-controls .control-section.control-section-consultstreet_section .accordion-section-title {
|
||||
color: #555d66;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-left: 4px solid #fff;
|
||||
-webkit-transition: .15s color ease-in-out, .15s background-color ease-in-out, .15s border-color ease-in-out;
|
||||
transition: .15s color ease-in-out, .15s background-color ease-in-out, .15s border-color ease-in-out;
|
||||
}
|
||||
|
||||
#customize-controls .control-section.control-section-consultstreet_section .accordion-section-title:after {
|
||||
color: #a0a5aa;
|
||||
}
|
||||
|
||||
#customize-controls .control-section.control-section-consultstreet_section .accordion-section-title:hover,
|
||||
#customize-controls .control-section.control-section-consultstreet_section .accordion-section-title:focus {
|
||||
color: #3858e9;
|
||||
background: #f3f3f5;
|
||||
border-left-color: #3858e9;
|
||||
}
|
||||
|
||||
#customize-controls .control-section.control-section-consultstreet_section .accordion-section-title:hover:after {
|
||||
color: #3858e9;
|
||||
}
|
||||
|
||||
#customize-controls .control-section-consultstreet_section .accordion-section {
|
||||
margin-left: -12px;
|
||||
margin-right: -12px;
|
||||
}
|
||||
|
||||
#customize-controls .customize-control-consultstreet-editor .wp-editor-tools .wp-editor-container textarea {
|
||||
width: 100%;
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
( function( api ) {
|
||||
|
||||
// Extends our custom "example-1" section.
|
||||
api.sectionConstructor['consultstreet-plugin-section'] = api.Section.extend( {
|
||||
|
||||
// No events for this type of section.
|
||||
attachEvents: function () {},
|
||||
|
||||
// Always make the section active.
|
||||
isContextuallyActive: function () {
|
||||
return true;
|
||||
}
|
||||
} );
|
||||
|
||||
} )( wp.customize );
|
||||
|
||||
function consultstreet_frontpage_sections_scroll( section_id ){
|
||||
var scroll_section_id = "theme-slider";
|
||||
|
||||
var $contents = jQuery('#customize-preview iframe').contents();
|
||||
|
||||
switch ( section_id ) {
|
||||
case 'accordion-section-consultstreet_theme_top_header_area':
|
||||
scroll_section_id = "site-header";
|
||||
break;
|
||||
|
||||
case 'aaccordion-section-consultstreet_main_theme_slider':
|
||||
scroll_section_id = "theme-slider";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_info_area':
|
||||
scroll_section_id = "theme-info-area";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_service':
|
||||
scroll_section_id = "theme-services";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_project':
|
||||
scroll_section_id = "theme-project";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_funfact':
|
||||
scroll_section_id = "theme-funfact";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_testimonial':
|
||||
scroll_section_id = "theme-testimonial";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_wooshop':
|
||||
scroll_section_id = "theme-shop";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_cta':
|
||||
scroll_section_id = "theme-cta";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_team':
|
||||
scroll_section_id = "theme-team-mambers";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_blog':
|
||||
scroll_section_id = "theme-blog";
|
||||
break;
|
||||
|
||||
case 'accordion-section-consultstreet_theme_client':
|
||||
scroll_section_id = "theme-sponsors";
|
||||
break;
|
||||
}
|
||||
|
||||
if( $contents.find('#'+scroll_section_id).length > 0 ){
|
||||
$contents.find("html, body").animate({
|
||||
scrollTop: $contents.find( "#" + scroll_section_id ).offset().top
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
jQuery('body').on('click', '#sub-accordion-panel-consultstreet_frontpage_settings .control-subsection .accordion-section-title', function(event) {
|
||||
var section_id = jQuery(this).parent('.control-subsection').attr('id');
|
||||
consultstreet_frontpage_sections_scroll( section_id );
|
||||
});
|
||||
@ -0,0 +1,180 @@
|
||||
/**
|
||||
* File customizer.js.
|
||||
*
|
||||
* Theme Customizer enhancements for a better user experience.
|
||||
*
|
||||
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
|
||||
// Site title and description.
|
||||
wp.customize( 'blogname', function ( value ) {
|
||||
value.bind( function ( to ) {
|
||||
$( '.site-title a' ).text( to );
|
||||
} );
|
||||
} );
|
||||
wp.customize( 'blogdescription', function ( value ) {
|
||||
value.bind( function ( to ) {
|
||||
$( '.site-description' ).text( to );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Service title
|
||||
wp.customize(
|
||||
'consultstreet_service_area_title', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-services .theme-section-title' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Service description
|
||||
wp.customize(
|
||||
'consultstreet_service_area_des', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-services .theme-section-subtitle' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Project title
|
||||
wp.customize(
|
||||
'consultstreet_project_area_title', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-project .theme-section-title' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Project description
|
||||
wp.customize(
|
||||
'consultstreet_project_area_des', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-project .theme-section-subtitle' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// Testimonial title
|
||||
wp.customize(
|
||||
'consultstreet_testimonial_area_title', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-testimonial .theme-section-title' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Testimonial description
|
||||
wp.customize(
|
||||
'consultstreet_testimonial_area_des', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-testimonial .theme-section-subtitle' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Call to action title
|
||||
wp.customize(
|
||||
'consultstreet_cta_area_title', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-cta .cta-block h5' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Call to action subtitle
|
||||
wp.customize(
|
||||
'consultstreet_cta_area_subtitle', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-cta .cta-block h2' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Call to action description
|
||||
wp.customize(
|
||||
'consultstreet_cta_area_des', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-cta .cta-block p' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Call to action button text
|
||||
wp.customize(
|
||||
'consultstreet_cta_button_text', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-cta .btn-small' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Call to action video text
|
||||
wp.customize(
|
||||
'consultstreet_video_text', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-cta .youtube-click a' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Blog title
|
||||
wp.customize(
|
||||
'consultstreet_blog_area_title', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-blog .theme-section-title' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Blog description
|
||||
wp.customize(
|
||||
'consultstreet_blog_area_des', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.theme-blog .theme-section-subtitle' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// footer copyright text
|
||||
wp.customize(
|
||||
'consultstreet_footer_copright_text', function( value ) {
|
||||
value.bind(
|
||||
function( newval ) {
|
||||
$( '.site-footer .site-info' ).text( newval );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
} )( jQuery );
|
||||
@ -0,0 +1,349 @@
|
||||
/**
|
||||
* Extend Customizer Panel
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
var api = wp.customize;
|
||||
|
||||
api.bind( 'pane-contents-reflowed', function() {
|
||||
|
||||
// Reflow sections
|
||||
var sections = [];
|
||||
|
||||
api.section.each( function( section ) {
|
||||
|
||||
if (
|
||||
'consultstreet_section' !== section.params.type ||
|
||||
'undefined' === typeof section.params.section
|
||||
) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
sections.push( section );
|
||||
|
||||
} );
|
||||
|
||||
sections.sort( api.utils.prioritySort ).reverse();
|
||||
|
||||
$.each( sections, function( i, section ) {
|
||||
|
||||
var parentContainer = $( '#sub-accordion-section-' + section.params.section );
|
||||
|
||||
parentContainer.children( '.section-meta' ).after( section.headContainer );
|
||||
|
||||
} );
|
||||
|
||||
// Reflow panels
|
||||
var panels = [];
|
||||
|
||||
api.panel.each( function( panel ) {
|
||||
|
||||
if (
|
||||
'consultstreet_panel' !== panel.params.type ||
|
||||
'undefined' === typeof panel.params.panel
|
||||
) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
panels.push( panel );
|
||||
|
||||
} );
|
||||
|
||||
panels.sort( api.utils.prioritySort ).reverse();
|
||||
|
||||
$.each( panels, function( i, panel ) {
|
||||
|
||||
var parentContainer = $( '#sub-accordion-panel-' + panel.params.panel );
|
||||
|
||||
parentContainer.children( '.panel-meta' ).after( panel.headContainer );
|
||||
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
|
||||
// Extend Panel
|
||||
var _panelEmbed = wp.customize.Panel.prototype.embed;
|
||||
var _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive;
|
||||
var _panelAttachEvents = wp.customize.Panel.prototype.attachEvents;
|
||||
|
||||
wp.customize.Panel = wp.customize.Panel.extend( {
|
||||
attachEvents : function() {
|
||||
|
||||
if (
|
||||
'consultstreet_panel' !== this.params.type ||
|
||||
'undefined' === typeof this.params.panel
|
||||
) {
|
||||
|
||||
_panelAttachEvents.call( this );
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_panelAttachEvents.call( this );
|
||||
|
||||
var panel = this;
|
||||
|
||||
panel.expanded.bind( function( expanded ) {
|
||||
|
||||
var parent = api.panel( panel.params.panel );
|
||||
|
||||
if ( expanded ) {
|
||||
|
||||
parent.contentContainer.addClass( 'current-panel-parent' );
|
||||
|
||||
} else {
|
||||
|
||||
parent.contentContainer.removeClass( 'current-panel-parent' );
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
panel.container.find( '.customize-panel-back' )
|
||||
.off( 'click keydown' )
|
||||
.on( 'click keydown', function( event ) {
|
||||
|
||||
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
event.preventDefault(); // Keep this AFTER the key filter above
|
||||
|
||||
if ( panel.expanded() ) {
|
||||
|
||||
api.panel( panel.params.panel ).expand();
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
},
|
||||
embed : function() {
|
||||
|
||||
if (
|
||||
'consultstreet_panel' !== this.params.type ||
|
||||
'undefined' === typeof this.params.panel
|
||||
) {
|
||||
|
||||
_panelEmbed.call( this );
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_panelEmbed.call( this );
|
||||
|
||||
var panel = this;
|
||||
var parentContainer = $( '#sub-accordion-panel-' + this.params.panel );
|
||||
|
||||
parentContainer.append( panel.headContainer );
|
||||
|
||||
},
|
||||
isContextuallyActive: function() {
|
||||
|
||||
if (
|
||||
'consultstreet_panel' !== this.params.type
|
||||
) {
|
||||
|
||||
return _panelIsContextuallyActive.call( this );
|
||||
|
||||
}
|
||||
|
||||
var panel = this;
|
||||
var children = this._children( 'panel', 'section' );
|
||||
|
||||
api.panel.each( function( child ) {
|
||||
|
||||
if ( !child.params.panel ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if ( child.params.panel !== panel.id ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
children.push( child );
|
||||
|
||||
} );
|
||||
|
||||
children.sort( api.utils.prioritySort );
|
||||
|
||||
var activeCount = 0;
|
||||
|
||||
_( children ).each( function( child ) {
|
||||
|
||||
if ( child.active() && child.isContextuallyActive() ) {
|
||||
|
||||
activeCount += 1;
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
return ( activeCount !== 0 );
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
|
||||
// Extend Section
|
||||
var _sectionEmbed = wp.customize.Section.prototype.embed;
|
||||
var _sectionIsContextuallyActive = wp.customize.Section.prototype.isContextuallyActive;
|
||||
var _sectionAttachEvents = wp.customize.Section.prototype.attachEvents;
|
||||
|
||||
wp.customize.Section = wp.customize.Section.extend( {
|
||||
attachEvents : function() {
|
||||
|
||||
if (
|
||||
'consultstreet_section' !== this.params.type ||
|
||||
'undefined' === typeof this.params.section
|
||||
) {
|
||||
|
||||
_sectionAttachEvents.call( this );
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_sectionAttachEvents.call( this );
|
||||
|
||||
var section = this;
|
||||
|
||||
section.expanded.bind( function( expanded ) {
|
||||
|
||||
var parent = api.section( section.params.section );
|
||||
|
||||
if ( expanded ) {
|
||||
|
||||
parent.contentContainer.addClass( 'current-section-parent' );
|
||||
|
||||
} else {
|
||||
|
||||
parent.contentContainer.removeClass( 'current-section-parent' );
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
section.container.find( '.customize-section-back' )
|
||||
.off( 'click keydown' )
|
||||
.on( 'click keydown', function( event ) {
|
||||
|
||||
if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
event.preventDefault(); // Keep this AFTER the key filter above
|
||||
|
||||
if ( section.expanded() ) {
|
||||
|
||||
api.section( section.params.section ).expand();
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
},
|
||||
embed : function() {
|
||||
|
||||
if (
|
||||
'consultstreet_section' !== this.params.type ||
|
||||
'undefined' === typeof this.params.section
|
||||
) {
|
||||
|
||||
_sectionEmbed.call( this );
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
_sectionEmbed.call( this );
|
||||
|
||||
var section = this;
|
||||
var parentContainer = $( '#sub-accordion-section-' + this.params.section );
|
||||
|
||||
parentContainer.append( section.headContainer );
|
||||
|
||||
},
|
||||
isContextuallyActive: function() {
|
||||
|
||||
if (
|
||||
'consultstreet_section' !== this.params.type
|
||||
) {
|
||||
|
||||
return _sectionIsContextuallyActive.call( this );
|
||||
|
||||
}
|
||||
|
||||
var section = this;
|
||||
var children = this._children( 'section', 'control' );
|
||||
|
||||
api.section.each( function( child ) {
|
||||
|
||||
if ( !child.params.section ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if ( child.params.section !== section.id ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
children.push( child );
|
||||
|
||||
} );
|
||||
|
||||
children.sort( api.utils.prioritySort );
|
||||
|
||||
var activeCount = 0;
|
||||
|
||||
_( children ).each( function( child ) {
|
||||
|
||||
if ( 'undefined' !== typeof child.isContextuallyActive ) {
|
||||
|
||||
if ( child.active() && child.isContextuallyActive() ) {
|
||||
|
||||
activeCount += 1;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if ( child.active() ) {
|
||||
|
||||
activeCount += 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
return ( activeCount !== 0 );
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* Extend default customizer section.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Section
|
||||
* @access public
|
||||
*/
|
||||
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/webfont.php';
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/controls/code/consultstreet-customize-typography-control.php';
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/controls/code/consultstreet-customize-plugin-control.php';
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/controls/code/consultstreet-customize-category-control.php';
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/customizer-repeater/functions.php';
|
||||
|
||||
function consultstreet_customizer_theme_settings( $wp_customize ){
|
||||
|
||||
$active_callback = isset( $array['active_callback'] ) ? $array['active_callback'] : null;
|
||||
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
|
||||
|
||||
$wp_customize->get_section( 'header_image' )->panel = 'consultstreet_theme_settings';
|
||||
$wp_customize->get_section( 'header_image' )->title = __( 'Page Header', 'consultstreet' );
|
||||
$wp_customize->get_section( 'header_image' )->priority = 40;
|
||||
|
||||
// Sticky Bar Logo
|
||||
$wp_customize->add_setting( 'consultstreet_sticky_bar_logo', array(
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'consultstreet_sticky_bar_logo',
|
||||
array(
|
||||
'label' => esc_html__( 'Set Sticky Bar Logo', 'consultstreet' ),
|
||||
'description' => esc_html__( 'You can Upload the Standrad size of logo (210px*39px)', 'consultstreet' ),
|
||||
'section' => 'consultstreet_theme_menu_bar',
|
||||
'settings' => 'consultstreet_sticky_bar_logo',
|
||||
'priority' => 15,
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_base_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Open Sans',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_base_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_base_typography',
|
||||
'settings' => 'consultstreet_typography_base_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_base_font_size',
|
||||
array(
|
||||
'default' => '1rem',
|
||||
'sanitize_callback' => 'consultstreet_sanitize_text',
|
||||
));
|
||||
$wp_customize->add_control( 'consultstreet_typography_base_font_size',
|
||||
array(
|
||||
'label' => esc_html__( 'Font Size', 'consultstreet' ),
|
||||
'description' => esc_html__( 'You can enter font-size in px or rem ', 'consultstreet' ),
|
||||
'section' => 'consultstreet_base_typography',
|
||||
'priority' => 15,
|
||||
'type' => 'text',
|
||||
));
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_h1_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Montserrat',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_h1_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_headings1_typography',
|
||||
'settings' => 'consultstreet_typography_h1_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_h2_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Montserrat',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_h2_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_headings2_typography',
|
||||
'settings' => 'consultstreet_typography_h2_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_h3_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Montserrat',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_h3_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_headings3_typography',
|
||||
'settings' => 'consultstreet_typography_h3_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_h4_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Montserrat',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_h4_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_headings4_typography',
|
||||
'settings' => 'consultstreet_typography_h4_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_h5_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Montserrat',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_h5_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_headings5_typography',
|
||||
'settings' => 'consultstreet_typography_h5_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'consultstreet_typography_h6_font_family',array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_select',
|
||||
'capability' => 'edit_theme_options',
|
||||
'default' => 'Montserrat',
|
||||
) );
|
||||
$wp_customize->add_control( new ConsultStreet_Customizer_Typography_Control( $wp_customize, 'consultstreet_typography_h6_font_family', array(
|
||||
'label' => esc_html__( 'Font Family', 'consultstreet' ),
|
||||
'section' => 'consultstreet_headings6_typography',
|
||||
'settings' => 'consultstreet_typography_h6_font_family',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
// Footer copyright
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'consultstreet_footer_copright_text',
|
||||
array(
|
||||
'sanitize_callback' => 'consultstreet_sanitize_text',
|
||||
'default' => __('Copyright © 2026 | Powered by <a href="//wordpress.org/">WordPress</a> <span class="sep"> | </span> ConsultStreet theme by <a target="_blank" href="//themearile.com/">ThemeArile</a>', 'consultstreet'),
|
||||
'transport' => $selective_refresh,
|
||||
)
|
||||
);
|
||||
$wp_customize->add_control('consultstreet_footer_copright_text', array(
|
||||
'label' => esc_html__('Footer Copyright','consultstreet'),
|
||||
'section' => 'consultstreet_footer_copyright',
|
||||
'priority' => 10,
|
||||
'type' => 'textarea'
|
||||
));
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'consultstreet_customizer_theme_settings' );
|
||||
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* ConsultStreet Customizer partials.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customizer_Partials' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Partials.
|
||||
*/
|
||||
class ConsultStreet_Customizer_Partials {
|
||||
|
||||
/**
|
||||
* Instance.
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator.
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
// site title
|
||||
public static function customize_partial_blogname() {
|
||||
return get_bloginfo( 'name' );
|
||||
}
|
||||
|
||||
// Site tagline
|
||||
public static function customize_partial_blogdescription() {
|
||||
return get_bloginfo( 'description' );
|
||||
}
|
||||
|
||||
// service title
|
||||
public static function customize_partial_consultstreet_service_area_title() {
|
||||
return get_theme_mod( 'consultstreet_service_area_title' );
|
||||
}
|
||||
|
||||
// service description
|
||||
public static function customize_partial_consultstreet_service_area_des() {
|
||||
return get_theme_mod( 'consultstreet_service_area_des' );
|
||||
}
|
||||
|
||||
// project title
|
||||
public static function customize_partial_consultstreet_project_area_title() {
|
||||
return get_theme_mod( 'consultstreet_project_area_title' );
|
||||
}
|
||||
|
||||
// project description
|
||||
public static function customize_partial_consultstreet_project_area_des() {
|
||||
return get_theme_mod( 'consultstreet_project_area_des' );
|
||||
}
|
||||
|
||||
// testimonial title
|
||||
public static function customize_partial_consultstreet_testimonial_area_title() {
|
||||
return get_theme_mod( 'consultstreet_testimonial_area_title' );
|
||||
}
|
||||
|
||||
// testimonial description
|
||||
public static function customize_partial_consultstreet_testimonial_area_des() {
|
||||
return get_theme_mod( 'consultstreet_testimonial_area_des' );
|
||||
}
|
||||
|
||||
// call to action title
|
||||
public static function customize_partial_consultstreet_cta_area_title() {
|
||||
return get_theme_mod( 'consultstreet_cta_area_title' );
|
||||
}
|
||||
|
||||
// call to action subtitle
|
||||
public static function customize_partial_consultstreet_cta_area_subtitle() {
|
||||
return get_theme_mod( 'consultstreet_cta_area_subtitle' );
|
||||
}
|
||||
|
||||
// call to action description
|
||||
public static function customize_partial_consultstreet_cta_area_des() {
|
||||
return get_theme_mod( 'consultstreet_cta_area_des' );
|
||||
}
|
||||
|
||||
// call to action button text
|
||||
public static function customize_partial_consultstreet_cta_button_text() {
|
||||
return get_theme_mod( 'consultstreet_cta_button_text' );
|
||||
}
|
||||
|
||||
// blog title
|
||||
public static function customize_partial_consultstreet_blog_area_title() {
|
||||
return get_theme_mod( 'consultstreet_blog_area_title' );
|
||||
}
|
||||
|
||||
// blog description
|
||||
public static function customize_partial_consultstreet_blog_area_des() {
|
||||
return get_theme_mod( 'consultstreet_blog_area_des' );
|
||||
}
|
||||
|
||||
// footer copyright text
|
||||
public static function customize_partial_consultstreet_footer_copright_text() {
|
||||
return get_theme_mod( 'consultstreet_footer_copright_text' );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ConsultStreet_Customizer_Partials::get_instance();
|
||||
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* Customizer sanitize class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class ConsultStreet_Customizer_Sanitize {
|
||||
|
||||
/**
|
||||
* Instance
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
// Sanitize Alpha Color control.
|
||||
public static function sanitize_alpha_color( $val ) {
|
||||
if ( '' === $val ) { return ''; }
|
||||
if ( is_string( $val ) && 'transparent' === trim( $val ) ) {
|
||||
return 'transparent';
|
||||
}
|
||||
if ( false === strpos( $val, 'rgba' ) ) {
|
||||
return sanitize_hex_color( $val );
|
||||
}
|
||||
$color = str_replace( ' ', '', $val );
|
||||
sscanf( $color, 'rgba(%d,%d,%d,%f)', $r, $g, $b, $a );
|
||||
return "rgba($r,$g,$b,$a)";
|
||||
}
|
||||
|
||||
|
||||
// Sanitize Dimensions control.
|
||||
public static function sanitize_dimensions( $val ) {
|
||||
if ( ! is_array( $val ) ) { return array(); }
|
||||
foreach ( $val as $key => $item ) {
|
||||
$val[ $key ] = sanitize_text_field( $item );
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
// Sanitize Radio Buttonset control.
|
||||
public static function sanitize_radio( $val, $setting ) {
|
||||
$val = sanitize_key( $val );
|
||||
$choices = $setting->manager->get_control( $setting->id )->choices;
|
||||
return array_key_exists( $val, $choices ) ? $val : $setting->default;
|
||||
}
|
||||
|
||||
// Sanitize Slider control.
|
||||
public static function sanitize_slider( $val, $setting ) {
|
||||
|
||||
$input_attrs = array();
|
||||
|
||||
if ( isset( $setting->manager->get_control( $setting->id )->input_attrs ) ) {
|
||||
$input_attrs = $setting->manager->get_control( $setting->id )->input_attrs;
|
||||
}
|
||||
|
||||
$val['slider'] = is_numeric( $val['slider'] ) ? $val['slider'] : '';
|
||||
|
||||
$val['slider'] = isset( $input_attrs['min'] ) && ( ! empty( $val ) ) && ( $input_attrs['min'] > $val['slider'] ) ? $input_attrs['min'] : $val['slider'];
|
||||
$val['slider'] = isset( $input_attrs['max'] ) && ( ! empty( $val ) ) && ( $input_attrs['max'] < $val['slider'] ) ? $input_attrs['max'] : $val['slider'];
|
||||
|
||||
$val['suffix'] = esc_attr( $val['suffix'] );
|
||||
|
||||
return $val;
|
||||
|
||||
}
|
||||
|
||||
public static function sanitize_sortable( $input, $setting ) {
|
||||
|
||||
// Get list of choices from the control
|
||||
// associated with the setting.
|
||||
$choices = $setting->manager->get_control( $setting->id )->choices;
|
||||
$input_keys = $input;
|
||||
|
||||
foreach ( $input_keys as $key => $value ) {
|
||||
if ( ! array_key_exists( $value, $choices ) ) {
|
||||
unset( $input[ $key ] );
|
||||
}
|
||||
}
|
||||
|
||||
// If the input is a valid key, return it;
|
||||
// otherwise, return the default.
|
||||
return ( is_array( $input ) ? $input : $setting->default );
|
||||
}
|
||||
|
||||
// Sanitize checkbox.
|
||||
public static function sanitize_checkbox( $val ) {
|
||||
if ( '0' === $val || 'false' === $val ) {
|
||||
return false;
|
||||
}
|
||||
return (bool) $val;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ConsultStreet_Customizer_Sanitize::get_instance();
|
||||
@ -0,0 +1,172 @@
|
||||
<?php
|
||||
/**
|
||||
* Override default customizer options.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Settings.
|
||||
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
|
||||
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
|
||||
|
||||
if ( isset( $wp_customize->selective_refresh ) ) {
|
||||
|
||||
// site title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'blogname',
|
||||
array(
|
||||
'selector' => '.site-title a',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_blogname' ),
|
||||
)
|
||||
);
|
||||
|
||||
// site tagline
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'blogdescription',
|
||||
array(
|
||||
'selector' => '.site-description',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_blogdescription' ),
|
||||
)
|
||||
);
|
||||
|
||||
// main slider
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_main_slider_content',
|
||||
array(
|
||||
'selector' => '.theme-main-slider .theme-slider-content',
|
||||
)
|
||||
);
|
||||
|
||||
// service title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_service_area_title',
|
||||
array(
|
||||
'selector' => '.theme-services .theme-section-title',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_service_area_title' ),
|
||||
)
|
||||
);
|
||||
|
||||
// service title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_service_area_des',
|
||||
array(
|
||||
'selector' => '.theme-services .theme-section-subtitle',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_service_area_des' ),
|
||||
)
|
||||
);
|
||||
|
||||
// service content
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_service_content',
|
||||
array(
|
||||
'selector' => '.theme-services .row.theme-services-content',
|
||||
)
|
||||
);
|
||||
|
||||
// project title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_project_area_title',
|
||||
array(
|
||||
'selector' => '#theme-project .theme-section-title',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_project_area_title' ),
|
||||
)
|
||||
);
|
||||
|
||||
// project description
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_project_area_des',
|
||||
array(
|
||||
'selector' => '#theme-project .theme-section-subtitle',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_project_area_des' ),
|
||||
)
|
||||
);
|
||||
|
||||
// testimonial title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_testimonial_area_title',
|
||||
array(
|
||||
'selector' => '.theme-testimonial .theme-section-title',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_testimonial_area_title' ),
|
||||
)
|
||||
);
|
||||
|
||||
// testimonial description
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_testimonial_area_des',
|
||||
array(
|
||||
'selector' => '.theme-testimonial .theme-section-subtitle',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_testimonial_area_des' ),
|
||||
)
|
||||
);
|
||||
|
||||
// testimonial content
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_testimonial_content',
|
||||
array(
|
||||
'selector' => '.theme-testimonial .row.theme-testimonial-content',
|
||||
)
|
||||
);
|
||||
|
||||
// call to action title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_cta_area_title',
|
||||
array(
|
||||
'selector' => '.theme-cta .cta-block h5',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_cta_area_title' ),
|
||||
)
|
||||
);
|
||||
|
||||
// call to action subtitle
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_cta_area_subtitle',
|
||||
array(
|
||||
'selector' => '.theme-cta .cta-block h2',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_cta_area_subtitle' ),
|
||||
)
|
||||
);
|
||||
|
||||
// call to action description
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_cta_area_des',
|
||||
array(
|
||||
'selector' => '.theme-cta .cta-block p',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_cta_area_des' ),
|
||||
)
|
||||
);
|
||||
|
||||
// call to action button text
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_cta_button_text',
|
||||
array(
|
||||
'selector' => '.theme-cta .mx-auto a',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_cta_button_text' ),
|
||||
)
|
||||
);
|
||||
|
||||
// blog title
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_blog_area_title',
|
||||
array(
|
||||
'selector' => '.theme-blog .theme-section-title',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_blog_area_title' ),
|
||||
)
|
||||
);
|
||||
|
||||
// blog description
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_blog_area_des',
|
||||
array(
|
||||
'selector' => '.theme-blog .theme-section-subtitle',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_blog_area_des' ),
|
||||
)
|
||||
);
|
||||
|
||||
// footer copyright text
|
||||
$wp_customize->selective_refresh->add_partial(
|
||||
'consultstreet_footer_copright_text',
|
||||
array(
|
||||
'selector' => '.site-footer .site-info',
|
||||
'render_callback' => array( 'ConsultStreet_Customizer_Partials', 'customize_partial_consultstreet_footer_copright_text' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* consultstreet Customizer Class
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customizer' ) ) :
|
||||
|
||||
// ConsultStreet Customizer class
|
||||
|
||||
class ConsultStreet_Customizer {
|
||||
|
||||
// Constructor customizer
|
||||
public function __construct() {
|
||||
|
||||
add_action( 'customize_register', array( $this, 'consultstreet_customizer_panel_control' ) );
|
||||
add_action( 'customize_register', array( $this, 'consultstreet_customizer_register' ) );
|
||||
add_action( 'customize_register', array( $this, 'consultstreet_customizer_selective_refresh' ) );
|
||||
add_action( 'customize_preview_init', array( $this, 'consultstreet_customizer_preview_js' ) );
|
||||
add_action( 'after_setup_theme', array( $this, 'consultstreet_customizer_settings' ) );
|
||||
|
||||
}
|
||||
|
||||
// Register custom controls
|
||||
public function consultstreet_customizer_panel_control( $wp_customize ) {
|
||||
|
||||
// Controls path.
|
||||
$control_dir = CONSULTSTREET_PARENT_INC_DIR . '/customizer/controls';
|
||||
$setting_dir = CONSULTSTREET_PARENT_INC_DIR . '/customizer/settings';
|
||||
|
||||
// Load customizer options extending classes.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/custom-customizer/consultstreet-customizer-panel.php';
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/custom-customizer/consultstreet-customizer-section.php';
|
||||
|
||||
// Register extended classes.
|
||||
$wp_customize->register_panel_type( 'ConsultStreet_Customize_Panel' );
|
||||
$wp_customize->register_section_type( 'ConsultStreet_Customize_Section' );
|
||||
|
||||
// Load base class for controls.
|
||||
require_once $control_dir . '/code/consultstreet-customize-base-control.php';
|
||||
// Load custom control classes.
|
||||
require_once $control_dir . '/code/consultstreet-customize-color-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-heading-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-radio-image-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-radio-buttonset-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-slider-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-sortable-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-toggle-control.php';
|
||||
require_once $control_dir . '/code/consultstreet-customize-upgrade-control.php';
|
||||
|
||||
// Register JS-rendered control types.
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Color_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Heading_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Radio_Image_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Radio_Buttonset_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Slider_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Sortable_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Toggle_Control' );
|
||||
$wp_customize->register_control_type( 'ConsultStreet_Customize_Upgrade_Control' );
|
||||
|
||||
}
|
||||
|
||||
// Customizer selective refresh.
|
||||
public function consultstreet_customizer_selective_refresh() {
|
||||
|
||||
require_once CONSULTSTREET_PARENT_INC_DIR . '/customizer/consultstreet-customizer-sanitize.php';
|
||||
require_once CONSULTSTREET_PARENT_INC_DIR . '/customizer/consultstreet-customizer-partials.php';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Add postMessage support for site title and description for the Theme Customizer.
|
||||
|
||||
public function consultstreet_customizer_register( $wp_customize ) {
|
||||
|
||||
// Customizer selective
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/consultstreet-customizer-selective.php';
|
||||
|
||||
// Register panels and sections.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/consultstreet-panels-and-sections.php';
|
||||
|
||||
}
|
||||
|
||||
// Theme Customizer preview reload changes asynchronously.
|
||||
public function consultstreet_customizer_preview_js() {
|
||||
|
||||
wp_enqueue_script( 'consultstreet-customizer', CONSULTSTREET_PARENT_INC_URI . '/customizer/assets/js/customizer.js', array( 'customize-preview' ), CONSULTSTREET_THEME_VERSION, true );
|
||||
|
||||
}
|
||||
|
||||
// Include customizer customizer settings.
|
||||
|
||||
public function consultstreet_customizer_settings() {
|
||||
|
||||
$activate_theme_data = wp_get_theme(); // getting current theme data
|
||||
$activate_theme = $activate_theme_data->name;
|
||||
|
||||
// Recommended Plugin
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-notice/consultstreet-notify-plugin.php';
|
||||
|
||||
// Base class.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/consultstreet-customize-base-customizer-settings.php';
|
||||
// Menu.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-menu-bar-customizer-settings.php';
|
||||
// Page Header.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-page-header-customizer-settings.php';
|
||||
// Blog.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-blog-general-customizer-settings.php';
|
||||
// General.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-general-customizer-settings.php';
|
||||
// Footer.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-footer-copyright-customizer-settings.php';
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-footer-widget-customizer-settings.php';
|
||||
// Typography.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-typography-customizer-settings.php';
|
||||
|
||||
if('AssentPress' == $activate_theme){
|
||||
// Other Options.
|
||||
require CONSULTSTREET_PARENT_CUSTOMIZER_DIR . '/customizer-settings/theme-settings/consultstreet-other-customizer-settings.php';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
endif;
|
||||
|
||||
new ConsultStreet_Customizer();
|
||||
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/**
|
||||
* Register customizer panels and sections.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
/* Theme Settings. */
|
||||
|
||||
$wp_customize->add_panel( new ConsultStreet_Customize_Panel( $wp_customize, 'consultstreet_theme_settings', array(
|
||||
'priority' => 28,
|
||||
'title' => esc_html__( 'Theme Options', 'consultstreet' ),
|
||||
'capabitity' => 'edit_theme_options',
|
||||
) ) );
|
||||
|
||||
|
||||
|
||||
// Section: General.
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_theme_general', array(
|
||||
'title' => esc_html__( 'General', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'priority' => 9,
|
||||
) ) );
|
||||
|
||||
|
||||
// Section: Menu.
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_theme_menu_bar', array(
|
||||
'title' => esc_html__( 'Menu', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
|
||||
|
||||
// Section: Blog.
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_theme_blog_settings', array(
|
||||
'title' => esc_html__( 'Blog', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_blog_general', array(
|
||||
'title' => esc_html__( 'General', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'section' => 'consultstreet_theme_blog_settings',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
|
||||
// Section: Page Header.
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_theme_page_header', array(
|
||||
'title' => esc_html__( 'Page Header', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'priority' => 40,
|
||||
) ) );
|
||||
|
||||
|
||||
// Section: Footer.
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_theme_footer', array(
|
||||
'title' => esc_html__( 'Footer', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'priority' => 50,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_footer_widgets', array(
|
||||
'title' => esc_html__( 'Footer Widgets', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'section' => 'consultstreet_theme_footer',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_footer_copyright', array(
|
||||
'title' => esc_html__( 'Footer Copyright', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_settings',
|
||||
'section' => 'consultstreet_theme_footer',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Panel: Typography.
|
||||
*/
|
||||
$wp_customize->add_panel( new ConsultStreet_Customize_Panel( $wp_customize, 'consultstreet_theme_typography', array(
|
||||
'priority' => 32,
|
||||
'title' => esc_html__( 'Typography', 'consultstreet' ),
|
||||
'capabitity' => 'edit_theme_options',
|
||||
) ) );
|
||||
|
||||
// Section: Typography > Base typography.
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_enable_disable_typography', array(
|
||||
'title' => esc_html__( 'Enable Typography', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 5,
|
||||
) ) );
|
||||
|
||||
// Section: Typography > Base typography.
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_base_typography', array(
|
||||
'title' => esc_html__( 'Base Typography', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
// Section: Typography > Headings ( h1 - h6 ) Typography.
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_headings1_typography', array(
|
||||
'title' => esc_html__( 'Headings H1', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 70,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_headings2_typography', array(
|
||||
'title' => esc_html__( 'Headings H2', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 80,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_headings3_typography', array(
|
||||
'title' => esc_html__( 'Headings H3', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 90,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_headings4_typography', array(
|
||||
'title' => esc_html__( 'Headings H4', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 100,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_headings5_typography', array(
|
||||
'title' => esc_html__( 'Headings H5', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 110,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_section( new ConsultStreet_Customize_Section( $wp_customize, 'consultstreet_headings6_typography', array(
|
||||
'title' => esc_html__( 'Headings H6', 'consultstreet' ),
|
||||
'panel' => 'consultstreet_theme_typography',
|
||||
'priority' => 120,
|
||||
) ) );
|
||||
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Base control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Base_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Base_Control extends WP_Customize_Control {
|
||||
|
||||
/**
|
||||
* Enqueue scripts all controls.
|
||||
*/
|
||||
public function enqueue() {
|
||||
|
||||
// Color picker alpha.
|
||||
wp_enqueue_script( 'wp-color-picker-alpha', CONSULTSTREET_PARENT_INC_URI . '/customizer/controls/js/wp-color-picker-alpha.js', array( 'wp-color-picker' ), '2.1.3', true );
|
||||
|
||||
$color_picker_strings = array(
|
||||
'clear' => __( 'Clear', 'consultstreet' ),
|
||||
'clearAriaLabel' => __( 'Clear color', 'consultstreet' ),
|
||||
'defaultString' => __( 'Default', 'consultstreet' ),
|
||||
'defaultAriaLabel' => __( 'Select default color', 'consultstreet' ),
|
||||
'pick' => __( 'Select Color', 'consultstreet' ),
|
||||
'defaultLabel' => __( 'Color value', 'consultstreet' ),
|
||||
);
|
||||
wp_localize_script( 'wp-color-picker-alpha', 'wpColorPickerL10n', $color_picker_strings );
|
||||
wp_enqueue_script( 'wp-color-picker-alpha' );
|
||||
|
||||
// Scripts for nesting panel/section.
|
||||
wp_enqueue_script( 'consultstreet-extend-customizer', CONSULTSTREET_PARENT_INC_URI . '/customizer/assets/js/extend-customizer.js', array( 'jquery' ), false, true );
|
||||
wp_enqueue_style( 'consultstreet-extend-customizer', CONSULTSTREET_PARENT_INC_URI . '/customizer/assets/css/extend-customizer.css' );
|
||||
|
||||
// Main scripts.
|
||||
wp_enqueue_script(
|
||||
'consultstreet-controls',
|
||||
CONSULTSTREET_PARENT_INC_URI . '/customizer/controls/js/controls.js',
|
||||
array(
|
||||
'jquery',
|
||||
'customize-base',
|
||||
'wp-color-picker-alpha',
|
||||
),
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
wp_enqueue_style( 'consultstreet-controls', CONSULTSTREET_PARENT_INC_URI . '/customizer/controls/css/controls.css' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @see WP_Customize_Control::to_json()
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function to_json() {
|
||||
|
||||
parent::to_json();
|
||||
|
||||
$this->json['default'] = $this->setting->default;
|
||||
if ( isset( $this->default ) ) {
|
||||
$this->json['default'] = $this->default;
|
||||
}
|
||||
|
||||
$this->json['id'] = $this->id;
|
||||
$this->json['value'] = $this->value();
|
||||
$this->json['choices'] = $this->choices;
|
||||
$this->json['link'] = $this->get_link();
|
||||
$this->json['l10n'] = $this->l10n();
|
||||
|
||||
$this->json['inputAttrs'] = '';
|
||||
foreach ( $this->input_attrs as $attr => $value ) {
|
||||
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of translation strings.
|
||||
*
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function l10n() {
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Editor control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
if ( ! class_exists( 'WP_Customize_Control' ) )
|
||||
return NULL;
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Category_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Category_Control extends WP_Customize_Control
|
||||
{
|
||||
private $cats = false;
|
||||
|
||||
public function __construct($manager, $id, $args = array(), $options = array())
|
||||
{
|
||||
$this->cats = get_categories($options);
|
||||
|
||||
parent::__construct( $manager, $id, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the content of the category dropdown
|
||||
*
|
||||
* @return HTML
|
||||
*/
|
||||
public function render_content()
|
||||
{
|
||||
if(!empty($this->cats))
|
||||
{
|
||||
?>
|
||||
<label>
|
||||
<span class="customize-category-select-control"><?php echo esc_html( $this->label ); ?></span>
|
||||
<select multiple <?php $this->link(); ?>>
|
||||
<?php
|
||||
foreach ( $this->cats as $cat )
|
||||
{
|
||||
printf('<option value="%s" %s>%s</option>', esc_html( $cat->term_id ), selected($this->value(), $cat->term_id, false), esc_html( $cat->name ));
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Color control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Color_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Color_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Backwards compatibility.
|
||||
*
|
||||
* @access protected
|
||||
* @var bool
|
||||
*/
|
||||
protected $alpha = false;
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-color';
|
||||
|
||||
/**
|
||||
* Colorpicker palette
|
||||
*
|
||||
* @access public
|
||||
* @var bool
|
||||
*/
|
||||
public $palette = true;
|
||||
|
||||
/**
|
||||
* Mode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $mode = 'full';
|
||||
|
||||
/**
|
||||
* Some fields require options to be set.
|
||||
* We're whitelisting the property here
|
||||
* and suggest you validate this in a child class.
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
public $choices = array();
|
||||
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @see WP_Customize_Control::to_json()
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function to_json() {
|
||||
|
||||
parent::to_json();
|
||||
|
||||
$this->json['palette'] = $this->palette;
|
||||
$this->json['choices']['alpha'] = ( isset( $this->choices['alpha'] ) && $this->choices['alpha'] ) ? 'true' : 'false';
|
||||
$this->json['mode'] = $this->mode;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Heading control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Heading_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Heading_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-heading';
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
|
||||
<h4>
|
||||
<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
|
||||
</h4>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/*
|
||||
* Upgrade to pro options
|
||||
*/
|
||||
|
||||
function consultstreet_upgrade_pro_options( $wp_customize ) {
|
||||
|
||||
$wp_customize->add_section(
|
||||
'upgrade_premium',
|
||||
array(
|
||||
'title' => __('Upgrade to Pro','consultstreet'),
|
||||
'priority' => 1,
|
||||
)
|
||||
);
|
||||
|
||||
class ConsultStreet_WP_Button_Customize_Control extends WP_Customize_Control {
|
||||
public $type = 'upgrade_premium';
|
||||
|
||||
function render_content() {
|
||||
?>
|
||||
<div class="pro_info">
|
||||
<ul>
|
||||
<li><a class="documentation" href="https://helpdoc.themearile.com/" target="_blank"><i class="dashicons dashicons-visibility"></i><?php _e( 'View Documentation','consultstreet' ); ?> </a></li>
|
||||
|
||||
<li><a class="support" href="https://themearile.com/forums/" target="_blank"><i class="dashicons dashicons-lightbulb"></i><?php _e( 'Get Full Support','consultstreet' ); ?> </a></li>
|
||||
|
||||
<li><a class="free-pro" href="https://themearile.com/consultstreet-pro-theme/#free-pro-features" target="_blank"><i class="dashicons dashicons-visibility"></i><?php _e( 'Free Vs Pro Features','consultstreet' ); ?> </a></li>
|
||||
|
||||
<li><a class="upgrade-to-pro" href="https://themearile.com/consultstreet-pro-theme/" target="_blank"><i class="dashicons dashicons-update-alt"></i><?php _e( 'Upgrade to Pro','consultstreet' ); ?> </a></li>
|
||||
|
||||
<li><a class="show-love" href="https://wordpress.org/support/theme/consultstreet/reviews/#new-post" target="_blank"><i class="dashicons dashicons-smiley"></i><?php _e( 'Share a Good Review','consultstreet' ); ?> </a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'pro_info_buttons',
|
||||
array(
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'consultstreet_sanitize_text',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control( new ConsultStreet_WP_Button_Customize_Control( $wp_customize, 'pro_info_buttons', array(
|
||||
'section' => 'upgrade_premium',
|
||||
))
|
||||
);
|
||||
}
|
||||
add_action( 'customize_register', 'consultstreet_upgrade_pro_options' );
|
||||
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Radio Buttonset control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Radio_Buttonset_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Radio_Buttonset_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-radio-buttonset';
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
|
||||
<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
|
||||
<# if ( data.description ) { #>
|
||||
<span class="description customize-control-description">{{{ data.description }}}</span><# } #>
|
||||
<div id="input_{{ data.id }}" class="buttonset">
|
||||
<# for ( key in data.choices ) { #>
|
||||
<input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="{{ key }}"
|
||||
name="_customize-radio-{{{ data.id }}}" id="{{ data.id }}{{ key }}" {{{ data.link }}}<# if ( key === data.value ) { #> checked="checked" <# } #>>
|
||||
<label class="switch-label switch-label-<# if ( key === data.value ) { #>on <# } else { #>off<# } #>"
|
||||
for="{{ data.id }}{{ key }}">{{ data.choices[ key ] }}</label>
|
||||
</input>
|
||||
<# } #>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Radio Image control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Radio_Image_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Radio_Image_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-radio-image';
|
||||
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @see WP_Customize_Control::to_json()
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function to_json() {
|
||||
|
||||
parent::to_json();
|
||||
|
||||
foreach ( $this->input_attrs as $attr => $value ) {
|
||||
if ( 'style' !== $attr ) {
|
||||
$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
|
||||
continue;
|
||||
}
|
||||
$this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" ';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
|
||||
<label class="customizer-text">
|
||||
<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
|
||||
<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><#
|
||||
} #>
|
||||
</label>
|
||||
<div id="input_{{ data.id }}" class="image">
|
||||
<# for ( key in data.choices ) { #>
|
||||
<# dataAlt = ( _.isObject( data.choices[ key ] ) && ! _.isUndefined( data.choices[ key ].alt ) ) ?
|
||||
data.choices[ key ].alt : '' #>
|
||||
<input {{{ data.inputAttrs }}} class="image-select" type="radio" value="{{ key }}"
|
||||
name="_customize-radio-{{ data.id }}" id="{{ data.id }}{{ key }}" {{{ data.link }}}<# if ( data.value === key ) { #> checked="checked"<# } #> data-alt="{{ dataAlt }}">
|
||||
<label for="{{ data.id }}{{ key }}" {{{ data.labelStyle }}} class="{{{ data.id + key }}}">
|
||||
<# if ( _.isObject( data.choices[ key ] ) ) { #>
|
||||
<img src="{{ data.choices[ key ].src }}" alt="{{ data.choices[ key ].alt }}">
|
||||
<span class="image-label"><span class="inner">{{ data.choices[ key ].alt }}</span></span>
|
||||
<# } else { #>
|
||||
<img src="{{ data.choices[ key ] }}">
|
||||
<# } #>
|
||||
<span class="image-clickable"></span>
|
||||
</label>
|
||||
</input>
|
||||
<# } #>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Slider control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Slider_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Slider_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-slider';
|
||||
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @see WP_Customize_Control::to_json()
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function to_json() {
|
||||
|
||||
parent::to_json();
|
||||
|
||||
if ( is_array( $this->json['default'] ) ) {
|
||||
foreach ( $this->json['default'] as $key => $value ) {
|
||||
$this->json['choices']['controls'][ $key ] = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
|
||||
<# if ( data.label ) { #>
|
||||
<span class="customize-control-title">{{ data.label }}</span>
|
||||
<# } #>
|
||||
|
||||
<# if ( data.description ) { #>
|
||||
<span class="description customize-control-description">{{{ data.description }}}</span>
|
||||
<# } #>
|
||||
|
||||
<div class="customize-control-content">
|
||||
<div class="consultstreet-slider">
|
||||
<div id="custom-handle" class="ui-slider-handle"></div>
|
||||
</div>
|
||||
<div class="consultstreet-slider-input">
|
||||
<input {{{ data.inputAttrs }}} type="number" class="slider-input" value="{{ data.value['slider'] }}"/>
|
||||
<input type="text" value="{{ data.default['suffix'] }}" hidden>
|
||||
<span class="suffix">{{ data.default['suffix'] }}</span>
|
||||
<span class="slider-reset dashicons dashicons-image-rotate"><span
|
||||
class="screen-reader-text"><?php esc_html_e( 'Reset', 'consultstreet' ); ?></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Sortable control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Sortable_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Sortable_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-sortable';
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
|
||||
<label class='consultstreet-sortable'>
|
||||
<span class="customize-control-title">
|
||||
{{{ data.label }}}
|
||||
</span>
|
||||
<# if ( data.description ) { #>
|
||||
<span class="description customize-control-description">{{{ data.description }}}</span>
|
||||
<# } #>
|
||||
|
||||
<ul class="sortable">
|
||||
<# _.each( data.value, function( choiceID ) { #>
|
||||
<li {{{ data.inputAttrs }}} class='consultstreet-sortable-item' data-value='{{ choiceID }}'>
|
||||
<i class='dashicons dashicons-menu'></i>
|
||||
<i class="dashicons dashicons-visibility visibility"></i>
|
||||
{{{ data.choices[ choiceID ] }}}
|
||||
</li>
|
||||
<# }); #>
|
||||
<# _.each( data.choices, function( choiceLabel, choiceID ) { #>
|
||||
<# if ( -1 === data.value.indexOf( choiceID ) ) { #>
|
||||
<li {{{ data.inputAttrs }}} class='consultstreet-sortable-item invisible' data-value='{{ choiceID }}'>
|
||||
<i class='dashicons dashicons-menu'></i>
|
||||
<i class="dashicons dashicons-visibility visibility"></i>
|
||||
{{{ data.choices[ choiceID ] }}}
|
||||
</li>
|
||||
<# } #>
|
||||
<# }); #>
|
||||
</ul>
|
||||
</label>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Toggle control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Toggle_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Toggle_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-toggle';
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
?>
|
||||
|
||||
<label for="toggle_{{ data.id }}">
|
||||
<span class="customize-control-title">
|
||||
{{{ data.label }}}
|
||||
</span>
|
||||
<# if ( data.description ) { #>
|
||||
<span class="description customize-control-description">{{{ data.description }}}</span>
|
||||
<# } #>
|
||||
<input class="screen-reader-text" {{{ data.inputAttrs }}} name="toggle_{{ data.id }}"
|
||||
id="toggle_{{ data.id }}" type="checkbox" value="{{ data.value }}" {{{ data.link }}}<# if ( true === data.value ) { #> checked<# } #> hidden />
|
||||
<span class="switch"></span>
|
||||
</label>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! class_exists( 'WP_Customize_Control' ) )
|
||||
return NULL;
|
||||
/**
|
||||
* Typography control
|
||||
*/
|
||||
class ConsultStreet_Customizer_Typography_Control extends WP_Customize_Control {
|
||||
|
||||
/**
|
||||
* The control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-typography';
|
||||
|
||||
/**
|
||||
* Render the control's content.
|
||||
* Allows the content to be overriden without having to rewrite the wrapper in $this->render().
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render_content() {
|
||||
$this_val = $this->value(); ?>
|
||||
<label>
|
||||
<?php if ( ! empty( $this->label ) ) : ?>
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! empty( $this->description ) ) : ?>
|
||||
<span class="description customize-control-description"><?php echo wp_kses_post( $this->description ); ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<select class="consultstreet-typography-select" <?php $this->link(); ?>>
|
||||
<?php
|
||||
// Get Standard font options
|
||||
if ( $std_fonts = consultstreet_standard_fonts() ) { ?>
|
||||
<optgroup label="<?php esc_attr_e( 'Standard Fonts', 'consultstreet' ); ?>">
|
||||
<?php
|
||||
// Loop through font options and add to select
|
||||
foreach ( $std_fonts as $font ) { ?>
|
||||
<option value="<?php echo esc_html( $font ); ?>" <?php selected( $font, $this_val ); ?>><?php echo esc_html( $font ); ?></option>
|
||||
<?php } ?>
|
||||
</optgroup>
|
||||
<?php }
|
||||
|
||||
// Google font options
|
||||
if ( $google_fonts = consultstreet_google_fonts_array() ) { ?>
|
||||
<optgroup label="<?php esc_attr_e( 'Google Fonts', 'consultstreet' ); ?>">
|
||||
<?php
|
||||
// Loop through font options and add to select
|
||||
foreach ( $google_fonts as $font ) { ?>
|
||||
<option value="<?php echo esc_html( $font ); ?>" <?php selected( $font, $this_val ); ?>><?php echo esc_html( $font ); ?></option>
|
||||
<?php } ?>
|
||||
</optgroup>
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
</label>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize Heading control class.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
* @access public
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Upgrade_Control
|
||||
*/
|
||||
class ConsultStreet_Customize_Upgrade_Control extends ConsultStreet_Customize_Base_Control {
|
||||
|
||||
/**
|
||||
* Customize control type.
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet-upgrade';
|
||||
|
||||
/**
|
||||
* Renders the Underscore template for this control.
|
||||
*
|
||||
* @see WP_Customize_Control::print_template()
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function content_template() {
|
||||
$upgrade_to_pro_link = 'https://themearile.com/consultstreet-pro-theme/';
|
||||
?>
|
||||
|
||||
<div class="consultstreet-upgrade-pro-message" style="display:none;";>
|
||||
<# if ( data.label ) { #><h4 class="customize-control-title"><?php echo wp_kses_post( 'Upgrade to <a href="'.$upgrade_to_pro_link.'" target="_blank" > ConsultStreet Pro </a> to be add more', 'consultstreet'); ?> {{{ data.label }}} <?php esc_html_e( 'and get the other pro features.', 'consultstreet') ?></h4><# } #>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
|
||||
*/
|
||||
protected function render_content() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,355 @@
|
||||
li[class|="customize-control-consultstreet-"] .wp-picker-container .wp-color-result.button {
|
||||
width: 100%;
|
||||
max-width: 255px;
|
||||
height: 30px;
|
||||
margin: 0 6px 6px 0;
|
||||
padding: 0 0 0 30px;
|
||||
font-size: 11px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
li[class|="customize-control-consultstreet-"] .wp-picker-container .wp-color-result-text {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0 2px 2px 0;
|
||||
border-left: 1px solid rgba(0, 0, 0, 0.06);
|
||||
color: #fff;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
li[class|="customize-control-consultstreet-"] .wp-picker-container span.color-alpha {
|
||||
width: 30px;
|
||||
height: 24px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-top-left-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-buttonset .buttonset {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-buttonset .buttonset .switch-label {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border: 1px rgba(0, 0, 0, 0.1);
|
||||
color: rgba(50, 55, 60, 0.5);
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
padding: 0.5em 1em;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-buttonset .buttonset .switch-input:checked + .switch-label {
|
||||
background: #3858e9;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
/* Control: Radio image. */
|
||||
.customize-control-consultstreet-radio-image > .image {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image .image-select + label {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 32%;
|
||||
margin-right: 2%;
|
||||
}
|
||||
|
||||
#customize-control-consultstreet_theme_color .image-select + label, #customize-control-consultstreet_theme_background_image .image-select + label{
|
||||
width: 22% !important;
|
||||
margin-right: 0% !important;
|
||||
}
|
||||
|
||||
#customize-control-consultstreet_page_header_layout .image-select + label {
|
||||
width: 47%;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image .image-select + label:nth-of-type(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image .image-select + label .image-label {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image .image-select + label .image-label .inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
padding: 0.5em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image .image-select + label:hover .image-label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image input img {
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image input:checked + label img {
|
||||
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
|
||||
border: 1px solid #3858e9;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-radio-image input + label .image-clickable {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-slider .customize-control-content {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-slider .ui-slider {
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
width: 63%;
|
||||
height: 6px;
|
||||
position: relative;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-slider .ui-slider .ui-slider-handle {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-slider .ui-slider .ui-slider-range {
|
||||
background-color: #3858e9;
|
||||
height: 100%;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-slider .consultstreet-slider-input {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-slider .consultstreet-slider-input .slider-reset {
|
||||
padding-left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Control: Sortable. */
|
||||
.customize-control-consultstreet-sortable ul.ui-sortable li {
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #333;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-sortable ul.ui-sortable li .dashicons.dashicons-menu {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-sortable ul.ui-sortable li .dashicons.visibility {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-sortable ul.ui-sortable li.invisible {
|
||||
color: #aaa;
|
||||
border: 1px dashed #aaa;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-sortable ul.ui-sortable li.invisible .dashicons.visibility {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
/* Control: Switch. */
|
||||
.customize-control-consultstreet-toggle {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle label {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle label .customize-control-title {
|
||||
width: calc(100% - 55px);
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle label .description {
|
||||
-webkit-box-ordinal-group: 100;
|
||||
-ms-flex-order: 99;
|
||||
order: 99;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle .switch {
|
||||
border: 1px solid #b4b9be;
|
||||
display: inline-block;
|
||||
width: 35px;
|
||||
height: 12px;
|
||||
border-radius: 8px;
|
||||
background: #b4b9be;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-transition: background 350ms ease;
|
||||
transition: background 350ms ease;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle .switch::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -3px;
|
||||
-webkit-transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
|
||||
transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
|
||||
background: #999;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
-webkit-transform: translate3d(0, -50%, 0);
|
||||
transform: translate3d(0, -50%, 0);
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle .switch::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -3px;
|
||||
-webkit-transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
|
||||
transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
-webkit-transform: translate3d(0, -50%, 0) scale(0);
|
||||
transform: translate3d(0, -50%, 0) scale(0);
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle .switch:active::before {
|
||||
-webkit-transform: translate3d(0, -50%, 0) scale(3);
|
||||
transform: translate3d(0, -50%, 0) scale(3);
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle input:checked + .switch::before {
|
||||
background: rgba(0, 115, 170, 0.075);
|
||||
-webkit-transform: translate3d(100%, -50%, 0) scale(1);
|
||||
transform: translate3d(100%, -50%, 0) scale(1);
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle input:checked + .switch::after {
|
||||
background: #3858e9;
|
||||
-webkit-transform: translate3d(100%, -50%, 0);
|
||||
transform: translate3d(100%, -50%, 0);
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-toggle input:checked + .switch:active::before {
|
||||
background: rgba(0, 115, 170, 0.075);
|
||||
-webkit-transform: translate3d(100%, -50%, 0) scale(3);
|
||||
transform: translate3d(100%, -50%, 0) scale(3);
|
||||
}
|
||||
|
||||
/* Control: Heading */
|
||||
|
||||
.customize-control-consultstreet-heading {
|
||||
display: list-item;
|
||||
margin-left: -12px;
|
||||
margin-right: -12px;
|
||||
padding: 7px 15px;
|
||||
background: #FFF;
|
||||
border-left: 4px solid #3858e9;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-heading h4 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.customize-control-consultstreet-heading h4 span {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
span.customize-category-select-control {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.customize-pane-child li input[type=checkbox]:focus,
|
||||
.customize-pane-child li input[type=radio]:focus{
|
||||
display: none;
|
||||
}
|
||||
|
||||
1153
wp-content/themes/consultstreet/inc/customizer/controls/js/controls.js
vendored
Normal file
1153
wp-content/themes/consultstreet/inc/customizer/controls/js/controls.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,498 @@
|
||||
/**!
|
||||
* wp-color-picker-alpha
|
||||
*
|
||||
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
|
||||
* Only run in input and is defined data alpha in true
|
||||
*
|
||||
* Version: 2.1.3
|
||||
* https://github.com/kallookoo/wp-color-picker-alpha
|
||||
* Licensed under the GPLv2 license or later.
|
||||
*/
|
||||
( function( $ ) {
|
||||
// Prevent double-init.
|
||||
if ( $.wp.wpColorPicker.prototype._hasAlpha ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Variable for some backgrounds ( grid )
|
||||
var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
|
||||
// html stuff for wpColorPicker copy of the original color-picker.js
|
||||
_after = '<div class="wp-picker-holder" />',
|
||||
_wrap = '<div class="wp-picker-container" />',
|
||||
_button = '<input type="button" class="button button-small" />',
|
||||
// Prevent CSS issues in < WordPress 4.9
|
||||
_deprecated = ( wpColorPickerL10n.current !== undefined );
|
||||
// Declare some global variables when is deprecated or not
|
||||
if ( _deprecated ) {
|
||||
var _before = '<a tabindex="0" class="wp-color-result" />';
|
||||
} else {
|
||||
var _before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
|
||||
_wrappingLabel = '<label></label>',
|
||||
_wrappingLabelText = '<span class="screen-reader-text"></span>';
|
||||
}
|
||||
/**
|
||||
* Overwrite Color
|
||||
* for enable support rbga
|
||||
*/
|
||||
Color.fn.toString = function() {
|
||||
if ( this._alpha < 1 )
|
||||
return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
|
||||
|
||||
var hex = parseInt( this._color, 10 ).toString( 16 );
|
||||
|
||||
if ( this.error )
|
||||
return '';
|
||||
|
||||
if ( hex.length < 6 )
|
||||
hex = ( '00000' + hex ).substr( -6 );
|
||||
|
||||
return '#' + hex;
|
||||
};
|
||||
|
||||
/**
|
||||
* Overwrite wpColorPicker
|
||||
*/
|
||||
$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
|
||||
_hasAlpha: true,
|
||||
/**
|
||||
* @summary Creates the color picker.
|
||||
*
|
||||
* Creates the color picker, sets default values, css classes and wraps it all in HTML.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @access private
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_create: function() {
|
||||
// Return early if Iris support is missing.
|
||||
if ( ! $.support.iris ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this,
|
||||
el = self.element;
|
||||
|
||||
// Override default options with options bound to the element.
|
||||
$.extend( self.options, el.data() );
|
||||
|
||||
// Create a color picker which only allows adjustments to the hue.
|
||||
if ( self.options.type === 'hue' ) {
|
||||
return self._createHueOnly();
|
||||
}
|
||||
|
||||
// Bind the close event.
|
||||
self.close = $.proxy( self.close, self );
|
||||
|
||||
self.initialValue = el.val();
|
||||
|
||||
// Add a CSS class to the input field.
|
||||
el.addClass( 'wp-color-picker' );
|
||||
|
||||
if ( _deprecated ) {
|
||||
el.hide().wrap( _wrap );
|
||||
self.wrap = el.parent();
|
||||
self.toggler = $( _before )
|
||||
.insertBefore( el )
|
||||
.css( { backgroundColor : self.initialValue } )
|
||||
.attr( 'title', wpColorPickerL10n.pick )
|
||||
.attr( 'data-current', wpColorPickerL10n.current );
|
||||
self.pickerContainer = $( _after ).insertAfter( el );
|
||||
self.button = $( _button ).addClass('hidden');
|
||||
} else {
|
||||
/*
|
||||
* Check if there's already a wrapping label, e.g. in the Customizer.
|
||||
* If there's no label, add a default one to match the Customizer template.
|
||||
*/
|
||||
if ( ! el.parent( 'label' ).length ) {
|
||||
// Wrap the input field in the default label.
|
||||
el.wrap( _wrappingLabel );
|
||||
// Insert the default label text.
|
||||
self.wrappingLabelText = $( _wrappingLabelText )
|
||||
.insertBefore( el )
|
||||
.text( wpColorPickerL10n.defaultLabel );
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point, either it's the standalone version or the Customizer
|
||||
* one, we have a wrapping label to use as hook in the DOM, let's store it.
|
||||
*/
|
||||
self.wrappingLabel = el.parent();
|
||||
|
||||
// Wrap the label in the main wrapper.
|
||||
self.wrappingLabel.wrap( _wrap );
|
||||
// Store a reference to the main wrapper.
|
||||
self.wrap = self.wrappingLabel.parent();
|
||||
// Set up the toggle button and insert it before the wrapping label.
|
||||
self.toggler = $( _before )
|
||||
.insertBefore( self.wrappingLabel )
|
||||
.css( { backgroundColor: self.initialValue } );
|
||||
// Set the toggle button span element text.
|
||||
self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
|
||||
// Set up the Iris container and insert it after the wrapping label.
|
||||
self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
|
||||
// Store a reference to the Clear/Default button.
|
||||
self.button = $( _button );
|
||||
}
|
||||
|
||||
// Set up the Clear/Default button.
|
||||
if ( self.options.defaultColor ) {
|
||||
self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
|
||||
if ( ! _deprecated ) {
|
||||
self.button.attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
|
||||
}
|
||||
} else {
|
||||
self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
|
||||
if ( ! _deprecated ) {
|
||||
self.button.attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
|
||||
}
|
||||
}
|
||||
|
||||
if ( _deprecated ) {
|
||||
el.wrap( '<span class="wp-picker-input-wrap" />' ).after( self.button );
|
||||
} else {
|
||||
// Wrap the wrapping label in its wrapper and append the Clear/Default button.
|
||||
self.wrappingLabel
|
||||
.wrap( '<span class="wp-picker-input-wrap hidden" />' )
|
||||
.after( self.button );
|
||||
|
||||
/*
|
||||
* The input wrapper now contains the label+input+Clear/Default button.
|
||||
* Store a reference to the input wrapper: we'll use this to toggle
|
||||
* the controls visibility.
|
||||
*/
|
||||
self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
|
||||
}
|
||||
|
||||
el.iris( {
|
||||
target: self.pickerContainer,
|
||||
hide: self.options.hide,
|
||||
width: self.options.width,
|
||||
mode: self.options.mode,
|
||||
palettes: self.options.palettes,
|
||||
/**
|
||||
* @summary Handles the onChange event if one has been defined in the options.
|
||||
*
|
||||
* Handles the onChange event if one has been defined in the options and additionally
|
||||
* sets the background color for the toggler element.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {Event} event The event that's being called.
|
||||
* @param {HTMLElement} ui The HTMLElement containing the color picker.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
change: function( event, ui ) {
|
||||
if ( self.options.alpha ) {
|
||||
self.toggler.css( { 'background-image' : 'url(' + image + ')' } );
|
||||
if ( _deprecated ) {
|
||||
self.toggler.html( '<span class="color-alpha" />' );
|
||||
} else {
|
||||
self.toggler.css( {
|
||||
'position' : 'relative'
|
||||
} );
|
||||
if ( self.toggler.find('span.color-alpha').length == 0 ) {
|
||||
self.toggler.append('<span class="color-alpha" />');
|
||||
}
|
||||
}
|
||||
|
||||
self.toggler.find( 'span.color-alpha' ).css( {
|
||||
'width' : '30px',
|
||||
'height' : '28px',
|
||||
'position' : 'absolute',
|
||||
'top' : 0,
|
||||
'left' : 0,
|
||||
'border-top-left-radius' : '2px',
|
||||
'border-bottom-left-radius' : '2px',
|
||||
'background' : ui.color.toString()
|
||||
} );
|
||||
} else {
|
||||
self.toggler.css( { backgroundColor : ui.color.toString() } );
|
||||
}
|
||||
|
||||
if ( $.isFunction( self.options.change ) ) {
|
||||
self.options.change.call( this, event, ui );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
el.val( self.initialValue );
|
||||
self._addListeners();
|
||||
|
||||
// Force the color picker to always be closed on initial load.
|
||||
if ( ! self.options.hide ) {
|
||||
self.toggler.click();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @summary Binds event listeners to the color picker.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @access private
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_addListeners: function() {
|
||||
var self = this;
|
||||
|
||||
/**
|
||||
* @summary Prevent any clicks inside this widget from leaking to the top and closing it.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {Event} event The event that's being called.
|
||||
*
|
||||
* @returs {void}
|
||||
*/
|
||||
self.wrap.on( 'click.wpcolorpicker', function( event ) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
/**
|
||||
* @summary Open or close the color picker depending on the class.
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
self.toggler.click( function(){
|
||||
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
|
||||
self.close();
|
||||
} else {
|
||||
self.open();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @summary Checks if value is empty when changing the color in the color picker.
|
||||
*
|
||||
* Checks if value is empty when changing the color in the color picker.
|
||||
* If so, the background color is cleared.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {Event} event The event that's being called.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
self.element.on( 'change', function( event ) {
|
||||
// Empty or Error = clear
|
||||
if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
|
||||
if ( self.options.alpha ) {
|
||||
if ( _deprecated ) {
|
||||
self.toggler.removeAttr( 'style' );
|
||||
}
|
||||
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
||||
} else {
|
||||
self.toggler.css( 'backgroundColor', '' );
|
||||
}
|
||||
|
||||
// fire clear callback if we have one
|
||||
if ( $.isFunction( self.options.clear ) )
|
||||
self.options.clear.call( this, event );
|
||||
}
|
||||
} );
|
||||
|
||||
/**
|
||||
* @summary Enables the user to clear or revert the color in the color picker.
|
||||
*
|
||||
* Enables the user to either clear the color in the color picker or revert back to the default color.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {Event} event The event that's being called.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
self.button.on( 'click', function( event ) {
|
||||
if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
|
||||
self.element.val( '' );
|
||||
if ( self.options.alpha ) {
|
||||
if ( _deprecated ) {
|
||||
self.toggler.removeAttr( 'style' );
|
||||
}
|
||||
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
||||
} else {
|
||||
self.toggler.css( 'backgroundColor', '' );
|
||||
}
|
||||
|
||||
if ( $.isFunction( self.options.clear ) )
|
||||
self.options.clear.call( this, event );
|
||||
|
||||
self.element.trigger( 'change' );
|
||||
} else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
|
||||
self.element.val( self.options.defaultColor ).change();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Overwrite iris
|
||||
*/
|
||||
$.widget( 'a8c.iris', $.a8c.iris, {
|
||||
_create: function() {
|
||||
this._super();
|
||||
|
||||
// Global option for check is mode rbga is enabled
|
||||
this.options.alpha = this.element.data( 'alpha' ) || false;
|
||||
|
||||
// Is not input disabled
|
||||
if ( ! this.element.is( ':input' ) )
|
||||
this.options.alpha = false;
|
||||
|
||||
if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
|
||||
var self = this,
|
||||
el = self.element,
|
||||
_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',
|
||||
aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
|
||||
aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
|
||||
controls = {
|
||||
aContainer : aContainer,
|
||||
aSlider : aSlider
|
||||
};
|
||||
|
||||
if ( typeof el.data( 'custom-width' ) !== 'undefined' ) {
|
||||
self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0;
|
||||
} else {
|
||||
self.options.customWidth = 100;
|
||||
}
|
||||
|
||||
// Set default width for input reset
|
||||
self.options.defaultWidth = el.width();
|
||||
|
||||
// Update width for input
|
||||
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != -1 )
|
||||
el.width( parseInt( 88 ) );
|
||||
|
||||
// Push new controls
|
||||
$.each( controls, function( k, v ) {
|
||||
self.controls[k] = v;
|
||||
} );
|
||||
|
||||
// Change size strip and add margin for sliders
|
||||
self.controls.square.css( { 'margin-right': '0' } );
|
||||
var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
|
||||
stripsMargin = ( emptyWidth / 6 ),
|
||||
stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
|
||||
|
||||
$.each( [ 'aContainer', 'strip' ], function( k, v ) {
|
||||
self.controls[v].width( stripsWidth ).css( { 'margin-left' : stripsMargin + 'px' } );
|
||||
} );
|
||||
|
||||
// Add new slider
|
||||
self._initControls();
|
||||
|
||||
// For updated widget
|
||||
self._change();
|
||||
}
|
||||
},
|
||||
_initControls: function() {
|
||||
this._super();
|
||||
|
||||
if ( this.options.alpha ) {
|
||||
var self = this,
|
||||
controls = self.controls;
|
||||
|
||||
controls.aSlider.slider({
|
||||
orientation : 'vertical',
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
value : parseInt( self._color._alpha * 100 ),
|
||||
slide : function( event, ui ) {
|
||||
// Update alpha value
|
||||
self._color._alpha = parseFloat( ui.value / 100 );
|
||||
self._change.apply( self, arguments );
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
_change: function() {
|
||||
this._super();
|
||||
|
||||
var self = this,
|
||||
el = self.element;
|
||||
|
||||
if ( this.options.alpha ) {
|
||||
var controls = self.controls,
|
||||
alpha = parseInt( self._color._alpha * 100 ),
|
||||
color = self._color.toRgb(),
|
||||
gradient = [
|
||||
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
|
||||
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
|
||||
],
|
||||
defaultWidth = self.options.defaultWidth,
|
||||
customWidth = self.options.customWidth,
|
||||
target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
|
||||
|
||||
// Generate background slider alpha, only for CSS3 old browser fuck!! :)
|
||||
controls.aContainer.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } );
|
||||
|
||||
if ( target.hasClass( 'wp-picker-open' ) ) {
|
||||
// Update alpha value
|
||||
controls.aSlider.slider( 'value', alpha );
|
||||
|
||||
/**
|
||||
* Disabled change opacity in default slider Saturation ( only is alpha enabled )
|
||||
* and change input width for view all value
|
||||
*/
|
||||
if ( self._color._alpha < 1 ) {
|
||||
controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) );
|
||||
el.width( parseInt( 88 ) );
|
||||
} else {
|
||||
el.width( defaultWidth );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var reset = el.data( 'reset-alpha' ) || false;
|
||||
|
||||
if ( reset ) {
|
||||
self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
|
||||
self._color._alpha = 1;
|
||||
self.active = 'external';
|
||||
self._change();
|
||||
} );
|
||||
}
|
||||
el.trigger( 'change' );
|
||||
},
|
||||
_addInputListeners: function( input ) {
|
||||
var self = this,
|
||||
debounceTimeout = 100,
|
||||
callback = function( event ) {
|
||||
var color = new Color( input.val() ),
|
||||
val = input.val();
|
||||
|
||||
input.removeClass( 'iris-error' );
|
||||
// we gave a bad color
|
||||
if ( color.error ) {
|
||||
// don't error on an empty input
|
||||
if ( val !== '' )
|
||||
input.addClass( 'iris-error' );
|
||||
} else {
|
||||
if ( color.toString() !== self._color.toString() ) {
|
||||
// let's not do this on keyup for hex shortcodes
|
||||
if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) )
|
||||
self._setOption( 'color', color.toString() );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
|
||||
|
||||
// If we initialized hidden, show on first focus. The rest is up to you.
|
||||
if ( self.options.hide ) {
|
||||
input.on( 'focus', function() {
|
||||
self.show();
|
||||
} );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
|
||||
// Auto Call plugin is class is color-picker
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
$( '.color-picker' ).wpColorPicker();
|
||||
} );
|
||||
@ -0,0 +1,7 @@
|
||||
@import "modules/control-colors";
|
||||
@import "modules/color";
|
||||
@import "modules/radio-buttonset";
|
||||
@import "modules/radio-image";
|
||||
@import "modules/slider";
|
||||
@import "modules/sortable";
|
||||
@import "modules/toggle";
|
||||
@ -0,0 +1,36 @@
|
||||
li[class|="customize-control-consultstreet-"] {
|
||||
.wp-picker-container {
|
||||
|
||||
.wp-color-result.button {
|
||||
width: 100%;
|
||||
max-width: 255px;
|
||||
height: 30px;
|
||||
margin: 0 6px 6px 0;
|
||||
padding: 0 0 0 30px;
|
||||
font-size: 11px;
|
||||
box-shadow: none;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.wp-color-result-text {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0 2px 2px 0;
|
||||
border-left: 1px solid rgba(0, 0, 0, 0.06);
|
||||
color: $c-white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
span.color-alpha {
|
||||
width: 30px;
|
||||
height: 24px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-top-left-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
$c-background: rgba(0, 0, 0, 0.15);
|
||||
$c-background-hover: rgba(0, 0, 0, 0.2);
|
||||
$c-primary: #13a1dc;
|
||||
$c-white: #fff;
|
||||
$c-shadow: rgba(0, 0, 0, 0.3);
|
||||
$c-sortable-bd: #333;
|
||||
$c-sortable-ds: #aaa;
|
||||
$c-bg-label: rgba(255, 255, 255, 0.7);
|
||||
$c-bg-checked: rgba(0, 0, 0, 0.25);
|
||||
$c-bg-switch: #b4b9be;
|
||||
$c-switch-ds: #777;
|
||||
$c-light-bg: #e4f2fc;
|
||||
@ -0,0 +1,19 @@
|
||||
.customize-control-consultstreet-radio-buttonset .buttonset {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.switch-label {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border: 1px rgba(0, 0, 0, 0.1);
|
||||
color: rgba(50, 55, 60, 0.5);
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
padding: 0.5em 1em;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.switch-input:checked + .switch-label {
|
||||
background: $c-primary;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
/* Control: Radio image. */
|
||||
|
||||
.customize-control-consultstreet-radio-image {
|
||||
|
||||
> .image {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.image-select {
|
||||
+ label {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 32%;
|
||||
margin-right: 2%;
|
||||
|
||||
&:nth-of-type( 3n ) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.image-label {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: $c-bg-label;
|
||||
font-weight: 700;
|
||||
|
||||
.inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
padding: 0.5em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover .image-label {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
input {
|
||||
display: none;
|
||||
|
||||
img {
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
&:checked + label img {
|
||||
box-shadow: 0 0 5px 2px $c-bg-checked;
|
||||
border: 1px solid $c-primary;
|
||||
}
|
||||
|
||||
+ label .image-clickable {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
.customize-control-consultstreet-slider {
|
||||
|
||||
.customize-control-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ui-slider {
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
width: 63%;
|
||||
height: 6px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-radius: 3px;
|
||||
|
||||
.ui-slider-handle {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.ui-slider-range {
|
||||
background-color: $c-primary;
|
||||
height: 100%;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.consultstreet-slider-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.slider-reset {
|
||||
padding-left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
/* Control: Sortable. */
|
||||
|
||||
.customize-control-consultstreet-sortable ul.ui-sortable li {
|
||||
padding: 5px 10px;
|
||||
border: 1px solid $c-sortable-bd;
|
||||
background: $c-white;
|
||||
|
||||
.dashicons {
|
||||
|
||||
&.dashicons-menu {
|
||||
float: right;
|
||||
}
|
||||
|
||||
&.visibility {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&.invisible {
|
||||
color: $c-sortable-ds;
|
||||
border: 1px dashed $c-sortable-ds;
|
||||
|
||||
.dashicons.visibility {
|
||||
color: $c-sortable-ds;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
/* Control: Switch. */
|
||||
|
||||
.customize-control-consultstreet-toggle {
|
||||
position: relative;
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.customize-control-title {
|
||||
width: calc(100% - 55px);
|
||||
}
|
||||
|
||||
.description {
|
||||
order: 99;
|
||||
}
|
||||
}
|
||||
|
||||
.switch {
|
||||
border: 1px solid #b4b9be;
|
||||
display: inline-block;
|
||||
width: 35px;
|
||||
height: 12px;
|
||||
border-radius: 8px;
|
||||
background: #b4b9be;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: background 350ms ease;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -3px;
|
||||
transition:
|
||||
all 350ms cubic-bezier(0, 0.95, 0.38, 0.98),
|
||||
background 150ms ease;
|
||||
background: #999;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
transform: translate3d(0, -50%, 0);
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -3px;
|
||||
transition:
|
||||
all 350ms cubic-bezier(0, 0.95, 0.38, 0.98),
|
||||
background 150ms ease;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
transform: translate3d(0, -50%, 0) scale(0);
|
||||
}
|
||||
|
||||
&:active::before {
|
||||
transform: translate3d(0, -50%, 0) scale(3);
|
||||
}
|
||||
}
|
||||
|
||||
input:checked + .switch {
|
||||
|
||||
&::before {
|
||||
background: rgba(0, 115, 170, 0.075);
|
||||
transform: translate3d(100%, -50%, 0) scale(1);
|
||||
}
|
||||
|
||||
&::after {
|
||||
background: $c-primary;
|
||||
transform: translate3d(100%, -50%, 0);
|
||||
}
|
||||
|
||||
&:active::before {
|
||||
background: rgba(0, 115, 170, 0.075);
|
||||
transform: translate3d(100%, -50%, 0) scale(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Extend default customizer panel.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Panel
|
||||
* @access public
|
||||
*/
|
||||
|
||||
if ( class_exists( 'WP_Customize_Panel' ) ) {
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Panel
|
||||
*/
|
||||
class ConsultStreet_Customize_Panel extends WP_Customize_Panel {
|
||||
|
||||
/**
|
||||
* Panel
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $panel;
|
||||
|
||||
/**
|
||||
* Control type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet_panel';
|
||||
|
||||
/**
|
||||
* Get section parameters for JS.
|
||||
*
|
||||
* @return array Exported parameters.
|
||||
*/
|
||||
public function json() {
|
||||
|
||||
$array = wp_array_slice_assoc( (array) $this, array(
|
||||
'id',
|
||||
'description',
|
||||
'priority',
|
||||
'type',
|
||||
'panel',
|
||||
) );
|
||||
$array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
|
||||
$array['content'] = $this->get_content();
|
||||
$array['active'] = $this->active();
|
||||
$array['instanceNumber'] = $this->instance_number;
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Extend default customizer section.
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
* @see WP_Customize_Section
|
||||
* @access public
|
||||
*/
|
||||
|
||||
if ( class_exists( 'WP_Customize_Section' ) ) {
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Section
|
||||
*/
|
||||
class ConsultStreet_Customize_Section extends WP_Customize_Section {
|
||||
|
||||
/**
|
||||
* Section.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $section;
|
||||
|
||||
/**
|
||||
* Type of this section.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'consultstreet_section';
|
||||
|
||||
/**
|
||||
* Gather the parameters passed to client JavaScript via JSON.
|
||||
*
|
||||
* @return array The array to be exported to the client as JSON.
|
||||
*/
|
||||
public function json() {
|
||||
$array = wp_array_slice_assoc( (array) $this, array(
|
||||
'id',
|
||||
'description',
|
||||
'priority',
|
||||
'panel',
|
||||
'type',
|
||||
'description_hidden',
|
||||
'section',
|
||||
) );
|
||||
$array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
|
||||
$array['content'] = $this->get_content();
|
||||
$array['active'] = $this->active();
|
||||
$array['instanceNumber'] = $this->instance_number;
|
||||
|
||||
if ( $this->panel ) {
|
||||
$array['customizeAction'] = sprintf( 'Customizing ▸ %s', esc_html( $this->manager->get_panel( $this->panel )->title ) );
|
||||
} else {
|
||||
$array['customizeAction'] = 'Customizing';
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,299 @@
|
||||
<?php
|
||||
|
||||
class ConsultStreet_Customizer_Notify_Section extends WP_Customize_Section {
|
||||
|
||||
public $type = 'consultstreet-customizer-notify-section';
|
||||
|
||||
public $recommended_actions = '';
|
||||
|
||||
public $recommended_plugins = '';
|
||||
|
||||
public $total_actions = '';
|
||||
|
||||
public $plugin_text = '';
|
||||
|
||||
public $dismiss_button = '';
|
||||
|
||||
|
||||
public function check_active( $slug ) {
|
||||
if ( file_exists( ABSPATH . 'wp-content/plugins/' . $slug . '/' . $slug . '.php' ) ) {
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
$needs = is_plugin_active( $slug . '/' . $slug . '.php' ) ? 'deactivate' : 'activate';
|
||||
|
||||
return array(
|
||||
'status' => is_plugin_active( $slug . '/' . $slug . '.php' ),
|
||||
'needs' => $needs,
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'status' => false,
|
||||
'needs' => 'install',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function create_action_link( $state, $slug ) {
|
||||
switch ( $state ) {
|
||||
case 'install':
|
||||
return wp_nonce_url(
|
||||
add_query_arg(
|
||||
array(
|
||||
'action' => 'install-plugin',
|
||||
'plugin' => $slug,
|
||||
),
|
||||
network_admin_url( 'update.php' )
|
||||
),
|
||||
'install-plugin_' . $slug
|
||||
);
|
||||
break;
|
||||
case 'deactivate':
|
||||
return add_query_arg(
|
||||
array(
|
||||
'action' => 'deactivate',
|
||||
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
|
||||
'plugin_status' => 'all',
|
||||
'paged' => '1',
|
||||
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug . '.php' ),
|
||||
), network_admin_url( 'plugins.php' )
|
||||
);
|
||||
break;
|
||||
case 'activate':
|
||||
return add_query_arg(
|
||||
array(
|
||||
'action' => 'activate',
|
||||
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
|
||||
'plugin_status' => 'all',
|
||||
'paged' => '1',
|
||||
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ),
|
||||
), network_admin_url( 'plugins.php' )
|
||||
);
|
||||
break;
|
||||
}// End switch().
|
||||
}
|
||||
|
||||
|
||||
public function call_plugin_api( $slug ) {
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
|
||||
$call_api = get_transient( 'consultstreet_cust_notify_plugin_info_' . $slug );
|
||||
if ( false === $call_api ) {
|
||||
$call_api = plugins_api(
|
||||
'plugin_information', array(
|
||||
'slug' => $slug,
|
||||
'fields' => array(
|
||||
'downloaded' => false,
|
||||
'rating' => false,
|
||||
'description' => false,
|
||||
'short_description' => true,
|
||||
'donate_link' => false,
|
||||
'tags' => false,
|
||||
'sections' => false,
|
||||
'homepage' => false,
|
||||
'added' => false,
|
||||
'last_updated' => false,
|
||||
'compatibility' => false,
|
||||
'tested' => false,
|
||||
'requires' => false,
|
||||
'downloadlink' => false,
|
||||
'icons' => false,
|
||||
),
|
||||
)
|
||||
);
|
||||
set_transient( 'consultstreet_cust_notify_plugin_info_' . $slug, $call_api, 30 * MINUTE_IN_SECONDS );
|
||||
}
|
||||
|
||||
return $call_api;
|
||||
}
|
||||
|
||||
|
||||
public function json() {
|
||||
$json = parent::json();
|
||||
global $consultstreet_customizer_notify_recommended_actions;
|
||||
global $consultstreet_customizer_notify_recommended_plugins;
|
||||
|
||||
global $install_button_label;
|
||||
global $activate_button_label;
|
||||
global $consultstreet_deactivate_button_label;
|
||||
|
||||
$formatted_array = array();
|
||||
$consultstreet_customizer_notify_show_recommended_actions = get_option( 'consultstreet_customizer_notify_show' );
|
||||
foreach ( $consultstreet_customizer_notify_recommended_actions as $key => $consultstreet_lite_customizer_notify_recommended_action ) {
|
||||
if ( $consultstreet_customizer_notify_show_recommended_actions[ $consultstreet_lite_customizer_notify_recommended_action['id'] ] === false ) {
|
||||
continue;
|
||||
}
|
||||
if ( $consultstreet_lite_customizer_notify_recommended_action['check'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$consultstreet_lite_customizer_notify_recommended_action['index'] = $key + 1;
|
||||
|
||||
if ( isset( $consultstreet_lite_customizer_notify_recommended_action['plugin_slug'] ) ) {
|
||||
$active = $this->check_active( $consultstreet_customizer_notify_recommended_action['plugin_slug'] );
|
||||
$consultstreet_lite_customizer_notify_recommended_action['url'] = $this->create_action_link( $active['needs'], $consultstreet_lite_customizer_notify_recommended_action['plugin_slug'] );
|
||||
if ( $active['needs'] !== 'install' && $active['status'] ) {
|
||||
$consultstreet_lite_customizer_notify_recommended_action['class'] = 'active';
|
||||
} else {
|
||||
$consultstreet_lite_customizer_notify_recommended_action['class'] = '';
|
||||
}
|
||||
|
||||
switch ( $active['needs'] ) {
|
||||
case 'install':
|
||||
$consultstreet_lite_customizer_notify_recommended_action['button_class'] = 'install-now button';
|
||||
$consultstreet_lite_customizer_notify_recommended_action['button_label'] = $install_button_label;
|
||||
break;
|
||||
case 'activate':
|
||||
$consultstreet_lite_customizer_notify_recommended_action['button_class'] = 'activate-now button button-primary';
|
||||
$consultstreet_lite_customizer_notify_recommended_action['button_label'] = $activate_button_label;
|
||||
break;
|
||||
case 'deactivate':
|
||||
$consultstreet_lite_customizer_notify_recommended_action['button_class'] = 'deactivate-now button';
|
||||
$consultstreet_lite_customizer_notify_recommended_action['button_label'] = $consultstreet_deactivate_button_label;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$formatted_array[] = $consultstreet_lite_customizer_notify_recommended_action;
|
||||
}// End foreach().
|
||||
|
||||
$customize_plugins = array();
|
||||
|
||||
$consultstreet_lite_customizer_notify_show_recommended_plugins = get_option( 'consultstreet_customizer_notify_show_recommended_plugins' );
|
||||
|
||||
foreach ( $consultstreet_customizer_notify_recommended_plugins as $slug => $plugin_opt ) {
|
||||
|
||||
if ( ! $plugin_opt['recommended'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $consultstreet_lite_customizer_notify_show_recommended_plugins[ $slug ] ) && $consultstreet_lite_customizer_notify_show_recommended_plugins[ $slug ] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$active = $this->check_active( $slug );
|
||||
|
||||
if ( ! empty( $active['needs'] ) && ( $active['needs'] == 'deactivate' ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ti_customizer_notify_recommended_plugin['url'] = $this->create_action_link( $active['needs'], $slug );
|
||||
if ( $active['needs'] !== 'install' && $active['status'] ) {
|
||||
$ti_customizer_notify_recommended_plugin['class'] = 'active';
|
||||
} else {
|
||||
$ti_customizer_notify_recommended_plugin['class'] = '';
|
||||
}
|
||||
|
||||
switch ( $active['needs'] ) {
|
||||
case 'install':
|
||||
$ti_customizer_notify_recommended_plugin['button_class'] = 'install-now button';
|
||||
$ti_customizer_notify_recommended_plugin['button_label'] = $install_button_label;
|
||||
break;
|
||||
case 'activate':
|
||||
$ti_customizer_notify_recommended_plugin['button_class'] = 'activate-now button button-primary';
|
||||
$ti_customizer_notify_recommended_plugin['button_label'] = $activate_button_label;
|
||||
break;
|
||||
case 'deactivate':
|
||||
$ti_customizer_notify_recommended_plugin['button_class'] = 'deactivate-now button';
|
||||
$ti_customizer_notify_recommended_plugin['button_label'] = $consultstreet_deactivate_button_label;
|
||||
break;
|
||||
}
|
||||
$info = $this->call_plugin_api( $slug );
|
||||
$ti_customizer_notify_recommended_plugin['id'] = $slug;
|
||||
$ti_customizer_notify_recommended_plugin['plugin_slug'] = $slug;
|
||||
|
||||
if ( ! empty( $plugin_opt['description'] ) ) {
|
||||
$ti_customizer_notify_recommended_plugin['description'] = $plugin_opt['description'];
|
||||
} else {
|
||||
$ti_customizer_notify_recommended_plugin['description'] = $info->short_description;
|
||||
}
|
||||
|
||||
$ti_customizer_notify_recommended_plugin['title'] = $info->name;
|
||||
|
||||
$customize_plugins[] = $ti_customizer_notify_recommended_plugin;
|
||||
|
||||
}// End foreach().
|
||||
|
||||
$json['recommended_actions'] = $formatted_array;
|
||||
$json['recommended_plugins'] = $customize_plugins;
|
||||
$json['total_actions'] = count( $consultstreet_customizer_notify_recommended_actions );
|
||||
$json['plugin_text'] = $this->plugin_text;
|
||||
$json['dismiss_button'] = $this->dismiss_button;
|
||||
return $json;
|
||||
|
||||
}
|
||||
|
||||
protected function render_template() {
|
||||
?>
|
||||
<# if( data.recommended_actions.length > 0 || data.recommended_plugins.length > 0 ){ #>
|
||||
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
|
||||
|
||||
<h3 class="accordion-section-title">
|
||||
<span class="section-title" data-plugin_text="{{ data.plugin_text }}">
|
||||
<# if( data.recommended_actions.length > 0 ){ #>
|
||||
{{ data.title }}
|
||||
<# }else{ #>
|
||||
<# if( data.recommended_plugins.length > 0 ){ #>
|
||||
{{ data.plugin_text }}
|
||||
<# }#>
|
||||
<# } #>
|
||||
</span>
|
||||
<# if( data.recommended_actions.length > 0 ){ #>
|
||||
<span class="consultstreet-customizer-plugin-notify-actions-count">
|
||||
<span class="current-index">{{ data.recommended_actions[0].index }}</span>
|
||||
{{ data.total_actions }}
|
||||
</span>
|
||||
<# } #>
|
||||
</h3>
|
||||
<div class="consultstreet-theme-recomended-actions_container" id="plugin-filter">
|
||||
<# if( data.recommended_actions.length > 0 ){ #>
|
||||
<# for (action in data.recommended_actions) { #>
|
||||
<div class="consultstreet-recommeded-actions-container epsilon-required-actions" data-index="{{ data.recommended_actions[action].index }}">
|
||||
<# if( !data.recommended_actions[action].check ){ #>
|
||||
<div class="consultstreet-epsilon-recommeded-actions">
|
||||
<p class="title">{{ data.recommended_actions[action].title }}</p>
|
||||
<span data-action="dismiss" class="dashicons dashicons-no consultstreet-customizer-notify-dismiss-recommended-action" id="{{ data.recommended_actions[action].id }}"></span>
|
||||
<div class="description">{{{ data.recommended_actions[action].description }}}</div>
|
||||
<# if( data.recommended_actions[action].plugin_slug ){ #>
|
||||
<div class="custom-action">
|
||||
<p class="plugin-card-{{ data.recommended_actions[action].plugin_slug }} action_button {{ data.recommended_actions[action].class }}">
|
||||
<a data-slug="{{ data.recommended_actions[action].plugin_slug }}" class="{{ data.recommended_actions[action].button_class }}" href="{{ data.recommended_actions[action].url }}">{{ data.recommended_actions[action].button_label }}</a>
|
||||
</p>
|
||||
</div>
|
||||
<# } #>
|
||||
<# if( data.recommended_actions[action].help ){ #>
|
||||
<div class="custom-action">{{{ data.recommended_actions[action].help }}}</div>
|
||||
<# } #>
|
||||
</div>
|
||||
<# } #>
|
||||
</div>
|
||||
<# } #>
|
||||
<# } #>
|
||||
|
||||
<# if( data.recommended_plugins.length > 0 ){ #>
|
||||
<# for (action in data.recommended_plugins) { #>
|
||||
<div class="consultstreet-recommeded-actions-container epsilon-recommended-plugins" data-index="{{ data.recommended_plugins[action].index }}">
|
||||
<# if( !data.recommended_plugins[action].check ){ #>
|
||||
<div class="consultstreet-epsilon-recommeded-actions">
|
||||
<p class="title">{{ data.recommended_plugins[action].title }}</p>
|
||||
<span data-action="dismiss" class="dashicons dashicons-no consultstreet-customizer-notify-dismiss-button-recommended-plugin" id="{{ data.recommended_plugins[action].id }}"></span>
|
||||
<div class="description">{{{ data.recommended_plugins[action].description }}}</div>
|
||||
<# if( data.recommended_plugins[action].plugin_slug ){ #>
|
||||
<div class="custom-action">
|
||||
<p class="plugin-card-{{ data.recommended_plugins[action].plugin_slug }} action_button {{ data.recommended_plugins[action].class }}">
|
||||
<a data-slug="{{ data.recommended_plugins[action].plugin_slug }}" class="{{ data.recommended_plugins[action].button_class }}" href="{{ data.recommended_plugins[action].url }}">{{ data.recommended_plugins[action].button_label }}</a>
|
||||
</p>
|
||||
</div>
|
||||
<# } #>
|
||||
<# if( data.recommended_plugins[action].help ){ #>
|
||||
<div class="custom-action">{{{ data.recommended_plugins[action].help }}}</div>
|
||||
<# } #>
|
||||
</div>
|
||||
<# } #>
|
||||
</div>
|
||||
<# } #>
|
||||
<# } #>
|
||||
</div>
|
||||
</li>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,208 @@
|
||||
<?php
|
||||
|
||||
class ConsultStreet_Customizer_Notify {
|
||||
|
||||
private $recommended_actions;
|
||||
|
||||
|
||||
private $recommended_plugins;
|
||||
|
||||
|
||||
private static $instance;
|
||||
|
||||
|
||||
private $recommended_actions_title;
|
||||
|
||||
|
||||
private $recommended_plugins_title;
|
||||
|
||||
|
||||
private $dismiss_button;
|
||||
|
||||
|
||||
private $install_button_label;
|
||||
|
||||
|
||||
private $activate_button_label;
|
||||
|
||||
|
||||
private $consultstreet_deactivate_button_label;
|
||||
|
||||
private $config;
|
||||
|
||||
|
||||
public static function init( $config ) {
|
||||
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof ConsultStreet_Customizer_Notify ) ) {
|
||||
self::$instance = new ConsultStreet_Customizer_Notify;
|
||||
if ( ! empty( $config ) && is_array( $config ) ) {
|
||||
self::$instance->config = $config;
|
||||
self::$instance->setup_config();
|
||||
self::$instance->setup_actions();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function setup_config() {
|
||||
|
||||
global $consultstreet_customizer_notify_recommended_plugins;
|
||||
global $consultstreet_customizer_notify_recommended_actions;
|
||||
|
||||
global $install_button_label;
|
||||
global $activate_button_label;
|
||||
global $consultstreet_deactivate_button_label;
|
||||
|
||||
$this->recommended_actions = isset( $this->config['recommended_actions'] ) ? $this->config['recommended_actions'] : array();
|
||||
$this->recommended_plugins = isset( $this->config['recommended_plugins'] ) ? $this->config['recommended_plugins'] : array();
|
||||
|
||||
$this->recommended_actions_title = isset( $this->config['recommended_actions_title'] ) ? $this->config['recommended_actions_title'] : '';
|
||||
$this->recommended_plugins_title = isset( $this->config['recommended_plugins_title'] ) ? $this->config['recommended_plugins_title'] : '';
|
||||
$this->dismiss_button = isset( $this->config['dismiss_button'] ) ? $this->config['dismiss_button'] : '';
|
||||
|
||||
$consultstreet_customizer_notify_recommended_plugins = array();
|
||||
$consultstreet_customizer_notify_recommended_actions = array();
|
||||
|
||||
if ( isset( $this->recommended_plugins ) ) {
|
||||
$consultstreet_customizer_notify_recommended_plugins = $this->recommended_plugins;
|
||||
}
|
||||
|
||||
if ( isset( $this->recommended_actions ) ) {
|
||||
$consultstreet_customizer_notify_recommended_actions = $this->recommended_actions;
|
||||
}
|
||||
|
||||
$install_button_label = isset( $this->config['install_button_label'] ) ? $this->config['install_button_label'] : '';
|
||||
$activate_button_label = isset( $this->config['activate_button_label'] ) ? $this->config['activate_button_label'] : '';
|
||||
$consultstreet_deactivate_button_label = isset( $this->config['consultstreet_deactivate_button_label'] ) ? $this->config['consultstreet_deactivate_button_label'] : '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function setup_actions() {
|
||||
|
||||
// Register the section
|
||||
add_action( 'customize_register', array( $this, 'consultstreet_plugin_notification_customize_register' ) );
|
||||
|
||||
// Enqueue scripts and styles
|
||||
add_action( 'customize_controls_enqueue_scripts', array( $this, 'consultstreet_customizer_notify_scripts_for_customizer' ), 0 );
|
||||
|
||||
/* ajax callback for dismissable recommended actions */
|
||||
add_action( 'wp_ajax_quality_customizer_notify_dismiss_action', array( $this, 'consultstreet_customizer_notify_dismiss_recommended_action_callback' ) );
|
||||
|
||||
add_action( 'wp_ajax_ti_customizer_notify_dismiss_recommended_plugins', array( $this, 'consultstreet_customizer_notify_dismiss_recommended_plugins_callback' ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function consultstreet_customizer_notify_scripts_for_customizer() {
|
||||
|
||||
wp_enqueue_style( 'consultstreet-customizer-notify-css', get_template_directory_uri() . '/inc/customizer/customizer-notice/css/consultstreet-customizer-notify.css', array());
|
||||
|
||||
wp_enqueue_style( 'plugin-install' );
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
wp_add_inline_script( 'plugin-install', 'var pagenow = "customizer";' );
|
||||
|
||||
wp_enqueue_script( 'updates' );
|
||||
|
||||
wp_enqueue_script( 'consultstreet-customizer-notify-js', get_template_directory_uri() . '/inc/customizer/customizer-notice/js/consultstreet-customizer-notify.js', array( 'customize-controls' ));
|
||||
wp_localize_script(
|
||||
'consultstreet-customizer-notify-js', 'consultstreetCustomizercompanionObject', array(
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
||||
'template_directory' => get_template_directory_uri(),
|
||||
'base_path' => admin_url(),
|
||||
'activating_string' => __( 'Activating', 'consultstreet' ),
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function consultstreet_plugin_notification_customize_register( $wp_customize ) {
|
||||
|
||||
|
||||
require_once get_template_directory() . '/inc/customizer/customizer-notice/consultstreet-customizer-notify-section.php';
|
||||
|
||||
$wp_customize->register_section_type( 'ConsultStreet_Customizer_Notify_Section' );
|
||||
|
||||
$wp_customize->add_section(
|
||||
new consultstreet_Customizer_Notify_Section(
|
||||
$wp_customize,
|
||||
'ConsultStreet-customizer-notify-section',
|
||||
array(
|
||||
'title' => $this->recommended_actions_title,
|
||||
'plugin_text' => $this->recommended_plugins_title,
|
||||
'dismiss_button' => $this->dismiss_button,
|
||||
'priority' => 0,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function consultstreet_customizer_notify_dismiss_recommended_action_callback() {
|
||||
|
||||
global $consultstreet_customizer_notify_recommended_actions;
|
||||
|
||||
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
|
||||
|
||||
echo esc_html( $action_id ); /* this is needed and it's the id of the dismissable required action */
|
||||
|
||||
if ( ! empty( $action_id ) ) {
|
||||
|
||||
if ( get_option( 'consultstreet_customizer_notify_show' ) ) {
|
||||
|
||||
$consultstreet_customizer_notify_show_recommended_actions = get_option( 'consultstreet_customizer_notify_show' );
|
||||
switch ( $_GET['todo'] ) {
|
||||
case 'add':
|
||||
$consultstreet_customizer_notify_show_recommended_actions[ $action_id ] = true;
|
||||
break;
|
||||
case 'dismiss':
|
||||
$consultstreet_customizer_notify_show_recommended_actions[ $action_id ] = false;
|
||||
break;
|
||||
}
|
||||
update_option( 'consultstreet_customizer_notify_show', $consultstreet_customizer_notify_show_recommended_actions );
|
||||
|
||||
|
||||
} else {
|
||||
$consultstreet_customizer_notify_show_recommended_actions = array();
|
||||
if ( ! empty( $consultstreet_customizer_notify_recommended_actions ) ) {
|
||||
foreach ( $consultstreet_customizer_notify_recommended_actions as $consultstreet_lite_customizer_notify_recommended_action ) {
|
||||
if ( $consultstreet_lite_customizer_notify_recommended_action['id'] == $action_id ) {
|
||||
$consultstreet_customizer_notify_show_recommended_actions[ $consultstreet_lite_customizer_notify_recommended_action['id'] ] = false;
|
||||
} else {
|
||||
$consultstreet_customizer_notify_show_recommended_actions[ $consultstreet_lite_customizer_notify_recommended_action['id'] ] = true;
|
||||
}
|
||||
}
|
||||
update_option( 'consultstreet_customizer_notify_show', $consultstreet_customizer_notify_show_recommended_actions );
|
||||
}
|
||||
}
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
public function consultstreet_customizer_notify_dismiss_recommended_plugins_callback() {
|
||||
|
||||
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
|
||||
|
||||
echo esc_html( $action_id ); /* this is needed and it's the id of the dismissable required action */
|
||||
|
||||
if ( ! empty( $action_id ) ) {
|
||||
|
||||
$consultstreet_lite_customizer_notify_show_recommended_plugins = get_option( 'consultstreet_customizer_notify_show_recommended_plugins' );
|
||||
|
||||
switch ( $_GET['todo'] ) {
|
||||
case 'add':
|
||||
$consultstreet_lite_customizer_notify_show_recommended_plugins[ $action_id ] = false;
|
||||
break;
|
||||
case 'dismiss':
|
||||
$consultstreet_lite_customizer_notify_show_recommended_plugins[ $action_id ] = true;
|
||||
break;
|
||||
}
|
||||
update_option( 'consultstreet_customizer_notify_show_recommended_plugins', $consultstreet_lite_customizer_notify_show_recommended_plugins );
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Customizer Notifications
|
||||
*/
|
||||
|
||||
require get_template_directory() . '/inc/customizer/customizer-notice/consultstreet-customizer-notify.php';
|
||||
|
||||
$consultstreet_config_customizer = array(
|
||||
'recommended_plugins' => array(
|
||||
'arile-extra' => array(
|
||||
'recommended' => true,
|
||||
'description' => sprintf(
|
||||
/* translators: %s: plugin name */
|
||||
esc_html__( 'If you want to show all the features and business sections of the FrontPage. please install and activate %s plugin', 'consultstreet' ), '<strong>Arile Extra</strong>'
|
||||
),
|
||||
),
|
||||
),
|
||||
'recommended_actions' => array(),
|
||||
'recommended_actions_title' => esc_html__( 'Recommended Actions', 'consultstreet' ),
|
||||
'recommended_plugins_title' => esc_html__( 'Recommended Plugin', 'consultstreet' ),
|
||||
'install_button_label' => esc_html__( 'Install and Activate', 'consultstreet' ),
|
||||
'activate_button_label' => esc_html__( 'Activate', 'consultstreet' ),
|
||||
'consultstreet_deactivate_button_label' => esc_html__( 'Deactivate', 'consultstreet' ),
|
||||
);
|
||||
ConsultStreet_Customizer_Notify::init( apply_filters( 'consultstreet_customizer_notify_array', $consultstreet_config_customizer ) );
|
||||
@ -0,0 +1,139 @@
|
||||
.consultstreet-customizer-plugin-notify-actions-count {
|
||||
display: inline-block;
|
||||
z-index: 26;
|
||||
margin: 1px 0 0 2px;
|
||||
padding: 0 6px;
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
background-color: #d54e21;
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
line-height: 17px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
div.consultstreet-theme-recomended-actions_container {
|
||||
margin-bottom: 2em;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container p.succes {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions p.title {
|
||||
margin-bottom: 0;
|
||||
color: #555d66;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions div.description {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions .custom-action {
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
border-top: 1px solid #fafafa;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions .custom-action p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .consultstreet-recommeded-actions-container:not(:first-child) {
|
||||
overflow: hidden;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .consultstreet-recommeded-actions-container:first-child {
|
||||
height: auto;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .consultstreet-recommeded-actions-container {
|
||||
-webkit-transition: opacity 2s;
|
||||
/* Safari */
|
||||
transition: opacity 2s;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.consultstreet-customizer-plugin-notify-actions-count.complete {
|
||||
background-color: #79ba49;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container #demo_content .button {
|
||||
display: block;
|
||||
margin-bottom: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .succes a {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .succes a.social {
|
||||
width: 49%;
|
||||
margin-bottom: 1em;
|
||||
padding-top: 4px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .succes a.social span,
|
||||
.consultstreet-theme-recomended-actions_container .succes span {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.consultstreet-theme-recomended-actions_container .succes {
|
||||
padding-top: 4px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.consultstreet-customizer-notify-dismiss-button-recommended-plugin,
|
||||
.consultstreet-customizer-notify-dismiss-recommended-action {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
border-radius: 50%;
|
||||
color: #d54e21;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.consultstreet-customizer-notify-dismiss-recommended-action,
|
||||
.consultstreet-epsilon-recommeded-actions .consultstreet-customizer-notify-dismiss-button-recommended-plugin {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions #temp_load {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
}
|
||||
|
||||
.consultstreet-epsilon-recommeded-actions #temp_load img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
@ -0,0 +1,182 @@
|
||||
/**
|
||||
* Customizer notification system
|
||||
*/
|
||||
|
||||
|
||||
(function (api) {
|
||||
|
||||
api.sectionConstructor['consultstreet-customizer-notify-section'] = api.Section.extend(
|
||||
{
|
||||
|
||||
// No events for this type of section.
|
||||
attachEvents: function () {
|
||||
},
|
||||
|
||||
// Always make the section active.
|
||||
isContextuallyActive: function () {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
})( wp.customize );
|
||||
|
||||
jQuery( document ).ready(
|
||||
function () {
|
||||
|
||||
jQuery( '.consultstreet-customizer-notify-dismiss-recommended-action' ).click(
|
||||
function () {
|
||||
|
||||
var id = jQuery( this ).attr( 'id' ),
|
||||
action = jQuery( this ).attr( 'data-action' );
|
||||
jQuery.ajax(
|
||||
{
|
||||
type: 'GET',
|
||||
data: {action: 'consultstreet_customizer_notify_dismiss_action', id: id, todo: action},
|
||||
dataType: 'html',
|
||||
url: consultstreetCustomizercompanionObject.ajaxurl,
|
||||
beforeSend: function () {
|
||||
jQuery( '#' + id ).parent().append( '<div id="temp_load" style="text-align:center"><img src="' + consultstreetCustomizercompanionObject.base_path + '/images/spinner-2x.gif" /></div>' );
|
||||
},
|
||||
success: function (data) {
|
||||
var container = jQuery( '#' + data ).parent().parent();
|
||||
var index = container.next().data( 'index' );
|
||||
var recommended_sction = jQuery( '#accordion-section-ti_customizer_notify_recomended_actions' );
|
||||
var actions_count = recommended_sction.find( '.consultstreet-customizer-plugin-notify-actions-count' );
|
||||
var section_title = recommended_sction.find( '.section-title' );
|
||||
jQuery( '.consultstreet-customizer-plugin-notify-actions-count .current-index' ).text( index );
|
||||
container.slideToggle().remove();
|
||||
if (jQuery( '.consultstreet-theme-recomended-actions_container > .epsilon-recommended-actions' ).length === 0) {
|
||||
|
||||
actions_count.remove();
|
||||
|
||||
if (jQuery( '.consultstreet-theme-recomended-actions_container > .epsilon-recommended-plugins' ).length === 0) {
|
||||
jQuery( '.control-section-ti-customizer-notify-recomended-actions' ).remove();
|
||||
} else {
|
||||
section_title.text( section_title.data( 'plugin_text' ) );
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
console.log( jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
jQuery( '.consultstreet-customizer-notify-dismiss-button-recommended-plugin' ).click(
|
||||
function () {
|
||||
var id = jQuery( this ).attr( 'id' ),
|
||||
action = jQuery( this ).attr( 'data-action' );
|
||||
jQuery.ajax(
|
||||
{
|
||||
type: 'GET',
|
||||
data: {action: 'ti_customizer_notify_dismiss_recommended_plugins', id: id, todo: action},
|
||||
dataType: 'html',
|
||||
url: consultstreetCustomizercompanionObject.ajaxurl,
|
||||
beforeSend: function () {
|
||||
jQuery( '#' + id ).parent().append( '<div id="temp_load" style="text-align:center"><img src="' + consultstreetCustomizercompanionObject.base_path + '/images/spinner-2x.gif" /></div>' );
|
||||
},
|
||||
success: function (data) {
|
||||
var container = jQuery( '#' + data ).parent().parent();
|
||||
var index = container.next().data( 'index' );
|
||||
jQuery( '.consultstreet-customizer-plugin-notify-actions-count .current-index' ).text( index );
|
||||
container.slideToggle().remove();
|
||||
|
||||
if (jQuery( '.consultstreet-theme-recomended-actions_container > .epsilon-recommended-plugins' ).length === 0) {
|
||||
jQuery( '.control-section-ti-customizer-notify-recomended-section' ).remove();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
console.log( jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Remove activate button and replace with activation in progress button.
|
||||
jQuery( document ).on(
|
||||
'DOMNodeInserted','.activate-now', function () {
|
||||
var activateButton = jQuery( '.activate-now' );
|
||||
if (activateButton.length) {
|
||||
var url = jQuery( activateButton ).attr( 'href' );
|
||||
if (typeof url !== 'undefined') {
|
||||
// Request plugin activation.
|
||||
jQuery.ajax(
|
||||
{
|
||||
beforeSend: function () {
|
||||
jQuery( activateButton ).replaceWith( '<a class="button updating-message">' + consultstreetCustomizercompanionObject.activating_string + '...</a>' );
|
||||
},
|
||||
async: true,
|
||||
type: 'GET',
|
||||
url: url,
|
||||
success: function () {
|
||||
// Reload the page.
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Remove activate button and replace with activation in progress button.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
|
||||
jQuery( document ).ready(
|
||||
function ($) {
|
||||
$( 'body' ).on(
|
||||
'click', ' .consultstreet-install-plugin ', function () {
|
||||
var slug = $( this ).attr( 'data-slug' );
|
||||
|
||||
wp.updates.installPlugin(
|
||||
{
|
||||
slug: slug
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$( '.activate-now' ).on(
|
||||
'click', function (e) {
|
||||
|
||||
var activateButton = $( this );
|
||||
e.preventDefault();
|
||||
if ($( activateButton ).length) {
|
||||
var url = $( activateButton ).attr( 'href' );
|
||||
|
||||
if (typeof url !== 'undefined') {
|
||||
// Request plugin activation.
|
||||
$.ajax(
|
||||
{
|
||||
beforeSend: function () {
|
||||
$( activateButton ).replaceWith( '<a class="button updating-message">'+"activating"+'...</a>' );
|
||||
},
|
||||
async: true,
|
||||
type: 'GET',
|
||||
url: url,
|
||||
success: function () {
|
||||
// Reload the page.
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
@ -0,0 +1,669 @@
|
||||
<?php if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
class ConsultStreet_Repeater extends WP_Customize_Control {
|
||||
|
||||
public $id;
|
||||
private $boxtitle = array();
|
||||
private $add_field_label = array();
|
||||
private $customizer_repeater_title_control = false;
|
||||
private $customizer_repeater_subtitle_control = false;
|
||||
private $customizer_repeater_button_text_control = false;
|
||||
private $customizer_repeater_link_control = false;
|
||||
private $customizer_repeater_slide_format = false;
|
||||
private $customizer_repeater_video_url_control = false;
|
||||
private $customizer_repeater_image_control = false;
|
||||
private $customizer_repeater_icon_control = false;
|
||||
private $customizer_repeater_color_control = false;
|
||||
private $customizer_repeater_text_control = false;
|
||||
private $customizer_repeater_designation_control = false;
|
||||
private $customizer_repeater_shortcode_control = false;
|
||||
private $customizer_repeater_repeater_control = false;
|
||||
private $customizer_repeater_checkbox_control = false;
|
||||
|
||||
private $customizer_icon_container = '';
|
||||
private $allowed_html = array();
|
||||
|
||||
|
||||
/*Class constructor*/
|
||||
public function __construct( $manager, $id, $args = array() ) {
|
||||
parent::__construct( $manager, $id, $args );
|
||||
/*Get options from customizer.php*/
|
||||
$this->add_field_label = esc_html__( 'Add new field', 'consultstreet' );
|
||||
if ( ! empty( $args['add_field_label'] ) ) {
|
||||
$this->add_field_label = $args['add_field_label'];
|
||||
}
|
||||
|
||||
$this->boxtitle = esc_html__( 'Customizer Repeater', 'consultstreet' );
|
||||
if ( ! empty ( $args['item_name'] ) ) {
|
||||
$this->boxtitle = $args['item_name'];
|
||||
} elseif ( ! empty( $this->label ) ) {
|
||||
$this->boxtitle = $this->label;
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_image_control'] ) ) {
|
||||
$this->customizer_repeater_image_control = $args['customizer_repeater_image_control'];
|
||||
}
|
||||
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_icon_control'] ) ) {
|
||||
$this->customizer_repeater_icon_control = $args['customizer_repeater_icon_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_color_control'] ) ) {
|
||||
$this->customizer_repeater_color_control = $args['customizer_repeater_color_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_title_control'] ) ) {
|
||||
$this->customizer_repeater_title_control = $args['customizer_repeater_title_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_subtitle_control'] ) ) {
|
||||
$this->customizer_repeater_subtitle_control = $args['customizer_repeater_subtitle_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_text_control'] ) ) {
|
||||
$this->customizer_repeater_text_control = $args['customizer_repeater_text_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_designation_control'] ) ) {
|
||||
$this->customizer_repeater_designation_control = $args['customizer_repeater_designation_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_button_text_control'] ) ) {
|
||||
$this->customizer_repeater_button_text_control = $args['customizer_repeater_button_text_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_link_control'] ) ) {
|
||||
$this->customizer_repeater_link_control = $args['customizer_repeater_link_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_checkbox_control'] ) ) {
|
||||
$this->customizer_repeater_checkbox_control = $args['customizer_repeater_checkbox_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_slide_format'] ) ) {
|
||||
$this->customizer_repeater_slide_format = $args['customizer_repeater_slide_format'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_video_url_control'] ) ) {
|
||||
$this->customizer_repeater_video_url_control = $args['customizer_repeater_video_url_control'];
|
||||
}
|
||||
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_shortcode_control'] ) ) {
|
||||
$this->customizer_repeater_shortcode_control = $args['customizer_repeater_shortcode_control'];
|
||||
}
|
||||
|
||||
if ( ! empty( $args['customizer_repeater_repeater_control'] ) ) {
|
||||
$this->customizer_repeater_repeater_control = $args['customizer_repeater_repeater_control'];
|
||||
}
|
||||
|
||||
|
||||
if ( ! empty( $id ) ) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
if ( file_exists( get_template_directory() . '/inc/customizer/customizer-repeater/inc/icons.php' ) ) {
|
||||
$this->customizer_icon_container = 'inc/customizer/customizer-repeater/inc/icons';
|
||||
}
|
||||
|
||||
$allowed_array1 = wp_kses_allowed_html( 'post' );
|
||||
$allowed_array2 = array(
|
||||
'input' => array(
|
||||
'type' => array(),
|
||||
'class' => array(),
|
||||
'placeholder' => array()
|
||||
)
|
||||
);
|
||||
|
||||
$this->allowed_html = array_merge( $allowed_array1, $allowed_array2 );
|
||||
}
|
||||
|
||||
/*Enqueue resources for the control*/
|
||||
public function enqueue() {
|
||||
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/css/font-awesome/css/font-awesome.min.css', array(), 999 );
|
||||
|
||||
wp_enqueue_style( 'consultstreet_customizer-repeater-admin-stylesheet', get_template_directory_uri() . '/inc/customizer/customizer-repeater/css/admin-style.css', array(), 999 );
|
||||
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
|
||||
wp_enqueue_script( 'consultstreet_customizer-repeater-script', get_template_directory_uri() . '/inc/customizer/customizer-repeater/js/customizer_repeater.js', array('jquery', 'jquery-ui-draggable', 'wp-color-picker' ), 999, true );
|
||||
|
||||
wp_enqueue_script( 'consultstreet_customizer-repeater-fontawesome-iconpicker', get_template_directory_uri() . '/inc/customizer/customizer-repeater/js/fontawesome-iconpicker.js', array( 'jquery' ), 999, true );
|
||||
|
||||
wp_enqueue_style( 'consultstreet_customizer-repeater-fontawesome-iconpicker-script', get_template_directory_uri() . '/inc/customizer/customizer-repeater/css/fontawesome-iconpicker.min.css', array(), 999 );
|
||||
}
|
||||
|
||||
public function render_content() {
|
||||
|
||||
/*Get default options*/
|
||||
$this_default = json_decode( $this->setting->default );
|
||||
|
||||
/*Get values (json format)*/
|
||||
$values = $this->value();
|
||||
|
||||
/*Decode values*/
|
||||
$json = json_decode( $values );
|
||||
|
||||
if ( ! is_array( $json ) ) {
|
||||
$json = array( $values );
|
||||
} ?>
|
||||
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<div class="customizer-repeater-general-control-repeater customizer-repeater-general-control-droppable">
|
||||
<?php
|
||||
if ( ( count( $json ) == 1 && '' === $json[0] ) || empty( $json ) ) {
|
||||
if ( ! empty( $this_default ) ) {
|
||||
$this->iterate_array( $this_default ); ?>
|
||||
<input type="hidden"
|
||||
id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
|
||||
class="customizer-repeater-colector"
|
||||
value="<?php echo esc_textarea( json_encode( $this_default ) ); ?>"/>
|
||||
<?php
|
||||
} else {
|
||||
$this->iterate_array(); ?>
|
||||
<input type="hidden"
|
||||
id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
|
||||
class="customizer-repeater-colector"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
$this->iterate_array( $json ); ?>
|
||||
<input type="hidden" id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
|
||||
class="customizer-repeater-colector" value="<?php echo esc_textarea( $this->value() ); ?>"/>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
<button type="button" class="button add_field customizer-repeater-new-field">
|
||||
<?php echo esc_html( $this->add_field_label ); ?>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function iterate_array($array = array()){
|
||||
|
||||
/*Counter that helps checking if the box is first and should have the delete button disabled*/
|
||||
$it = 0;
|
||||
if(!empty($array)){
|
||||
foreach($array as $icon){ ?>
|
||||
<div class="customizer-repeater-general-control-repeater-container customizer-repeater-draggable">
|
||||
<div class="customizer-repeater-customize-control-title">
|
||||
<?php echo esc_html( $this->boxtitle ) ?>
|
||||
</div>
|
||||
<div class="customizer-repeater-box-content-hidden">
|
||||
<?php
|
||||
$choice = $image_url = $icon_value = $title = $subtitle = $text = $slide_format = $link = $designation = $button = $open_new_tab = $shortcode = $repeater = $color = $video_url = '';
|
||||
if(!empty($icon->id)){
|
||||
$id = $icon->id;
|
||||
}
|
||||
if(!empty($icon->choice)){
|
||||
$choice = $icon->choice;
|
||||
}
|
||||
if(!empty($icon->image_url)){
|
||||
$image_url = $icon->image_url;
|
||||
}
|
||||
if(!empty($icon->icon_value)){
|
||||
$icon_value = $icon->icon_value;
|
||||
}
|
||||
if(!empty($icon->color)){
|
||||
$color = $icon->color;
|
||||
}
|
||||
if(!empty($icon->title)){
|
||||
$title = $icon->title;
|
||||
}
|
||||
|
||||
if(!empty($icon->designation)){
|
||||
$designation = $icon->designation;
|
||||
}
|
||||
|
||||
if(!empty($icon->subtitle)){
|
||||
$subtitle = $icon->subtitle;
|
||||
}
|
||||
if(!empty($icon->text)){
|
||||
$text = $icon->text;
|
||||
}
|
||||
if(!empty($icon->video_url)){
|
||||
$video_url = $icon->video_url;
|
||||
}
|
||||
|
||||
if(!empty($icon->slide_format)){
|
||||
$slide_format = $icon->slide_format;
|
||||
}
|
||||
|
||||
if(!empty($icon->button_text)){
|
||||
$button = $icon->button_text;
|
||||
}
|
||||
if(!empty($icon->link)){
|
||||
$link = $icon->link;
|
||||
}
|
||||
if(!empty($icon->shortcode)){
|
||||
$shortcode = $icon->shortcode;
|
||||
}
|
||||
|
||||
if(!empty($icon->social_repeater)){
|
||||
$repeater = $icon->social_repeater;
|
||||
}
|
||||
|
||||
if(!empty($icon->open_new_tab)){
|
||||
$open_new_tab = $icon->open_new_tab;
|
||||
}
|
||||
|
||||
|
||||
if($this->customizer_repeater_title_control==true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Title','consultstreet' ), $this->id, 'customizer_repeater_title_control' ),
|
||||
'class' => 'customizer-repeater-title-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
|
||||
), $title);
|
||||
}
|
||||
if($this->customizer_repeater_subtitle_control==true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Subtitle','consultstreet' ), $this->id, 'customizer_repeater_subtitle_control' ),
|
||||
'class' => 'customizer-repeater-subtitle-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
|
||||
), $subtitle);
|
||||
}
|
||||
if($this->customizer_repeater_text_control==true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Description','consultstreet' ), $this->id, 'customizer_repeater_text_control' ),
|
||||
'class' => 'customizer-repeater-text-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
|
||||
), $text);
|
||||
}
|
||||
|
||||
|
||||
if($this->customizer_repeater_button_text_control){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__('Button Text',
|
||||
'consultstreet'), $this->id, 'customizer_repeater_button_text_control'),
|
||||
'class' => 'customizer-repeater-button-text-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '' , $this->id,
|
||||
'customizer_repeater_button_text_control'),
|
||||
), $button);
|
||||
}
|
||||
|
||||
|
||||
if($this->customizer_repeater_link_control){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Link','consultstreet' ), $this->id, 'customizer_repeater_link_control' ),
|
||||
'class' => 'customizer-repeater-link-control',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
|
||||
), $link);
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_checkbox_control == true){
|
||||
$this->testimonila_check($open_new_tab);
|
||||
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_slide_format == true){
|
||||
$this->slide_format($slide_format);
|
||||
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_video_url_control){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__('Video Url',
|
||||
'consultstreet'), $this->id, 'customizer_repeater_video_url_control'),
|
||||
'class' => 'customizer-repeater-video-url-control',
|
||||
'type' => apply_filters('customizer_repeater_video_url_control', 'textarea', $this->id, 'customizer_repeater_video_url_control' ),
|
||||
), $video_url);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true) {
|
||||
$this->icon_type_choice( $choice );
|
||||
}
|
||||
if($this->customizer_repeater_image_control == true){
|
||||
$this->image_control($image_url, $choice);
|
||||
}
|
||||
if($this->customizer_repeater_icon_control == true){
|
||||
$this->icon_picker_control($icon_value, $choice);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($this->customizer_repeater_color_control == true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Color','consultstreet' ), $this->id, 'customizer_repeater_color_control' ),
|
||||
'class' => 'customizer-repeater-color-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
|
||||
'sanitize_callback' => 'sanitize_hex_color'
|
||||
), $color);
|
||||
}
|
||||
|
||||
|
||||
if($this->customizer_repeater_shortcode_control==true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Shortcode','consultstreet' ), $this->id, 'customizer_repeater_shortcode_control' ),
|
||||
'class' => 'customizer-repeater-shortcode-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
|
||||
), $shortcode);
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_designation_control==true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Designation','consultstreet' ), $this->id, 'customizer_repeater_designation_control' ),
|
||||
'class' => 'customizer-repeater-designation-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_designation_control' ),
|
||||
), $designation);
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_repeater_control==true){
|
||||
$this->repeater_control($repeater);
|
||||
} ?>
|
||||
|
||||
<input type="hidden" class="social-repeater-box-id" value="<?php if ( ! empty( $id ) ) {
|
||||
echo esc_attr( $id );
|
||||
} ?>">
|
||||
<button type="button" class="social-repeater-general-control-remove-field" <?php if ( $it == 0 ) {
|
||||
echo 'style="display:none;"';
|
||||
} ?>>
|
||||
<?php esc_html_e( 'Delete field', 'consultstreet' ); ?>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$it++;
|
||||
}
|
||||
} else { ?>
|
||||
<div class="customizer-repeater-general-control-repeater-container">
|
||||
<div class="customizer-repeater-customize-control-title">
|
||||
<?php echo esc_html( $this->boxtitle ) ?>
|
||||
</div>
|
||||
<div class="customizer-repeater-box-content-hidden">
|
||||
<?php
|
||||
if ( $this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) {
|
||||
$this->icon_type_choice();
|
||||
}
|
||||
if ( $this->customizer_repeater_image_control == true ) {
|
||||
$this->image_control();
|
||||
}
|
||||
if ( $this->customizer_repeater_icon_control == true ) {
|
||||
$this->icon_picker_control();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($this->customizer_repeater_color_control==true){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Color','consultstreet' ), $this->id, 'customizer_repeater_color_control' ),
|
||||
'class' => 'customizer-repeater-color-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
|
||||
'sanitize_callback' => 'sanitize_hex_color'
|
||||
) );
|
||||
}
|
||||
if ( $this->customizer_repeater_title_control == true ) {
|
||||
$this->input_control( array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Title','consultstreet' ), $this->id, 'customizer_repeater_title_control' ),
|
||||
'class' => 'customizer-repeater-title-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
|
||||
) );
|
||||
}
|
||||
if ( $this->customizer_repeater_subtitle_control == true ) {
|
||||
$this->input_control( array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Subtitle','consultstreet' ), $this->id, 'customizer_repeater_subtitle_control' ),
|
||||
'class' => 'customizer-repeater-subtitle-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
|
||||
) );
|
||||
}
|
||||
if ( $this->customizer_repeater_text_control == true ) {
|
||||
$this->input_control( array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Description','consultstreet' ), $this->id, 'customizer_repeater_text_control' ),
|
||||
'class' => 'customizer-repeater-text-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
|
||||
) );
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_button_text_control){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__('Button Text',
|
||||
'consultstreet'), $this->id, 'customizer_repeater_button_text_control'),
|
||||
'class' => 'customizer-repeater-button-text-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '' , $this->id,
|
||||
'customizer_repeater_button_text_control'),
|
||||
));
|
||||
}
|
||||
|
||||
if ( $this->customizer_repeater_link_control == true ) {
|
||||
$this->input_control( array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Link','consultstreet' ), $this->id, 'customizer_repeater_link_control' ),
|
||||
'class' => 'customizer-repeater-link-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
|
||||
) );
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_checkbox_control == true){
|
||||
$this->testimonila_check($open_new_tab);
|
||||
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_slide_format == true){
|
||||
$this->slide_format($slide_format);
|
||||
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_video_url_control){
|
||||
$this->input_control(array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__('Video Url',
|
||||
'consultstreet'), $this->id, 'customizer_repeater_video_url_control'),
|
||||
'class' => 'customizer-repeater-video-url-control',
|
||||
'type' => apply_filters('customizer_repeater_video_url_control', 'textarea', $this->id, 'customizer_repeater_video_url_control' ),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( $this->customizer_repeater_shortcode_control == true ) {
|
||||
$this->input_control( array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Shortcode','consultstreet' ), $this->id, 'customizer_repeater_shortcode_control' ),
|
||||
'class' => 'customizer-repeater-shortcode-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
if ( $this->customizer_repeater_designation_control == true ) {
|
||||
$this->input_control( array(
|
||||
'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Designation','consultstreet' ), $this->id, 'customizer_repeater_designation_control' ),
|
||||
'class' => 'customizer-repeater-designation-control',
|
||||
'type' => apply_filters('consultstreet_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_designation_control' ),
|
||||
) );
|
||||
}
|
||||
|
||||
if($this->customizer_repeater_repeater_control==true){
|
||||
$this->repeater_control();
|
||||
} ?>
|
||||
<input type="hidden" class="social-repeater-box-id">
|
||||
<button type="button" class="social-repeater-general-control-remove-field button" style="display:none;">
|
||||
<?php esc_html_e( 'Delete field', 'consultstreet' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
private function input_control( $options, $value='' ){
|
||||
//print_r($options);
|
||||
?>
|
||||
<span class="customize-control-title <?php echo esc_html( $options['label'] ); ?>"
|
||||
<?php if($options['class']== 'customizer-repeater-video-url-control') {echo 'style="display:none;"'; }?>
|
||||
|
||||
><?php echo esc_html( $options['label'] ); ?></span>
|
||||
<?php
|
||||
if( !empty($options['type']) ){
|
||||
switch ($options['type']) {
|
||||
case 'textarea':?>
|
||||
<textarea class="<?php echo esc_attr( $options['class'] ); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"><?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?></textarea>
|
||||
<?php
|
||||
break;
|
||||
case 'color': ?>
|
||||
<input type="text" value="<?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?>" class="<?php echo esc_attr($options['class']); ?>" />
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
} else { ?>
|
||||
<input type="text" value="<?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?>" class="<?php echo esc_attr($options['class']); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"/>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function testimonila_check($value='no'){
|
||||
?>
|
||||
<span class="customize-control-title">
|
||||
<?php esc_html_e('Open link in new tab','consultstreet'); ?>
|
||||
</span>
|
||||
<select class="customizer-repeater-checkbox">
|
||||
<option value="no" <?php selected($value,'no');?>>
|
||||
<?php esc_html_e('No','consultstreet') ?>
|
||||
</option>
|
||||
<option value="yes" <?php selected($value,'yes');?>>
|
||||
<?php esc_html_e('Yes','consultstreet') ?>
|
||||
</option>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function icon_picker_control($value = '', $show = ''){ ?>
|
||||
<div class="social-repeater-general-control-icon" <?php if( $show === 'customizer_repeater_image' || $show === 'customizer_repeater_none' ) { echo 'style="display:none;"'; } ?>>
|
||||
<span class="customize-control-title">
|
||||
<?php esc_html_e('Icon','consultstreet'); ?>
|
||||
</span>
|
||||
<span class="description customize-control-description">
|
||||
<?php
|
||||
echo sprintf(
|
||||
/* translators: %1$s: icon */
|
||||
esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at %1$s.', 'consultstreet' ),
|
||||
sprintf( '<a href="//fontawesome.io/icons/" rel="nofollow">%s</a>', esc_html__( '//fontawesome.io/icons/', 'consultstreet' ) )
|
||||
); ?>
|
||||
</span>
|
||||
<div class="input-group icp-container">
|
||||
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if(!empty($value)) { echo esc_attr( $value );} ?>" type="text">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa <?php echo esc_attr($value); ?>"></i>
|
||||
</span>
|
||||
</div>
|
||||
<?php get_template_part( $this->customizer_icon_container ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function image_control($value = '', $show = ''){ ?>
|
||||
<div class="customizer-repeater-image-control" <?php if( $show === 'customizer_repeater_icon' || $show === 'customizer_repeater_none' ) { echo 'style="display:none;"'; } ?>>
|
||||
<span class="customize-control-title">
|
||||
<?php esc_html_e('Image','consultstreet')?>
|
||||
</span>
|
||||
<input type="text" class="widefat custom-media-url" value="<?php echo esc_attr( $value ); ?>">
|
||||
<input type="button" class="button button-secondary customizer-repeater-custom-media-button" value="<?php esc_attr_e( 'Upload Image','consultstreet' ); ?>" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
private function slide_format($value='left'){?>
|
||||
|
||||
<span class="customize-control-title">
|
||||
<?php esc_html_e('Slide Content Format','consultstreet'); ?>
|
||||
</span>
|
||||
<select class="customizer-repeater-slide-format">
|
||||
<option value="left" <?php selected($value,'left');?>>
|
||||
<?php esc_html_e('Left','consultstreet') ?>
|
||||
</option>
|
||||
|
||||
<option value="right" <?php selected($value,'right');?>>
|
||||
<?php esc_html_e('Right','consultstreet') ?>
|
||||
</option>
|
||||
|
||||
<option value="center" <?php selected($value,'center');?>>
|
||||
<?php esc_html_e('Center','consultstreet') ?>
|
||||
</option>
|
||||
|
||||
</select>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
private function icon_type_choice($value='customizer_repeater_icon'){ ?>
|
||||
<span class="customize-control-title">
|
||||
<?php esc_html_e('Image type','consultstreet');?>
|
||||
</span>
|
||||
<select class="customizer-repeater-image-choice">
|
||||
<option value="customizer_repeater_icon" <?php selected($value,'customizer_repeater_icon');?>><?php esc_html_e('Icon','consultstreet'); ?></option>
|
||||
<option value="customizer_repeater_image" <?php selected($value,'customizer_repeater_image');?>><?php esc_html_e('Image','consultstreet'); ?></option>
|
||||
<option value="customizer_repeater_none" <?php selected($value,'customizer_repeater_none');?>><?php esc_html_e('None','consultstreet'); ?></option>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function repeater_control($value = ''){
|
||||
$social_repeater = array();
|
||||
$show_del = 0; ?>
|
||||
<span class="customize-control-title"><?php esc_html_e( 'Social icons', 'consultstreet' ); ?></span>
|
||||
<?php
|
||||
if(!empty($value)) {
|
||||
$social_repeater = json_decode( html_entity_decode( $value ), true );
|
||||
}
|
||||
if ( ( count( $social_repeater ) == 1 && '' === $social_repeater[0] ) || empty( $social_repeater ) ) { ?>
|
||||
<div class="customizer-repeater-social-repeater">
|
||||
<div class="customizer-repeater-social-repeater-container">
|
||||
<div class="customizer-repeater-rc input-group icp-container">
|
||||
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if(!empty($value)) { echo esc_attr( $value ); } ?>" type="text">
|
||||
<span class="input-group-addon"></span>
|
||||
</div>
|
||||
<?php get_template_part( $this->customizer_icon_container ); ?>
|
||||
<input type="text" class="customizer-repeater-social-repeater-link"
|
||||
placeholder="<?php esc_attr_e( 'Link', 'consultstreet' ); ?>">
|
||||
<input type="hidden" class="customizer-repeater-social-repeater-id" value="">
|
||||
<button class="social-repeater-remove-social-item" style="display:none">
|
||||
<?php esc_html_e( 'Remove Icon', 'consultstreet' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" id="social-repeater-socials-repeater-colector" class="social-repeater-socials-repeater-colector" value=""/>
|
||||
</div>
|
||||
<button class="social-repeater-add-social-item button-secondary"><?php esc_html_e( 'Add Icon', 'consultstreet' ); ?></button>
|
||||
<?php
|
||||
} else { ?>
|
||||
<div class="customizer-repeater-social-repeater">
|
||||
<?php
|
||||
foreach ( $social_repeater as $social_icon ) {
|
||||
$show_del ++; ?>
|
||||
<div class="customizer-repeater-social-repeater-container">
|
||||
<div class="customizer-repeater-rc input-group icp-container">
|
||||
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if( !empty($social_icon['icon']) ) { echo esc_attr( $social_icon['icon'] ); } ?>" type="text">
|
||||
<span class="input-group-addon"><i class="fa <?php echo esc_attr( $social_icon['icon'] ); ?>"></i></span>
|
||||
</div>
|
||||
<?php get_template_part( $this->customizer_icon_container ); ?>
|
||||
<input type="text" class="customizer-repeater-social-repeater-link"
|
||||
placeholder="<?php esc_attr_e( 'Link', 'consultstreet' ); ?>"
|
||||
value="<?php if ( ! empty( $social_icon['link'] ) ) {
|
||||
echo esc_url( $social_icon['link'] );
|
||||
} ?>">
|
||||
<input type="hidden" class="customizer-repeater-social-repeater-id"
|
||||
value="<?php if ( ! empty( $social_icon['id'] ) ) {
|
||||
echo esc_attr( $social_icon['id'] );
|
||||
} ?>">
|
||||
<button class="social-repeater-remove-social-item"
|
||||
style="<?php if ( $show_del == 1 ) {
|
||||
echo "display:none";
|
||||
} ?>"><?php esc_html_e( 'Remove Icon', 'consultstreet' ); ?></button>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
<input type="hidden" id="social-repeater-socials-repeater-colector"
|
||||
class="social-repeater-socials-repeater-colector"
|
||||
value="<?php echo esc_textarea( html_entity_decode( $value ) ); ?>" />
|
||||
</div>
|
||||
<button class="social-repeater-add-social-item button-secondary"><?php esc_html_e( 'Add Icon', 'consultstreet' ); ?></button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,216 @@
|
||||
.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customizer-repeater-customize-control-title {
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
font-size: 1em;
|
||||
line-height: 1;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: #23282d;
|
||||
border: 1px solid #e5e5e5;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.customizer-repeater-customize-control-title:hover {
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.customizer-repeater-customize-control-title:after {
|
||||
content: "\f140";
|
||||
font-family: dashicons;
|
||||
font-size: 20px;
|
||||
height: 13px;
|
||||
bottom: 3px;
|
||||
position: relative;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customizer-repeater-customize-control-title.repeater-expanded:after {
|
||||
content: "\f142";
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden {
|
||||
border: 1px solid #e5e5e5;
|
||||
border-top: none;
|
||||
padding: 1px 10px 10px;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden > div {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden .customize-control-title {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
font-weight: normal;
|
||||
margin-bottom: 0;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden .customize-control-title:after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden span.description {
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.customizer-repeater-general-control-repeater-container, .customizer-repeater-general-control-repeater_container {
|
||||
border: 1px solid #e5e5e5;
|
||||
border-top: none;
|
||||
margin-bottom: 12px;
|
||||
width: 100%;
|
||||
float: left;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden .wp-picker-container, .customizer-repeater-box-content-hidden .wp-picker-container .wp-color-result, .icp-container {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden input:not(.icp, .wp-color-picker),
|
||||
.customizer-repeater-box-content-hidden textarea,
|
||||
.customizer-repeater-box-content-hidden .wp-picker-container {
|
||||
margin-bottom: 1em !important;
|
||||
}
|
||||
|
||||
.social-repeater-general-control-remove-field {
|
||||
cursor: pointer;
|
||||
color: #a00;
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.social-repeater-general-control-remove-field:hover {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden .wp-picker-holder {
|
||||
position: relative;
|
||||
left: -10px;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden .wp-picker-input-wrap {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden .wp-picker-container .iris-picker {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
button.customizer-repeater-new-field {
|
||||
float: right;
|
||||
}
|
||||
|
||||
button.customizer-repeater-new-field:before {
|
||||
content: "\f132";
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: -2px;
|
||||
top: -1px;
|
||||
font: 400 20px/1 dashicons;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: all .2s;
|
||||
transition: all .2s;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden > div.customizer-repeater-social-repeater {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.customizer-repeater-general-control-repeater-container .customizer-repeater-icon-control {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#customizer-repeater-new-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-widget_form .widget-control-save {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.customizer-repeater-image-control .customizer-repeater-custom-media-button {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.customizer-icons {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.social-repeater-remove-social-item {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
color: #a00;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.social-repeater-remove-social-item:hover {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.customizer-repeater-social-repeater > .customizer-repeater-social-repeater-container:not(:first-child) {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.icp-container {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.button-secondary.social-repeater-add-social-item:before {
|
||||
content: "\f132";
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: -2px;
|
||||
top: -1px;
|
||||
font: 400 20px/1 dashicons;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: all .2s;
|
||||
transition: all .2s;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.button-secondary.social-repeater-add-social-item {
|
||||
vertical-align: text-top;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customizer-repeater-box-content-hidden textarea {
|
||||
width: 100%;
|
||||
}
|
||||
.customizer-repeater-video-url-control{
|
||||
display:none;
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
.iconpicker .iconpicker-items,.iconpicker .iconpicker-items:after,.iconpicker-popover .popover-footer:after,.iconpicker:after{clear:both}.iconpicker-popover.popover{position:absolute;padding:1px;text-align:left;background:#e5e5e5;z-index:999;display:none;margin-left:-10px;width:254px}.iconpicker,.iconpicker-popover.popover.iconpicker-visible{display:block}.iconpicker-popover.popover .popover-title{padding:5px;font-size:5px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#e5e5e5}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0;text-align:center}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker *,.icp-container{position:relative}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.bottomLeft>.arrow{border-top-width:0;border-bottom-color:#e5e5e5;top:-11px}.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#e5e5e5}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker,.iconpicker .iconpicker-items{position:relative;margin:0;overflow:hidden}.iconpicker{text-align:left;text-shadow:none;line-height:0}.iconpicker .iconpicker-items:after,.iconpicker .iconpicker-items:before,.iconpicker:after,.iconpicker:before{content:" ";display:table}.iconpicker *{box-sizing:content-box}.iconpicker .iconpicker-items{float:none;padding:5px 0 0 5px;background:#fff;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items i{float:left;width:32px;height:32px;line-height:32px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #ddd;transition:transform .2s ease}.iconpicker .iconpicker-items i:nth-child(6n){margin-right:0}.iconpicker .iconpicker-items i:hover{transform:scale(1.4);color:#008ec2;box-shadow:none}.icp{padding-left:30px}.icp-container .input-group-addon{position:absolute;top:1px;left:5px;padding:3px}
|
||||
@ -0,0 +1 @@
|
||||
<?php require get_template_directory() . '/inc/customizer/customizer-repeater/inc/customizer.php';
|
||||
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
function consultstreet_repeater_register( $wp_customize ) {
|
||||
require CONSULTSTREET_PARENT_INC_DIR . '/customizer/customizer-repeater/class/customizer-repeater-control.php';
|
||||
}
|
||||
add_action( 'customize_register', 'consultstreet_repeater_register' );
|
||||
|
||||
function consultstreet_repeater_sanitize($input){
|
||||
$input_decoded = json_decode($input,true);
|
||||
|
||||
if(!empty($input_decoded)) {
|
||||
foreach ($input_decoded as $boxk => $box ){
|
||||
foreach ($box as $key => $value){
|
||||
|
||||
$input_decoded[$boxk][$key] = wp_kses_post( force_balance_tags( $value ) );
|
||||
|
||||
}
|
||||
}
|
||||
return json_encode($input_decoded);
|
||||
}
|
||||
return $input;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,553 @@
|
||||
/* global jQuery */
|
||||
/* global wp */
|
||||
function consultstreet_media_upload(button_class) {
|
||||
'use strict';
|
||||
jQuery('body').on('click', button_class, function () {
|
||||
var button_id = '#' + jQuery(this).attr('id');
|
||||
var display_field = jQuery(this).parent().children('input:text');
|
||||
var _custom_media = true;
|
||||
|
||||
wp.media.editor.send.attachment = function (props, attachment) {
|
||||
|
||||
if (_custom_media) {
|
||||
if (typeof display_field !== 'undefined') {
|
||||
switch (props.size) {
|
||||
case 'full':
|
||||
display_field.val(attachment.sizes.full.url);
|
||||
display_field.trigger('change');
|
||||
break;
|
||||
case 'medium':
|
||||
display_field.val(attachment.sizes.medium.url);
|
||||
display_field.trigger('change');
|
||||
break;
|
||||
case 'thumbnail':
|
||||
display_field.val(attachment.sizes.thumbnail.url);
|
||||
display_field.trigger('change');
|
||||
break;
|
||||
default:
|
||||
display_field.val(attachment.url);
|
||||
display_field.trigger('change');
|
||||
}
|
||||
}
|
||||
_custom_media = false;
|
||||
} else {
|
||||
return wp.media.editor.send.attachment(button_id, [props, attachment]);
|
||||
}
|
||||
};
|
||||
wp.media.editor.open(button_class);
|
||||
window.send_to_editor = function (html) {
|
||||
|
||||
};
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
/********************************************
|
||||
*** Generate unique id ***
|
||||
*********************************************/
|
||||
function consultstreet_customizer_repeater_uniqid(prefix, more_entropy) {
|
||||
'use strict';
|
||||
if (typeof prefix === 'undefined') {
|
||||
prefix = '';
|
||||
}
|
||||
|
||||
var retId;
|
||||
var php_js;
|
||||
var formatSeed = function (seed, reqWidth) {
|
||||
seed = parseInt(seed, 10)
|
||||
.toString(16); // to hex str
|
||||
if (reqWidth < seed.length) { // so long we split
|
||||
return seed.slice(seed.length - reqWidth);
|
||||
}
|
||||
if (reqWidth > seed.length) { // so short we pad
|
||||
return new Array(1 + (reqWidth - seed.length))
|
||||
.join('0') + seed;
|
||||
}
|
||||
return seed;
|
||||
};
|
||||
|
||||
// BEGIN REDUNDANT
|
||||
if (!php_js) {
|
||||
php_js = {};
|
||||
}
|
||||
// END REDUNDANT
|
||||
if (!php_js.uniqidSeed) { // init seed with big random int
|
||||
php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
|
||||
}
|
||||
php_js.uniqidSeed++;
|
||||
|
||||
retId = prefix; // start with prefix, add current milliseconds hex string
|
||||
retId += formatSeed(parseInt(new Date()
|
||||
.getTime() / 1000, 10), 8);
|
||||
retId += formatSeed(php_js.uniqidSeed, 5); // add seed hex string
|
||||
if (more_entropy) {
|
||||
// for more entropy we add a float lower to 10
|
||||
retId += (Math.random() * 10)
|
||||
.toFixed(8)
|
||||
.toString();
|
||||
}
|
||||
|
||||
return retId;
|
||||
}
|
||||
|
||||
|
||||
/********************************************
|
||||
*** General Repeater ***
|
||||
*********************************************/
|
||||
function consultstreet_customizer_repeater_refresh_social_icons(th) {
|
||||
'use strict';
|
||||
var icons_repeater_values = [];
|
||||
th.find('.customizer-repeater-social-repeater-container').each(function () {
|
||||
var icon = jQuery(this).find('.icp').val();
|
||||
var link = jQuery(this).find('.customizer-repeater-social-repeater-link').val();
|
||||
var id = jQuery(this).find('.customizer-repeater-social-repeater-id').val();
|
||||
|
||||
if (!id) {
|
||||
id = 'customizer-repeater-social-repeater-' + consultstreet_customizer_repeater_uniqid();
|
||||
jQuery(this).find('.customizer-repeater-social-repeater-id').val(id);
|
||||
}
|
||||
|
||||
if (icon !== '' && link !== '') {
|
||||
icons_repeater_values.push({
|
||||
'icon': icon,
|
||||
'link': link,
|
||||
'id': id
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
th.find('.social-repeater-socials-repeater-colector').val(JSON.stringify(icons_repeater_values));
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
}
|
||||
|
||||
|
||||
function consultstreet_customizer_repeater_refresh_general_control_values() {
|
||||
|
||||
'use strict';
|
||||
jQuery('.customizer-repeater-general-control-repeater').each(function () {
|
||||
var values = [];
|
||||
var th = jQuery(this);
|
||||
th.find('.customizer-repeater-general-control-repeater-container').each(function () {
|
||||
|
||||
var icon_value = jQuery(this).find('.icp').val();
|
||||
var text = jQuery(this).find('.customizer-repeater-text-control').val();
|
||||
var button_text = jQuery(this).find('.customizer-repeater-button-text-control').val();
|
||||
var link = jQuery(this).find('.customizer-repeater-link-control').val();
|
||||
var color = jQuery(this).find('.customizer-repeater-color-control').val();
|
||||
var designation = jQuery(this).find('.customizer-repeater-designation-control').val();
|
||||
var open_new_tab = jQuery(this).find('.customizer-repeater-checkbox').val();
|
||||
var image_url = jQuery(this).find('.custom-media-url').val();
|
||||
var choice = jQuery(this).find('.customizer-repeater-image-choice').val();
|
||||
var title = jQuery(this).find('.customizer-repeater-title-control').val();
|
||||
var subtitle = jQuery(this).find('.customizer-repeater-subtitle-control').val();
|
||||
var slide_format = jQuery(this).find('.customizer-repeater-slide-format').val();
|
||||
var video_url = jQuery(this).find('.customizer-repeater-video-url-control').val();
|
||||
var id = jQuery(this).find('.social-repeater-box-id').val();
|
||||
if (!id) {
|
||||
id = 'social-repeater-' + consultstreet_customizer_repeater_uniqid();
|
||||
jQuery(this).find('.social-repeater-box-id').val(id);
|
||||
}
|
||||
var social_repeater = jQuery(this).find('.social-repeater-socials-repeater-colector').val();
|
||||
var shortcode = jQuery(this).find('.customizer-repeater-shortcode-control').val();
|
||||
|
||||
if (text !== '' || image_url !== '' || title !== '' || subtitle !== '' || icon_value !== '' || link !== '' || designation !== '' || open_new_tab !== '' || choice !== '' || social_repeater !== '' || shortcode !== '' || color !== '' || button_text !== '' || slide_format !== '' || video_url !== '') {
|
||||
values.push({
|
||||
'icon_value': (choice === 'customizer_repeater_none' ? '' : icon_value),
|
||||
'color': color,
|
||||
'text': consultstreet_escapeHtml(text),
|
||||
'link': link,
|
||||
'image_url': (choice === 'customizer_repeater_none' ? '' : image_url),
|
||||
'choice': choice,
|
||||
'title': consultstreet_escapeHtml(title),
|
||||
'subtitle': consultstreet_escapeHtml(subtitle),
|
||||
'social_repeater': consultstreet_escapeHtml(social_repeater),
|
||||
'id': id,
|
||||
'shortcode': consultstreet_escapeHtml(shortcode),
|
||||
'button_text' : button_text,
|
||||
'designation' : designation,
|
||||
'open_new_tab' : open_new_tab,
|
||||
'slide_format' : slide_format,
|
||||
'video_url' : video_url
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
th.find('.customizer-repeater-colector').val(JSON.stringify(values));
|
||||
th.find('.customizer-repeater-colector').trigger('change');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
'use strict';
|
||||
var theme_conrols = jQuery('#customize-theme-controls');
|
||||
theme_conrols.on('click', '.customizer-repeater-customize-control-title', function () {
|
||||
jQuery(this).next().slideToggle('medium', function () {
|
||||
if (jQuery(this).is(':visible')){
|
||||
jQuery(this).prev().addClass('repeater-expanded');
|
||||
jQuery(this).css('display', 'block');
|
||||
} else {
|
||||
jQuery(this).prev().removeClass('repeater-expanded');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
theme_conrols.on('change', '.icp',function(){
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
return false;
|
||||
});
|
||||
|
||||
theme_conrols.on('change','.customizer-repeater-slide-format', function(){
|
||||
if(jQuery(this).val() === 'customizer_repeater_slide_forma_video'){
|
||||
jQuery(this).parent().parent().find('.customizer-repeater-video-url-control').show();
|
||||
jQuery(this).parent().parent().find('.Video').show();
|
||||
}else{
|
||||
jQuery(this).parent().parent().find('.customizer-repeater-video-url-control').hide();
|
||||
jQuery(this).parent().parent().find('.Video').hide();
|
||||
}
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
theme_conrols.on('change', '.customizer-repeater-image-choice', function () {
|
||||
if (jQuery(this).val() === 'customizer_repeater_image') {
|
||||
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').hide();
|
||||
jQuery(this).parent().parent().find('.customizer-repeater-image-control').show();
|
||||
}
|
||||
if (jQuery(this).val() === 'customizer_repeater_icon') {
|
||||
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').show();
|
||||
jQuery(this).parent().parent().find('.customizer-repeater-image-control').hide();
|
||||
}
|
||||
if (jQuery(this).val() === 'customizer_repeater_none') {
|
||||
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').hide();
|
||||
jQuery(this).parent().parent().find('.customizer-repeater-image-control').hide();
|
||||
}
|
||||
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
return false;
|
||||
});
|
||||
consultstreet_media_upload('.customizer-repeater-custom-media-button');
|
||||
jQuery('.custom-media-url').on('change', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
return false;
|
||||
});
|
||||
|
||||
var color_options = {
|
||||
change: function(event, ui){
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This adds a new box to repeater
|
||||
*
|
||||
*/
|
||||
theme_conrols.on('click', '.customizer-repeater-new-field', function () {
|
||||
|
||||
var parentid = jQuery(this).parent().attr("id");
|
||||
|
||||
if(parentid == 'customize-control-consultstreet_top_header_info_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_top_header_info_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 3){
|
||||
jQuery( "#customize-control-consultstreet_top_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(parentid == 'customize-control-consultstreet_top_header_social_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_top_header_social_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 4){
|
||||
jQuery( "#customize-control-consultstreet_social_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(parentid == 'customize-control-consultstreet_main_slider_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_main_slider_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 2){
|
||||
jQuery( "#customize-control-consultstreet_slider_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(parentid == 'customize-control-consultstreet_theme_info_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_theme_info_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 3){
|
||||
jQuery( "#customize-control-consultstreet_info_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(parentid == 'customize-control-consultstreet_service_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_service_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 3){
|
||||
jQuery( "#customize-control-consultstreet_service_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(parentid == 'customize-control-consultstreet_project_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_project_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 4){
|
||||
jQuery( "#customize-control-consultstreet_project_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(parentid == 'customize-control-consultstreet_testimonial_content')
|
||||
{
|
||||
var numItems = jQuery("#customize-control-consultstreet_testimonial_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(numItems >= 3){
|
||||
jQuery( "#customize-control-consultstreet_testimonial_upgrade .consultstreet-upgrade-pro-message" ).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var th = jQuery(this).parent();
|
||||
var id = 'customizer-repeater-' + consultstreet_customizer_repeater_uniqid();
|
||||
if (typeof th !== 'undefined') {
|
||||
/* Clone the first box*/
|
||||
var field = th.find('.customizer-repeater-general-control-repeater-container:first').clone( true, true );
|
||||
|
||||
if (typeof field !== 'undefined') {
|
||||
/*Set the default value for choice between image and icon to icon*/
|
||||
field.find('.customizer-repeater-image-choice').val('customizer_repeater_icon');
|
||||
|
||||
/*Show icon selector*/
|
||||
field.find('.social-repeater-general-control-icon').show();
|
||||
|
||||
/*Hide image selector*/
|
||||
if (field.find('.social-repeater-general-control-icon').length > 0) {
|
||||
field.find('.customizer-repeater-image-control').hide();
|
||||
}
|
||||
|
||||
/*Show delete box button because it's not the first box*/
|
||||
field.find('.social-repeater-general-control-remove-field').show();
|
||||
|
||||
/* Empty control for icon */
|
||||
field.find('.input-group-addon').find('.fa').attr('class', 'fa');
|
||||
|
||||
|
||||
/*Remove all repeater fields except first one*/
|
||||
|
||||
field.find('.customizer-repeater-social-repeater').find('.customizer-repeater-social-repeater-container').not(':first').remove();
|
||||
field.find('.customizer-repeater-social-repeater-link').val('');
|
||||
field.find('.social-repeater-socials-repeater-colector').val('');
|
||||
|
||||
/*Remove value from icon field*/
|
||||
field.find('.icp').val('');
|
||||
|
||||
/*Remove value from text field*/
|
||||
field.find('.customizer-repeater-text-control').val('');
|
||||
|
||||
/*Remove value from button text field*/
|
||||
field.find('.customizer-repeater-button-text-control').val('');
|
||||
|
||||
field.find('.customizer-repeater-video-url-control').val('');
|
||||
|
||||
/*Remove value from designation text field*/
|
||||
field.find('.customizer-repeater-designation-control').val('');
|
||||
|
||||
/*Set the default value in slide format*/
|
||||
field.find('.customizer-repeater-slide-format').val('left');
|
||||
|
||||
/*Remove value from link field*/
|
||||
field.find('.customizer-repeater-link-control').val('');
|
||||
|
||||
/*Set box id*/
|
||||
field.find('.social-repeater-box-id').val(id);
|
||||
|
||||
/*Remove value from media field*/
|
||||
field.find('.custom-media-url').val('');
|
||||
|
||||
/*Remove value from title field*/
|
||||
field.find('.customizer-repeater-title-control').val('');
|
||||
|
||||
/*Remove value from color field*/
|
||||
field.find('.wp-picker-container').replaceWith('<input type="text" class="customizer-repeater-color-control ' + id + '">');
|
||||
field.find('.customize-control-notifications-container').remove();
|
||||
field.find('.customizer-repeater-color-control').wpColorPicker(color_options);
|
||||
|
||||
/*Remove value from subtitle field*/
|
||||
field.find('.customizer-repeater-subtitle-control').val('');
|
||||
|
||||
/*Remove value from shortcode field*/
|
||||
field.find('.customizer-repeater-shortcode-control').val('');
|
||||
|
||||
/*Set the default value in checkbox*/
|
||||
field.find('.customizer-repeater-checkbox').val('');
|
||||
|
||||
/*Append new box*/
|
||||
th.find('.customizer-repeater-general-control-repeater-container:first').parent().append(field);
|
||||
|
||||
/*Refresh values*/
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
theme_conrols.on('click', '.social-repeater-general-control-remove-field', function () {
|
||||
if (typeof jQuery(this).parent() !== 'undefined') {
|
||||
jQuery(this).parent().hide(500, function(){
|
||||
|
||||
var main_top_items = jQuery("#customize-control-consultstreet_top_header_info_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(main_top_items < 4){
|
||||
jQuery( "#customize-control-consultstreet_top_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
|
||||
var main_social_items = jQuery("#customize-control-consultstreet_top_header_social_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(main_social_items < 5){
|
||||
jQuery( "#customize-control-consultstreet_social_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
|
||||
var main_slider_items = jQuery("#customize-control-consultstreet_main_slider_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(main_slider_items < 3){
|
||||
jQuery( "#customize-control-consultstreet_slider_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
var theme_info_items = jQuery("#customize-control-consultstreet_theme_info_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(theme_info_items < 4){
|
||||
jQuery( "#customize-control-consultstreet_info_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
var theme_info_items = jQuery("#customize-control-consultstreet_service_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(theme_info_items < 4){
|
||||
jQuery( "#customize-control-consultstreet_service_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
var project_items = jQuery("#customize-control-consultstreet_project_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(project_items < 5){
|
||||
jQuery( "#customize-control-consultstreet_project_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
var testimonial_items = jQuery("#customize-control-consultstreet_testimonial_content .customizer-repeater-general-control-repeater-container").length
|
||||
if(testimonial_items < 4){
|
||||
jQuery( "#customize-control-consultstreet_testimonial_upgrade .consultstreet-upgrade-pro-message" ).hide();
|
||||
}
|
||||
|
||||
jQuery(this).parent().remove();
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-title-control', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
jQuery('.customizer-repeater-color-control').wpColorPicker(color_options);
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-subtitle-control', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-shortcode-control', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-video-url-control', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-text-control', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
theme_conrols.on('keyup','.customizer-repeater-button-text-control', function(){
|
||||
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
})
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-link-control', function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
theme_conrols.on('keyup','.customizer-repeater-designation-control', function(){
|
||||
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
theme_conrols.on('change','.customizer-repeater-checkbox', function(){
|
||||
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
});
|
||||
|
||||
/*Drag and drop to change icons order*/
|
||||
|
||||
jQuery('.customizer-repeater-general-control-droppable').sortable({
|
||||
axis: 'y',
|
||||
update: function () {
|
||||
consultstreet_customizer_repeater_refresh_general_control_values();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*----------------- Socials Repeater ---------------------*/
|
||||
theme_conrols.on('click', '.social-repeater-add-social-item', function (event) {
|
||||
event.preventDefault();
|
||||
var th = jQuery(this).parent();
|
||||
var id = 'customizer-repeater-social-repeater-' + consultstreet_customizer_repeater_uniqid();
|
||||
if (typeof th !== 'undefined') {
|
||||
var field = th.find('.customizer-repeater-social-repeater-container:first').clone( true, true );
|
||||
if (typeof field !== 'undefined') {
|
||||
field.find( '.icp' ).val('');
|
||||
field.find( '.input-group-addon' ).find('.fa').attr('class','fa');
|
||||
field.find('.social-repeater-remove-social-item').show();
|
||||
field.find('.customizer-repeater-social-repeater-link').val('');
|
||||
field.find('.customizer-repeater-social-repeater-id').val(id);
|
||||
th.find('.customizer-repeater-social-repeater-container:first').parent().append(field);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
theme_conrols.on('click', '.social-repeater-remove-social-item', function (event) {
|
||||
event.preventDefault();
|
||||
var th = jQuery(this).parent();
|
||||
var repeater = jQuery(this).parent().parent();
|
||||
th.remove();
|
||||
consultstreet_customizer_repeater_refresh_social_icons(repeater);
|
||||
return false;
|
||||
});
|
||||
|
||||
theme_conrols.on('keyup', '.customizer-repeater-social-repeater-link', function (event) {
|
||||
event.preventDefault();
|
||||
var repeater = jQuery(this).parent().parent();
|
||||
consultstreet_customizer_repeater_refresh_social_icons(repeater);
|
||||
return false;
|
||||
});
|
||||
|
||||
theme_conrols.on('change', '.customizer-repeater-social-repeater-container .icp', function (event) {
|
||||
event.preventDefault();
|
||||
var repeater = jQuery(this).parent().parent().parent();
|
||||
consultstreet_customizer_repeater_refresh_social_icons(repeater);
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
'\'': ''',
|
||||
'/': '/'
|
||||
};
|
||||
|
||||
function consultstreet_escapeHtml(string) {
|
||||
'use strict';
|
||||
//noinspection JSUnresolvedFunction
|
||||
string = String(string).replace(new RegExp('\r?\n', 'g'), '<br />');
|
||||
string = String(string).replace(/\\/g, '\');
|
||||
return String(string).replace(/[&<>"'\/]/g, function (s) {
|
||||
return entityMap[s];
|
||||
});
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
wp.consultstreet_customizerRepeater = {
|
||||
|
||||
init: function () {
|
||||
$('.iconpicker-items>i').on('click', function () {
|
||||
var iconClass = $(this).attr('class').slice(3);
|
||||
var classInput = $(this).parents('.iconpicker-popover').prev().find('.icp');
|
||||
classInput.val(iconClass);
|
||||
classInput.attr('value', iconClass);
|
||||
|
||||
var iconPreview = classInput.next('.input-group-addon');
|
||||
var iconElement = '<i class="fa '.concat(iconClass, '"><\/i>');
|
||||
iconPreview.empty();
|
||||
iconPreview.append(iconElement);
|
||||
|
||||
var th = $(this).parent().parent().parent();
|
||||
classInput.trigger('change');
|
||||
consultstreet_customizer_repeater_refresh_social_icons(th);
|
||||
return false;
|
||||
});
|
||||
},
|
||||
search: function ($searchField) {
|
||||
var itemsList = $searchField.parent().next().find('.iconpicker-items');
|
||||
var searchTerm = $searchField.val().toLowerCase();
|
||||
if (searchTerm.length > 0) {
|
||||
itemsList.children().each(function () {
|
||||
if ($(this).filter('[title*='.concat(searchTerm)).length > 0 || searchTerm.length < 1) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
itemsList.children().show();
|
||||
}
|
||||
},
|
||||
iconPickerToggle: function ($input) {
|
||||
var iconPicker = $input.parent().next();
|
||||
iconPicker.addClass('iconpicker-visible');
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
wp.consultstreet_customizerRepeater.init();
|
||||
|
||||
$('.iconpicker-search').on('keyup', function () {
|
||||
wp.consultstreet_customizerRepeater.search($(this));
|
||||
});
|
||||
|
||||
$('.icp-auto').on('click', function () {
|
||||
wp.consultstreet_customizerRepeater.iconPickerToggle($(this));
|
||||
});
|
||||
|
||||
$(document).mouseup( function (e) {
|
||||
var container = $('.iconpicker-popover');
|
||||
|
||||
if (!container.is(e.target)
|
||||
&& container.has(e.target).length === 0)
|
||||
{
|
||||
container.removeClass('iconpicker-visible');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Header top options.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Class ConsultStreet_Customize_Base_Option
|
||||
*/
|
||||
class ConsultStreet_Customize_Base_Option {
|
||||
|
||||
/**
|
||||
* Array to create customizer options.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $elements = array();
|
||||
|
||||
/**
|
||||
* Active callback array provided in $elements array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $active_callback_old = array();
|
||||
|
||||
/**
|
||||
* Record the count of array provided for active callback.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $ac_arr_count = 0;
|
||||
|
||||
/**
|
||||
* Record the count of evaluate() method called.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $count_evaluate = 0;
|
||||
|
||||
/**
|
||||
* Setting's default values.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $ac_default = array();
|
||||
|
||||
/**
|
||||
* ConsultStreet_Customize_Base_Option constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
// Register customizer options.
|
||||
add_action( 'customize_register', array( $this, 'consultstreet_customizer_options' ) );
|
||||
// Get array of elements for particular class.
|
||||
$this->elements = $this->elements();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides an array of Menu slug => name for dropdown.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_menu_options() {
|
||||
|
||||
$all_menus = get_terms( array(
|
||||
'taxonomy' => 'nav_menu',
|
||||
'hide_empty' => true,
|
||||
) );
|
||||
$menu_options = array();
|
||||
$menu_options['none'] = esc_html__( 'None', 'consultstreet' );
|
||||
|
||||
foreach ( $all_menus as $menu_item ) {
|
||||
$menu_options[ $menu_item->slug ] = esc_html( $menu_item->name );
|
||||
}
|
||||
|
||||
return $menu_options;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register customizer option.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Manager instance.
|
||||
*/
|
||||
public function consultstreet_customizer_options( $wp_customize ) {
|
||||
|
||||
// Loop through array elements.
|
||||
foreach ( $this->elements as $el_key => $el_data ) :
|
||||
|
||||
/**
|
||||
* Setting.
|
||||
*/
|
||||
$setting_args = $el_data['setting'];
|
||||
$default = isset( $setting_args['default'] ) ? $setting_args['default'] : '';
|
||||
$option_type = isset( $el_data['setting']['type'] ) ? $el_data['setting']['type'] : 'theme_mod';
|
||||
$sanitize_callback = isset( $setting_args['sanitize_callback'] ) ? $setting_args['sanitize_callback'] : '';
|
||||
|
||||
$wp_customize->add_setting(
|
||||
$el_key,
|
||||
array(
|
||||
'default' => $default,
|
||||
'type' => $option_type,
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => $sanitize_callback,
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Control.
|
||||
*/
|
||||
$control_args = $el_data['control'];
|
||||
$control_type = $control_args['type'];
|
||||
// Is custom control?
|
||||
$is_custom_control = ( isset( $control_args['is_default_type'] ) && true === $control_args['is_default_type'] ) ? $control_args['is_default_type'] : 0;
|
||||
$control_args['setting'] = $el_key;
|
||||
|
||||
// If array provided for active callback modify it to function reference.
|
||||
if ( isset( $control_args['active_callback'] ) && is_array( $control_args['active_callback'] ) ) {
|
||||
$this->active_callback_old[] = $control_args['active_callback'];
|
||||
$cb_setting_id = $this->active_callback_old[ $this->ac_arr_count ][0]['setting'];
|
||||
|
||||
|
||||
if ( 'consultstreet_pro' === substr( $cb_setting_id, 0, 9 ) && function_exists( 'consultstreet_pro_options' ) ) {
|
||||
$this->ac_default[] = $wp_customize->get_setting( 'consultstreet_pro[' . $cb_setting_id . ']' )->default;
|
||||
|
||||
} else {
|
||||
$this->ac_default[] = $wp_customize->get_setting( $cb_setting_id )->default;
|
||||
}
|
||||
|
||||
$control_args['active_callback'] = array( $this, 'evaluate' );
|
||||
$this->ac_arr_count++;
|
||||
}
|
||||
|
||||
// If custom control, unset type and use object, else...
|
||||
if ( ! $is_custom_control ) {
|
||||
unset( $control_args['type'] );
|
||||
$control_type_uc = implode( '_', array_map( 'ucfirst', explode( '_', $control_type ) ) );
|
||||
$control_type = 'ConsultStreet_Customize_' . $control_type_uc . '_Control';
|
||||
$wp_customize->add_control( new $control_type( $wp_customize, $el_key, $control_args ) );
|
||||
} else {
|
||||
$wp_customize->add_control( $el_key, $control_args );
|
||||
}
|
||||
|
||||
endforeach;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the active callback array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function evaluate() {
|
||||
foreach ( $this->active_callback_old[ ( $this->count_evaluate ) ] as $count => $ruleset ) :
|
||||
|
||||
$ac_setting_id = $ruleset['setting'];
|
||||
$operator = $ruleset['operator'];
|
||||
|
||||
if ( 'consultstreet_pro' === substr( $ac_setting_id, 0, 9 ) && function_exists( 'consultstreet_pro_options' ) ) {
|
||||
$option_val = consultstreet_pro_options( $ac_setting_id, 'text_html' );
|
||||
} else {
|
||||
$option_val = get_theme_mod( $ac_setting_id, 'text_html' );
|
||||
}
|
||||
$check_val = $ruleset['value'];
|
||||
|
||||
switch ( $operator ) {
|
||||
case '===':
|
||||
$show[] = ( $option_val === $check_val ) ? true : false;
|
||||
break;
|
||||
case '==':
|
||||
$show[] = ( $option_val == $check_val ) ? true : false;
|
||||
break;
|
||||
|
||||
case '!==':
|
||||
$show[] = ( $option_val !== $check_val ) ? true : false;
|
||||
break;
|
||||
|
||||
case '!=':
|
||||
$show[] = ( $option_val != $check_val ) ? true : false;
|
||||
break;
|
||||
|
||||
default:
|
||||
$show[] = ( $option_val == $check_val ) ? true : false;
|
||||
break;
|
||||
}
|
||||
|
||||
endforeach;
|
||||
|
||||
// Evaluate final result.
|
||||
if ( isset( $show ) ) {
|
||||
$this->count_evaluate++;
|
||||
foreach ( $show as $result ) {
|
||||
if ( ! $result ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
* General Blog.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_Blog_General_Option' ) ) :
|
||||
|
||||
/**
|
||||
* General Blog..
|
||||
*/
|
||||
class ConsultStreet_Customize_Blog_General_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
'consultstreet_general_arcive_single_blog_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 1,
|
||||
'label' => esc_html__( 'Blog/Archive/Single', 'consultstreet' ),
|
||||
'section' => 'consultstreet_blog_general',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_general_blog_arcive_single_content_ordering' => array(
|
||||
'setting' => array(
|
||||
'default' => array(
|
||||
'meta-one',
|
||||
'title',
|
||||
'meta-two',
|
||||
'image',
|
||||
),
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_sortable' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'sortable',
|
||||
'priority' => 5,
|
||||
'label' => esc_html__( 'General Post', 'consultstreet' ),
|
||||
'description' => esc_html__( 'Drag & Drop post items to re-arrange the order', 'consultstreet' ),
|
||||
'section' => 'consultstreet_blog_general',
|
||||
'choices' => array(
|
||||
'meta-one' => esc_attr__( 'Meta One', 'consultstreet' ),
|
||||
'title' => esc_attr__( 'Title', 'consultstreet' ),
|
||||
'meta-two' => esc_attr__( 'Meta Two', 'consultstreet' ),
|
||||
'image' => esc_attr__( 'Image', 'consultstreet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_archive_blog_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 15,
|
||||
'label' => esc_html__( 'Archive Blog Pages', 'consultstreet' ),
|
||||
'section' => 'consultstreet_blog_general',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
'consultstreet_archive_blog_pages_layout' => array(
|
||||
'setting' => array(
|
||||
'default' => 'consultstreet_right_sidebar',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_radio' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'radio_image',
|
||||
'priority' => 20,
|
||||
'label' => esc_html__( 'Layout', 'consultstreet' ),
|
||||
'section' => 'consultstreet_blog_general',
|
||||
'choices' => array(
|
||||
'consultstreet_right_sidebar' => CONSULTSTREET_PARENT_INC_ICON_URI . '/theme-right-sidebar.png',
|
||||
'consultstreet_left_sidebar' => CONSULTSTREET_PARENT_INC_ICON_URI . '/theme-left-sidebar.png',
|
||||
'consultstreet_no_sidebar' => CONSULTSTREET_PARENT_INC_ICON_URI . '/theme-fullwidth.png',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_single_blog_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 30,
|
||||
'label' => esc_html__( 'Single Blog Pages', 'consultstreet' ),
|
||||
'section' => 'consultstreet_blog_general',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_single_blog_pages_layout' => array(
|
||||
'setting' => array(
|
||||
'default' => 'consultstreet_right_sidebar',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_radio' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'radio_image',
|
||||
'priority' => 35,
|
||||
'label' => esc_html__( 'Layout', 'consultstreet' ),
|
||||
'section' => 'consultstreet_blog_general',
|
||||
'choices' => array(
|
||||
'consultstreet_right_sidebar' => CONSULTSTREET_PARENT_INC_ICON_URI . '/theme-right-sidebar.png',
|
||||
'consultstreet_left_sidebar' => CONSULTSTREET_PARENT_INC_ICON_URI . '/theme-left-sidebar.png',
|
||||
'consultstreet_no_sidebar' => CONSULTSTREET_PARENT_INC_ICON_URI . '/theme-fullwidth.png',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_custom_logo_size' => array(
|
||||
'setting' => array(
|
||||
'default' => array(
|
||||
'slider' => 257,
|
||||
'suffix' => 'px',
|
||||
),
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_slider' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'slider',
|
||||
'priority' => 55,
|
||||
'label' => esc_html__( 'Logo Width', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'max' => 600,
|
||||
'step' => 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_Blog_General_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Footer Copyright.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_Footer_Copyright_Option' ) ) :
|
||||
|
||||
/**
|
||||
* Footer Copyright.
|
||||
*/
|
||||
class ConsultStreet_Customize_Footer_Copyright_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
'consultstreet_footer_copright_enabled' => array(
|
||||
'setting' => array(
|
||||
'default' => true,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 5,
|
||||
'label' => esc_html__( 'Footer Copyright Enable/Disable', 'consultstreet' ),
|
||||
'section' => 'consultstreet_footer_copyright',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_Footer_Copyright_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Footer widgets.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_Footer_Widget_Option' ) ) :
|
||||
|
||||
/**
|
||||
* Option: Footer widget.
|
||||
*/
|
||||
class ConsultStreet_Customize_Footer_Widget_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
'consultstreet_footer_widgets_enabled' => array(
|
||||
'setting' => array(
|
||||
'default' => true,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 10,
|
||||
'label' => esc_html__( 'Footer Widget Area Enable/Disable', 'consultstreet' ),
|
||||
'section' => 'consultstreet_footer_widgets',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
'consultstreet_footer_container_size' => array(
|
||||
'setting' => array(
|
||||
'default' => 'container-full',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_radio' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'radio',
|
||||
'priority' => 25,
|
||||
'is_default_type' => true,
|
||||
'label' => esc_html__( 'Container Width', 'consultstreet' ),
|
||||
'section' => 'consultstreet_footer_widgets',
|
||||
'choices' => array(
|
||||
'container' => esc_html__( 'Container', 'consultstreet' ),
|
||||
'container-full' => esc_html__( 'Container Full', 'consultstreet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_Footer_Widget_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Page Header Settings.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Page Header Settings.
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_General_Option' ) ) :
|
||||
|
||||
class ConsultStreet_Customize_General_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
|
||||
'consultstreet_page_header_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 1,
|
||||
'label' => esc_html__( 'General Settings', 'consultstreet' ),
|
||||
'section' => 'consultstreet_theme_general',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_animation_disabled' => array(
|
||||
'setting' => array(
|
||||
'default' => true,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 2,
|
||||
'label' => esc_html__( 'Site Animation Enable/Disable', 'consultstreet' ),
|
||||
'section' => 'consultstreet_theme_general',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_General_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* MenuBar.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_Menu_Bar_Option' ) ) :
|
||||
|
||||
/**
|
||||
* Menu option.
|
||||
*/
|
||||
class ConsultStreet_Customize_Menu_Bar_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
'consultstreet_main_menu_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 1,
|
||||
'label' => esc_html__( 'Menu Settings', 'consultstreet' ),
|
||||
'section' => 'consultstreet_theme_menu_bar',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
'consultstreet_menu_style' => array(
|
||||
'setting' => array(
|
||||
'default' => 'sticky',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_radio' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'radio',
|
||||
'priority' => 5,
|
||||
'is_default_type' => true,
|
||||
'label' => esc_html__( 'Menu Style', 'consultstreet' ),
|
||||
'section' => 'consultstreet_theme_menu_bar',
|
||||
'choices' => array(
|
||||
'sticky' => esc_html__( 'Sticky', 'consultstreet' ),
|
||||
'static' => esc_html__( 'Static', 'consultstreet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
'consultstreet_menu_container_size' => array(
|
||||
'setting' => array(
|
||||
'default' => 'container-full',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_radio' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'radio',
|
||||
'priority' => 7,
|
||||
'is_default_type' => true,
|
||||
'label' => esc_html__( 'Container Width', 'consultstreet' ),
|
||||
'section' => 'consultstreet_theme_menu_bar',
|
||||
'choices' => array(
|
||||
'container' => esc_html__( 'Container', 'consultstreet' ),
|
||||
'container-full' => esc_html__( 'Container Full', 'consultstreet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_Menu_Bar_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/**
|
||||
* Other.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Other_General_Option' ) ) :
|
||||
|
||||
/**
|
||||
* Other..
|
||||
*/
|
||||
class ConsultStreet_Other_General_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
'consultstreet_header_banner_image_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 53,
|
||||
'label' => esc_html__( 'Magazine Header Settings', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_header_banner_image_disabled' => array(
|
||||
'setting' => array(
|
||||
'default' => true,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 54,
|
||||
'label' => esc_html__( 'Enable/Disable Banner Image', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_header_banner_image_link' => array(
|
||||
'setting' => array(
|
||||
'default' => '#',
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'text',
|
||||
'priority' => 56,
|
||||
'is_default_type' => true,
|
||||
'label' => esc_html__( 'Banner Image Link', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_header_banner_open_new_tab_disabled' => array(
|
||||
'setting' => array(
|
||||
'default' => true,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 57,
|
||||
'label' => esc_html__( 'Open New Tab Enable/Disable', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_magazine_header_menu_alignment' => array(
|
||||
'setting' => array(
|
||||
'default' => 'm-left-auto',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_radio' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'radio',
|
||||
'priority' => 58,
|
||||
'is_default_type' => true,
|
||||
'label' => esc_html__( 'Magazine Header Menu Alignment', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
'choices' => array(
|
||||
'm-left-auto' => esc_html__( 'Left', 'consultstreet' ),
|
||||
'm-right-left-auto' => esc_html__( 'Center', 'consultstreet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
'consultstreet_custom_logo_size' => array(
|
||||
'setting' => array(
|
||||
'default' => array(
|
||||
'slider' => 257,
|
||||
'suffix' => 'px',
|
||||
),
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_slider' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'slider',
|
||||
'priority' => 52,
|
||||
'label' => esc_html__( 'Logo Width', 'consultstreet' ),
|
||||
'section' => 'title_tagline',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'max' => 600,
|
||||
'step' => 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Other_General_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Page Header Settings.
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Page Header Settings.
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_Page_Header_Option' ) ) :
|
||||
|
||||
class ConsultStreet_Customize_Page_Header_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
|
||||
public function elements() {
|
||||
|
||||
|
||||
return array(
|
||||
|
||||
'consultstreet_page_header_heading' => array(
|
||||
'setting' => array(),
|
||||
'control' => array(
|
||||
'type' => 'heading',
|
||||
'priority' => 1,
|
||||
'label' => esc_html__( 'Page Header', 'consultstreet' ),
|
||||
'section' => 'header_image',
|
||||
),
|
||||
),
|
||||
|
||||
'consultstreet_page_header_disabled' => array(
|
||||
'setting' => array(
|
||||
'default' => true,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 5,
|
||||
'label' => esc_html__( 'Page Header Enable/Disable', 'consultstreet' ),
|
||||
'section' => 'header_image',
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
'consultstreet_page_header_background_color' => array(
|
||||
'setting' => array(
|
||||
'default' => '',
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_alpha_color' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'color',
|
||||
'priority' => 7,
|
||||
'label' => esc_html__( 'Background color', 'consultstreet' ),
|
||||
'section' => 'header_image',
|
||||
'choices' => array(
|
||||
'alpha' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_Page_Header_Option();
|
||||
|
||||
endif;
|
||||
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Typography.
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/*========================================== TYPOGRAPHY ==========================================*/
|
||||
if ( ! class_exists( 'ConsultStreet_Customize_Theme_Typography_Option' ) ) :
|
||||
|
||||
/**
|
||||
* Theme Typography option.
|
||||
*/
|
||||
class ConsultStreet_Customize_Theme_Typography_Option extends ConsultStreet_Customize_Base_Option {
|
||||
|
||||
public function elements() {
|
||||
|
||||
return array(
|
||||
|
||||
/* ---------- Enable/Disable TYPOGRAPHY -------------- */
|
||||
|
||||
'consultstreet_typography_disabled' => array(
|
||||
'setting' => array(
|
||||
'default' => false,
|
||||
'sanitize_callback' => array( 'ConsultStreet_Customizer_Sanitize', 'sanitize_checkbox' ),
|
||||
),
|
||||
'control' => array(
|
||||
'type' => 'toggle',
|
||||
'priority' => 2,
|
||||
'label' => esc_html__( 'Enable Typography', 'consultstreet' ),
|
||||
'section' => 'consultstreet_enable_disable_typography',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ConsultStreet_Customize_Theme_Typography_Option();
|
||||
|
||||
endif;
|
||||
133
wp-content/themes/consultstreet/inc/customizer/webfont.php
Normal file
133
wp-content/themes/consultstreet/inc/customizer/webfont.php
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,671 @@
|
||||
<?php
|
||||
/**
|
||||
* Download webfonts locally.
|
||||
* https://make.wordpress.org/themes/2020/09/25/new-package-to-allow-locally-hosting-webfonts/
|
||||
*
|
||||
* @version 1.1.1
|
||||
* @package wptt/font-loader
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'WPTT_WebFont_Loader' ) ) {
|
||||
/**
|
||||
* Download webfonts locally.
|
||||
*/
|
||||
class WPTT_WebFont_Loader {
|
||||
|
||||
/**
|
||||
* The font-format.
|
||||
*
|
||||
* Use "woff" or "woff2".
|
||||
* This will change the user-agent user to make the request.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.0.0
|
||||
* @var string
|
||||
*/
|
||||
protected $font_format = 'woff2';
|
||||
|
||||
/**
|
||||
* The remote URL.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $remote_url;
|
||||
|
||||
/**
|
||||
* Base path.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $base_path;
|
||||
|
||||
/**
|
||||
* Base URL.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $base_url;
|
||||
|
||||
/**
|
||||
* Subfolder name.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $subfolder_name;
|
||||
|
||||
/**
|
||||
* The fonts folder.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $fonts_folder;
|
||||
|
||||
/**
|
||||
* The local stylesheet's path.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $local_stylesheet_path;
|
||||
|
||||
/**
|
||||
* The local stylesheet's URL.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $local_stylesheet_url;
|
||||
|
||||
/**
|
||||
* The remote CSS.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $remote_styles;
|
||||
|
||||
/**
|
||||
* The final CSS.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $css;
|
||||
|
||||
/**
|
||||
* Cleanup routine frequency.
|
||||
*/
|
||||
const CLEANUP_FREQUENCY = 'monthly';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* Get a new instance of the object for a new URL.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @param string $url The remote URL.
|
||||
*/
|
||||
public function __construct( $url = '' ) {
|
||||
$this->remote_url = $url;
|
||||
|
||||
// Add a cleanup routine.
|
||||
$this->schedule_cleanup();
|
||||
add_action( 'delete_fonts_folder', array( $this, 'delete_fonts_folder' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the local URL which contains the styles.
|
||||
*
|
||||
* Fallback to the remote URL if we were unable to write the file locally.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_url() {
|
||||
|
||||
// Check if the local stylesheet exists.
|
||||
if ( $this->local_file_exists() ) {
|
||||
|
||||
// Attempt to update the stylesheet. Return the local URL on success.
|
||||
if ( $this->write_stylesheet() ) {
|
||||
return $this->get_local_stylesheet_url();
|
||||
}
|
||||
}
|
||||
|
||||
// If the local file exists, return its URL, with a fallback to the remote URL.
|
||||
return file_exists( $this->get_local_stylesheet_path() )
|
||||
? $this->get_local_stylesheet_url()
|
||||
: $this->remote_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the local stylesheet URL.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_local_stylesheet_url() {
|
||||
if ( ! $this->local_stylesheet_url ) {
|
||||
$this->local_stylesheet_url = str_replace(
|
||||
$this->get_base_path(),
|
||||
$this->get_base_url(),
|
||||
$this->get_local_stylesheet_path()
|
||||
);
|
||||
}
|
||||
return $this->local_stylesheet_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get styles with fonts downloaded locally.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_styles() {
|
||||
|
||||
// If we already have the local file, return its contents.
|
||||
$local_stylesheet_contents = $this->get_local_stylesheet_contents();
|
||||
if ( $local_stylesheet_contents ) {
|
||||
return $local_stylesheet_contents;
|
||||
}
|
||||
|
||||
// Get the remote URL contents.
|
||||
$this->remote_styles = $this->get_remote_url_contents();
|
||||
|
||||
// Get an array of locally-hosted files.
|
||||
$files = $this->get_local_files_from_css();
|
||||
|
||||
// Convert paths to URLs.
|
||||
foreach ( $files as $remote => $local ) {
|
||||
$files[ $remote ] = str_replace(
|
||||
$this->get_base_path(),
|
||||
$this->get_base_url(),
|
||||
$local
|
||||
);
|
||||
}
|
||||
|
||||
$this->css = str_replace(
|
||||
array_keys( $files ),
|
||||
array_values( $files ),
|
||||
$this->remote_styles
|
||||
);
|
||||
|
||||
$this->write_stylesheet();
|
||||
|
||||
return $this->css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get local stylesheet contents.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string|false Returns the remote URL contents.
|
||||
*/
|
||||
public function get_local_stylesheet_contents() {
|
||||
$local_path = $this->get_local_stylesheet_path();
|
||||
|
||||
// Check if the local stylesheet exists.
|
||||
if ( $this->local_file_exists() ) {
|
||||
|
||||
// Attempt to update the stylesheet. Return false on fail.
|
||||
if ( ! $this->write_stylesheet() ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ob_start();
|
||||
include $local_path;
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get remote file contents.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @return string Returns the remote URL contents.
|
||||
*/
|
||||
public function get_remote_url_contents() {
|
||||
|
||||
/**
|
||||
* The user-agent we want to use.
|
||||
*
|
||||
* The default user-agent is the only one compatible with woff (not woff2)
|
||||
* which also supports unicode ranges.
|
||||
*/
|
||||
$user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8';
|
||||
|
||||
// Switch to a user-agent supporting woff2 if we don't need to support IE.
|
||||
if ( 'woff2' === $this->font_format ) {
|
||||
$user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0';
|
||||
}
|
||||
|
||||
// Get the response.
|
||||
$response = wp_remote_get( $this->remote_url, array( 'user-agent' => $user_agent ) );
|
||||
|
||||
// Early exit if there was an error.
|
||||
if ( is_wp_error( $response ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the CSS from our response.
|
||||
$contents = wp_remote_retrieve_body( $response );
|
||||
|
||||
// Early exit if there was an error.
|
||||
if ( is_wp_error( $contents ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Download files mentioned in our CSS locally.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @return array Returns an array of remote URLs and their local counterparts.
|
||||
*/
|
||||
public function get_local_files_from_css() {
|
||||
$font_files = $this->get_remote_files_from_css();
|
||||
$stored = get_site_option( 'downloaded_font_files', array() );
|
||||
$change = false; // If in the end this is true, we need to update the cache option.
|
||||
|
||||
// If the fonts folder don't exist, create it.
|
||||
if ( ! file_exists( $this->get_fonts_folder() ) ) {
|
||||
$this->get_filesystem()->mkdir( $this->get_fonts_folder(), FS_CHMOD_DIR );
|
||||
}
|
||||
|
||||
foreach ( $font_files as $font_family => $files ) {
|
||||
|
||||
// The folder path for this font-family.
|
||||
$folder_path = $this->get_fonts_folder() . '/' . $font_family;
|
||||
|
||||
// If the folder doesn't exist, create it.
|
||||
if ( ! file_exists( $folder_path ) ) {
|
||||
$this->get_filesystem()->mkdir( $folder_path, FS_CHMOD_DIR );
|
||||
}
|
||||
|
||||
foreach ( $files as $url ) {
|
||||
|
||||
// Get the filename.
|
||||
$filename = basename( wp_parse_url( $url, PHP_URL_PATH ) );
|
||||
$font_path = $folder_path . '/' . $filename;
|
||||
|
||||
// Check if the file already exists.
|
||||
if ( file_exists( $font_path ) ) {
|
||||
|
||||
// Skip if already cached.
|
||||
if ( isset( $stored[ $url ] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add file to the cache and change the $changed var to indicate we need to update the option.
|
||||
$stored[ $url ] = $font_path;
|
||||
$change = true;
|
||||
|
||||
// Since the file exists we don't need to proceed with downloading it.
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* If we got this far, we need to download the file.
|
||||
*/
|
||||
|
||||
// require file.php if the download_url function doesn't exist.
|
||||
if ( ! function_exists( 'download_url' ) ) {
|
||||
require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
|
||||
}
|
||||
|
||||
// Download file to temporary location.
|
||||
$tmp_path = download_url( $url );
|
||||
|
||||
// Make sure there were no errors.
|
||||
if ( is_wp_error( $tmp_path ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Move temp file to final destination.
|
||||
$success = $this->get_filesystem()->move( $tmp_path, $font_path, true );
|
||||
if ( $success ) {
|
||||
$stored[ $url ] = $font_path;
|
||||
$change = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there were changes, update the option.
|
||||
if ( $change ) {
|
||||
|
||||
// Cleanup the option and then save it.
|
||||
foreach ( $stored as $url => $path ) {
|
||||
if ( ! file_exists( $path ) ) {
|
||||
unset( $stored[ $url ] );
|
||||
}
|
||||
}
|
||||
update_site_option( 'downloaded_font_files', $stored );
|
||||
}
|
||||
|
||||
return $stored;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get font files from the CSS.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @return array Returns an array of font-families and the font-files used.
|
||||
*/
|
||||
public function get_remote_files_from_css() {
|
||||
|
||||
$font_faces = explode( '@font-face', $this->remote_styles );
|
||||
|
||||
$result = array();
|
||||
|
||||
// Loop all our font-face declarations.
|
||||
foreach ( $font_faces as $font_face ) {
|
||||
|
||||
// Make sure we only process styles inside this declaration.
|
||||
$style = explode( '}', $font_face )[0];
|
||||
|
||||
// Sanity check.
|
||||
if ( false === strpos( $style, 'font-family' ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get an array of our font-families.
|
||||
preg_match_all( '/font-family.*?\;/', $style, $matched_font_families );
|
||||
|
||||
// Get an array of our font-files.
|
||||
preg_match_all( '/url\(.*?\)/i', $style, $matched_font_files );
|
||||
|
||||
// Get the font-family name.
|
||||
$font_family = 'unknown';
|
||||
if ( isset( $matched_font_families[0] ) && isset( $matched_font_families[0][0] ) ) {
|
||||
$font_family = rtrim( ltrim( $matched_font_families[0][0], 'font-family:' ), ';' );
|
||||
$font_family = trim( str_replace( array( "'", ';' ), '', $font_family ) );
|
||||
$font_family = sanitize_key( strtolower( str_replace( ' ', '-', $font_family ) ) );
|
||||
}
|
||||
|
||||
// Make sure the font-family is set in our array.
|
||||
if ( ! isset( $result[ $font_family ] ) ) {
|
||||
$result[ $font_family ] = array();
|
||||
}
|
||||
|
||||
// Get files for this font-family and add them to the array.
|
||||
foreach ( $matched_font_files as $match ) {
|
||||
|
||||
// Sanity check.
|
||||
if ( ! isset( $match[0] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the file URL.
|
||||
$result[ $font_family ][] = rtrim( ltrim( $match[0], 'url(' ), ')' );
|
||||
}
|
||||
|
||||
// Make sure we have unique items.
|
||||
// We're using array_flip here instead of array_unique for improved performance.
|
||||
$result[ $font_family ] = array_flip( array_flip( $result[ $font_family ] ) );
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the CSS to the filesystem.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.1.0
|
||||
* @return string|false Returns the absolute path of the file on success, or false on fail.
|
||||
*/
|
||||
protected function write_stylesheet() {
|
||||
$file_path = $this->get_local_stylesheet_path();
|
||||
$filesystem = $this->get_filesystem();
|
||||
|
||||
// If the folder doesn't exist, create it.
|
||||
if ( ! file_exists( $this->get_fonts_folder() ) ) {
|
||||
$this->get_filesystem()->mkdir( $this->get_fonts_folder(), FS_CHMOD_DIR );
|
||||
}
|
||||
|
||||
// If the file doesn't exist, create it. Return false if it can not be created.
|
||||
if ( ! $filesystem->exists( $file_path ) && ! $filesystem->touch( $file_path ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we got this far, we need to write the file.
|
||||
// Get the CSS.
|
||||
if ( ! $this->css ) {
|
||||
$this->get_styles();
|
||||
}
|
||||
|
||||
// Put the contents in the file. Return false if that fails.
|
||||
if ( ! $filesystem->put_contents( $file_path, $this->css ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $file_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stylesheet path.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_local_stylesheet_path() {
|
||||
if ( ! $this->local_stylesheet_path ) {
|
||||
$this->local_stylesheet_path = $this->get_fonts_folder() . '/' . $this->get_local_stylesheet_filename() . '.css';
|
||||
}
|
||||
return $this->local_stylesheet_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the local stylesheet filename.
|
||||
*
|
||||
* This is a hash, generated from the site-URL, the wp-content path and the URL.
|
||||
* This way we can avoid issues with sites changing their URL, or the wp-content path etc.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_local_stylesheet_filename() {
|
||||
return md5( $this->get_base_url() . $this->get_base_path() . $this->remote_url );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the font-format to be used.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @param string $format The format to be used. Use "woff" or "woff2".
|
||||
* @return void
|
||||
*/
|
||||
public function set_font_format( $format = 'woff2' ) {
|
||||
$this->font_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the local stylesheet exists.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return bool
|
||||
*/
|
||||
public function local_file_exists() {
|
||||
return ( ! file_exists( $this->get_local_stylesheet_path() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the base path.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_base_path() {
|
||||
if ( ! $this->base_path ) {
|
||||
$this->base_path = apply_filters( 'wptt_get_local_fonts_base_path', $this->get_filesystem()->wp_content_dir() );
|
||||
}
|
||||
return $this->base_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the base URL.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_base_url() {
|
||||
if ( ! $this->base_url ) {
|
||||
$this->base_url = apply_filters( 'wptt_get_local_fonts_base_url', content_url() );
|
||||
}
|
||||
return $this->base_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the subfolder name.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_subfolder_name() {
|
||||
if ( ! $this->subfolder_name ) {
|
||||
$this->subfolder_name = apply_filters( 'wptt_get_local_fonts_subfolder_name', 'fonts' );
|
||||
}
|
||||
return $this->subfolder_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the folder for fonts.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function get_fonts_folder() {
|
||||
if ( ! $this->fonts_folder ) {
|
||||
$this->fonts_folder = $this->get_base_path();
|
||||
if ( $this->get_subfolder_name() ) {
|
||||
$this->fonts_folder .= '/' . $this->get_subfolder_name();
|
||||
}
|
||||
}
|
||||
return $this->fonts_folder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule a cleanup.
|
||||
*
|
||||
* Deletes the fonts files on a regular basis.
|
||||
* This way font files will get updated regularly,
|
||||
* and we avoid edge cases where unused files remain in the server.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return void
|
||||
*/
|
||||
public function schedule_cleanup() {
|
||||
if ( ! is_multisite() || ( is_multisite() && is_main_site() ) ) {
|
||||
if ( ! wp_next_scheduled( 'delete_fonts_folder' ) && ! wp_installing() ) {
|
||||
wp_schedule_event( time(), self::CLEANUP_FREQUENCY, 'delete_fonts_folder' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the fonts folder.
|
||||
*
|
||||
* This runs as part of a cleanup routine.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.0
|
||||
* @return bool
|
||||
*/
|
||||
public function delete_fonts_folder() {
|
||||
return $this->get_filesystem()->delete( $this->get_fonts_folder(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filesystem.
|
||||
*
|
||||
* @access protected
|
||||
* @since 1.0.0
|
||||
* @return WP_Filesystem
|
||||
*/
|
||||
protected function get_filesystem() {
|
||||
global $wp_filesystem;
|
||||
|
||||
// If the filesystem has not been instantiated yet, do it here.
|
||||
if ( ! $wp_filesystem ) {
|
||||
if ( ! function_exists( 'WP_Filesystem' ) ) {
|
||||
require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
|
||||
}
|
||||
WP_Filesystem();
|
||||
}
|
||||
return $wp_filesystem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'wptt_get_webfont_styles' ) ) {
|
||||
/**
|
||||
* Get styles for a webfont.
|
||||
*
|
||||
* This will get the CSS from the remote API,
|
||||
* download any fonts it contains,
|
||||
* replace references to remote URLs with locally-downloaded assets,
|
||||
* and finally return the resulting CSS.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param string $url The URL of the remote webfont.
|
||||
* @param string $format The font-format. If you need to support IE, change this to "woff".
|
||||
*
|
||||
* @return string Returns the CSS.
|
||||
*/
|
||||
function wptt_get_webfont_styles( $url, $format = 'woff2' ) {
|
||||
$font = new WPTT_WebFont_Loader( $url );
|
||||
$font->set_font_format( $format );
|
||||
return $font->get_styles();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'wptt_get_webfont_url' ) ) {
|
||||
/**
|
||||
* Get a stylesheet URL for a webfont.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*
|
||||
* @param string $url The URL of the remote webfont.
|
||||
* @param string $format The font-format. If you need to support IE, change this to "woff".
|
||||
*
|
||||
* @return string Returns the CSS.
|
||||
*/
|
||||
function wptt_get_webfont_url( $url, $format = 'woff2' ) {
|
||||
$font = new WPTT_WebFont_Loader( $url );
|
||||
$font->set_font_format( $format );
|
||||
return $font->get_url();
|
||||
}
|
||||
}
|
||||
91
wp-content/themes/consultstreet/inc/metabox.php
Normal file
91
wp-content/themes/consultstreet/inc/metabox.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* Metabox for Page Layout
|
||||
*
|
||||
* @package consultstreet
|
||||
*
|
||||
*/
|
||||
|
||||
function consultstreet_add_sidebar_layout_box(){
|
||||
add_meta_box( 'consultstreet_sidebar_layout', __( 'Sidebar Layout', 'consultstreet' ), 'consultstreet_sidebar_layout_callback', 'page', 'normal', 'high' );
|
||||
}
|
||||
add_action( 'add_meta_boxes', 'consultstreet_add_sidebar_layout_box' );
|
||||
|
||||
$consultstreet_sidebar_layout = array(
|
||||
|
||||
'right-sidebar' => array(
|
||||
'value' => 'right-sidebar',
|
||||
'thumbnail' => get_template_directory_uri() . '/assets/img/icons/theme-right-sidebar.png'
|
||||
),
|
||||
'no-sidebar' => array(
|
||||
'value' => 'no-sidebar',
|
||||
'thumbnail' => get_template_directory_uri() . '/assets/img/icons/theme-fullwidth.png'
|
||||
),
|
||||
'left-sidebar' => array(
|
||||
'value' => 'left-sidebar',
|
||||
'thumbnail' => get_template_directory_uri() . '/assets/img/icons/theme-left-sidebar.png'
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
function consultstreet_sidebar_layout_callback(){
|
||||
global $post , $consultstreet_sidebar_layout;
|
||||
wp_nonce_field( basename( __FILE__ ), 'consultstreet_nonce' );
|
||||
?>
|
||||
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<td colspan="4"><em class="f13"><?php esc_html_e( 'Choose Sidebar Template for the Defult Page Templates', 'consultstreet' ); ?></em></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
foreach( $consultstreet_sidebar_layout as $field ){
|
||||
$layout = get_post_meta( $post->ID, '_sidebar_layout', true ); ?>
|
||||
|
||||
<div class="radio-image-wrapper" style="float:left; margin-right:30px;">
|
||||
<label class="description">
|
||||
<span><img src="<?php echo esc_url( $field['thumbnail'] ); ?>" alt="" /></span><br/>
|
||||
<input type="radio" name="consultstreet_sidebar_layout" value="<?php echo esc_attr( $field['value'] ); ?>" <?php checked( $field['value'], $layout ); if( empty( $layout ) ){ checked( $field['value'], 'right-sidebar' ); }?>/>
|
||||
</label>
|
||||
</div>
|
||||
<?php } // end foreach
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function consultstreet_save_sidebar_layout( $post_id ){
|
||||
global $consultstreet_sidebar_layout , $post;
|
||||
|
||||
// Verify the nonce before proceeding.
|
||||
if ( !isset( $_POST[ 'consultstreet_nonce' ] ) || !wp_verify_nonce( $_POST[ 'consultstreet_nonce' ], basename( __FILE__ ) ) )
|
||||
return;
|
||||
|
||||
// Stop WP from clearing custom fields on autosave
|
||||
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE)
|
||||
return;
|
||||
|
||||
if ('page' == isset($_POST['post_type'])) {
|
||||
if (!current_user_can( 'edit_page', $post_id ) )
|
||||
return $post_id;
|
||||
} elseif (!current_user_can( 'edit_post', $post_id ) ) {
|
||||
return $post_id;
|
||||
}
|
||||
foreach( $consultstreet_sidebar_layout as $field ){
|
||||
//Execute this saving function
|
||||
$old = get_post_meta( $post_id, '_sidebar_layout', true );
|
||||
$new = isset( $_POST['consultstreet_sidebar_layout'] ) ? sanitize_key( $_POST['consultstreet_sidebar_layout'] ) : 'right-sidebar';
|
||||
if( $new && $new != $old ) {
|
||||
update_post_meta( $post_id, '_sidebar_layout', $new );
|
||||
}elseif( '' == $new && $old ) {
|
||||
delete_post_meta( $post_id, '_sidebar_layout', $old );
|
||||
}
|
||||
} // end foreach
|
||||
}
|
||||
add_action( 'save_post' , 'consultstreet_save_sidebar_layout' );
|
||||
495
wp-content/themes/consultstreet/inc/template-tags.php
Normal file
495
wp-content/themes/consultstreet/inc/template-tags.php
Normal file
@ -0,0 +1,495 @@
|
||||
<?php
|
||||
/**
|
||||
* Functions which enhance the theme into WordPress
|
||||
*
|
||||
* @package consultstreet
|
||||
*/
|
||||
|
||||
/**
|
||||
* Theme Custom Logo
|
||||
*/
|
||||
function consultstreet_header_logo() {
|
||||
|
||||
$consultstreet_main_header_style = get_theme_mod('consultstreet_main_header_style', 'standard');
|
||||
$consultstreet_sticky_bar_logo = get_theme_mod('consultstreet_sticky_bar_logo');
|
||||
|
||||
the_custom_logo(); ?>
|
||||
|
||||
<?php if($consultstreet_sticky_bar_logo != null) : ?>
|
||||
<a class="sticky-navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" ><img src="<?php echo esc_url($consultstreet_sticky_bar_logo); ?>" class="custom-logo" alt="<?php esc_attr(bloginfo("name")); ?>"></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( display_header_text() ) : ?>
|
||||
<?php if ( get_bloginfo( 'title' ) !== '' || get_bloginfo( 'description' ) !== '' ){ ?>
|
||||
<div class="site-branding-text">
|
||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php esc_attr(bloginfo( 'name' )); ?></a></h1>
|
||||
<?php
|
||||
$description = get_bloginfo( 'description', 'display' );
|
||||
if ( $description || is_customize_preview() ) : ?>
|
||||
<p class="site-description"><?php echo esc_html( $description ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php } endif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme Logo Class
|
||||
*/
|
||||
function consultstreet_header_logo_class($html)
|
||||
{
|
||||
$html = str_replace('custom-logo-link', 'navbar-brand', $html);
|
||||
return $html;
|
||||
}
|
||||
add_filter('get_custom_logo','consultstreet_header_logo_class');
|
||||
|
||||
/**
|
||||
* Select sanitization callback
|
||||
*
|
||||
*/
|
||||
function consultstreet_sanitize_select( $value ){
|
||||
if ( is_array( $value ) ) {
|
||||
foreach ( $value as $key => $subvalue ) {
|
||||
$value[ $key ] = sanitize_text_field( $subvalue );
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
return sanitize_text_field( $value );
|
||||
}
|
||||
|
||||
function consultstreet_sanitize_text( $input ) {
|
||||
return wp_kses_post( force_balance_tags( $input ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme Comment Function
|
||||
*/
|
||||
if ( ! function_exists( 'consultstreet_comment' ) ) :
|
||||
function consultstreet_comment( $comment, $args, $depth )
|
||||
{
|
||||
?>
|
||||
<div <?php comment_class('media comment-box'); ?> id="comment-<?php comment_ID(); ?>">
|
||||
<a class="pull-left-comment">
|
||||
<?php echo get_avatar($comment); ?>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
<div class="comment-detail">
|
||||
<h5 class="comment-detail-title"><?php printf(('%s'), get_comment_author_link()) ?>
|
||||
<time class="comment-date">
|
||||
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) );?>">
|
||||
<?php comment_date('F j, Y');?> <?php esc_html_e('at','consultstreet');?> <?php comment_time('g:i a'); ?>
|
||||
</a>
|
||||
</time></h5>
|
||||
<?php comment_text() ;?>
|
||||
<div class="reply">
|
||||
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
|
||||
</div>
|
||||
<?php if ( $comment->comment_approved == '0' ) : ?>
|
||||
<em class="comment-awaiting-moderation"><?php esc_html_e( 'Your comment is awaiting moderation.', 'consultstreet' ); ?></em>
|
||||
<br/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
endif;
|
||||
add_filter('get_avatar','consultstreet_gravatar_class');
|
||||
function consultstreet_gravatar_class($class) {
|
||||
$class = str_replace("class='avatar", "class='img-fluid rounded-circle", $class);
|
||||
return $class;
|
||||
}
|
||||
|
||||
function consultstreet_read_more_button_class($read_class)
|
||||
{ global $post;
|
||||
return '<p><a href="' . esc_url(get_permalink()) . "#more-{$post->ID}\" class=\"more-link\">" .esc_html__('Read More','consultstreet')."</a></p>";
|
||||
}
|
||||
add_filter( 'the_content_more_link', 'consultstreet_read_more_button_class' );
|
||||
|
||||
function consultstreet_post_thumbnail() {
|
||||
if(has_post_thumbnail()){
|
||||
echo '<figure class="post-thumbnail"><a href="'.esc_url( get_the_permalink() ).'">';
|
||||
the_post_thumbnail( '', array( 'class'=>'img-fluid' ) );
|
||||
echo '</a></figure>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme Page Header Title
|
||||
*/
|
||||
function consultstreet_theme_page_header_title(){
|
||||
if( is_archive() )
|
||||
{
|
||||
echo '<div class="page-header-title text-center"><h1 class="text-white">';
|
||||
if ( is_day() ) :
|
||||
/* translators: %1$s %2$s: date */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Archives','consultstreet'), get_the_date() );
|
||||
elseif ( is_month() ) :
|
||||
/* translators: %1$s %2$s: month */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Archives','consultstreet'), get_the_date( 'F Y' ) );
|
||||
elseif ( is_year() ) :
|
||||
/* translators: %1$s %2$s: year */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Archives','consultstreet'), get_the_date( 'Y' ) );
|
||||
elseif( is_author() ):
|
||||
/* translators: %1$s %2$s: author */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('All posts by','consultstreet'), get_the_author() );
|
||||
elseif( is_category() ):
|
||||
/* translators: %1$s %2$s: category */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Category','consultstreet'), single_cat_title( '', false ) );
|
||||
elseif( is_tag() ):
|
||||
/* translators: %1$s %2$s: tag */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Tag','consultstreet'), single_tag_title( '', false ) );
|
||||
elseif( class_exists( 'WooCommerce' ) && is_shop() ):
|
||||
/* translators: %1$s %2$s: WooCommerce */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Shop','consultstreet'), single_tag_title( '', false ));
|
||||
elseif( is_archive() ):
|
||||
the_archive_title( '<h1 class="text-white">', '</h1>' );
|
||||
endif;
|
||||
echo '</h1></div>';
|
||||
}
|
||||
elseif( is_404() )
|
||||
{
|
||||
echo '<div class="page-header-title text-center"><h1 class="text-white">';
|
||||
/* translators: %1$s: 404 */
|
||||
printf( esc_html__( '%1$s ', 'consultstreet' ) , esc_html__('404','consultstreet') );
|
||||
echo '</h1></div>';
|
||||
}
|
||||
elseif( is_search() )
|
||||
{
|
||||
echo '<div class="page-header-title text-center"><h1 class="text-white">';
|
||||
/* translators: %1$s %2$s: search */
|
||||
printf( esc_html__( '%1$s %2$s', 'consultstreet' ), esc_html__('Search results for','consultstreet'), get_search_query() );
|
||||
echo '</h1></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<div class="page-header-title text-center"><h1 class="text-white">'.esc_html( get_the_title() ).'</h1></div>';
|
||||
}
|
||||
}
|
||||
|
||||
function consultstreet_bootstrap_menu_notitle( $menu ){
|
||||
return $menu = preg_replace('/ title=\"(.*?)\"/', '', $menu );
|
||||
}
|
||||
add_filter( 'wp_nav_menu', 'consultstreet_bootstrap_menu_notitle' );
|
||||
|
||||
/**
|
||||
* Theme Breadcrumbs Url
|
||||
*/
|
||||
function consultstreet_page_url() {
|
||||
$page_url = 'http';
|
||||
if ( key_exists("HTTPS", $_SERVER) && ( $_SERVER["HTTPS"] == "on" ) ){
|
||||
$page_url .= "s";
|
||||
}
|
||||
$page_url .= "://";
|
||||
if ($_SERVER["SERVER_PORT"] != "80") {
|
||||
$page_url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
||||
} else {
|
||||
$page_url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
||||
}
|
||||
return $page_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme Breadcrumbs
|
||||
*/
|
||||
if( !function_exists('consultstreet_page_header_breadcrumbs') ):
|
||||
function consultstreet_page_header_breadcrumbs() {
|
||||
global $post;
|
||||
$homeLink = home_url();
|
||||
$consultstreet_page_header_layout = get_theme_mod('consultstreet_page_header_layout', 'consultstreet_page_header_layout1');
|
||||
if($consultstreet_page_header_layout == 'consultstreet_page_header_layout1'):
|
||||
$breadcrumb_class = 'text-center';
|
||||
else: $breadcrumb_class = 'text-right';
|
||||
endif;
|
||||
|
||||
echo '<ul id="content" class="page-breadcrumb '.esc_attr( $breadcrumb_class ).'">';
|
||||
if (is_home() || is_front_page()) :
|
||||
echo '<li><a href="'.esc_url($homeLink).'">'.esc_html__('Home','consultstreet').'</a></li>';
|
||||
echo '<li class="active">'; echo single_post_title(); echo '</li>';
|
||||
else:
|
||||
echo '<li><a href="'.esc_url($homeLink).'">'.esc_html__('Home','consultstreet').'</a></li>';
|
||||
if ( is_category() ) {
|
||||
echo '<li class="active"><a href="'. esc_url( consultstreet_page_url() ) .'">' . esc_html__('Archive by category','consultstreet').' "' . single_cat_title('', false) . '"</a></li>';
|
||||
} elseif ( is_day() ) {
|
||||
echo '<li class="active"><a href="'. esc_url(get_year_link(esc_attr(get_the_time('Y')))) . '">'. esc_html(get_the_time('Y')) .'</a>';
|
||||
echo '<li class="active"><a href="'. esc_url(get_month_link(esc_attr(get_the_time('Y')),esc_attr(get_the_time('m')))) .'">'. esc_html(get_the_time('F')) .'</a>';
|
||||
echo '<li class="active"><a href="'. esc_url( consultstreet_page_url() ) .'">'. esc_html(get_the_time('d')) .'</a></li>';
|
||||
} elseif ( is_month() ) {
|
||||
echo '<li class="active"><a href="' . esc_url( get_year_link(esc_attr(get_the_time('Y'))) ) . '">' . esc_html(get_the_time('Y')) . '</a>';
|
||||
echo '<li class="active"><a href="'. esc_url( consultstreet_page_url() ) .'">'. esc_html(get_the_time('F')) .'</a></li>';
|
||||
} elseif ( is_year() ) {
|
||||
echo '<li class="active"><a href="'. esc_url( consultstreet_page_url() ) .'">'. esc_html(get_the_time('Y')) .'</a></li>';
|
||||
} elseif ( is_single() && !is_attachment() && is_page('single-product') ) {
|
||||
if ( get_post_type() != 'post' ) {
|
||||
$cat = get_the_category();
|
||||
$cat = $cat[0];
|
||||
echo '<li>';
|
||||
echo esc_html( get_category_parents($cat, TRUE, '') );
|
||||
echo '</li>';
|
||||
echo '<li class="active"><a href="' . esc_url( consultstreet_page_url() ) . '">'. get_the_title() .'</a></li>';
|
||||
} }
|
||||
elseif ( is_page() && $post->post_parent ) {
|
||||
$parent_id = $post->post_parent;
|
||||
$breadcrumbs = array();
|
||||
while ($parent_id) {
|
||||
$page = get_page($parent_id);
|
||||
$breadcrumbs[] = '<li class="active"><a href="' . esc_url(get_permalink($page->ID)) . '">' . get_the_title($page->ID) . '</a>';
|
||||
$parent_id = $page->post_parent;
|
||||
}
|
||||
$breadcrumbs = array_reverse($breadcrumbs);
|
||||
foreach ($breadcrumbs as $crumb) echo $crumb;
|
||||
echo '<li class="active"><a href="' . consultstreet_page_url() . '">'. get_the_title().'</a></li>';
|
||||
}
|
||||
elseif( is_search() )
|
||||
{
|
||||
echo '<li class="active"><a href="' . esc_url( consultstreet_page_url() ) . '">'. get_search_query() .'</a></li>';
|
||||
}
|
||||
elseif( is_404() )
|
||||
{
|
||||
echo '<li class="active"><a href="' . esc_url( consultstreet_page_url() ) . '">'.esc_html__('Error 404','consultstreet').'</a></li>';
|
||||
}
|
||||
else {
|
||||
echo '<li class="active"><a href="' . esc_url( consultstreet_page_url() ) . '">'. esc_html( get_the_title() ) .'</a></li>';
|
||||
}
|
||||
endif;
|
||||
echo '</ul>';
|
||||
}
|
||||
endif;
|
||||
|
||||
if( ! function_exists( 'consultstreet_custom_customizer_options' ) ):
|
||||
function consultstreet_custom_customizer_options() {
|
||||
|
||||
$consultstreet_sticky_bar_logo = get_theme_mod('consultstreet_sticky_bar_logo');
|
||||
$consultstreet_main_slider_content_color = get_theme_mod('consultstreet_main_slider_content_color', '#fff');
|
||||
$consultstreet_custom_logo_size = get_theme_mod('consultstreet_custom_logo_size', array('slider' => 257,'suffix' => 'px',));
|
||||
|
||||
$output_css = '';
|
||||
|
||||
if ( has_header_image() ) :
|
||||
$output_css .=".theme-page-header-area {
|
||||
background: #17212c url(" .esc_url( get_header_image() ). ");
|
||||
background-attachment: scroll;
|
||||
background-position: top center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}\n";
|
||||
endif;
|
||||
|
||||
if($consultstreet_custom_logo_size['slider'] != null) :
|
||||
$output_css .=".navbar img.custom-logo, .theme-header-magazine img.custom-logo{
|
||||
max-width: ".$consultstreet_custom_logo_size['slider']."px;
|
||||
height: auto;
|
||||
}\n";
|
||||
endif;
|
||||
|
||||
if($consultstreet_main_slider_content_color != null) :
|
||||
$output_css .=".theme-slider-content .title-large {
|
||||
color: ".$consultstreet_main_slider_content_color.";
|
||||
}
|
||||
.theme-slider-content .description {
|
||||
color: ".$consultstreet_main_slider_content_color.";
|
||||
}\n";
|
||||
endif;
|
||||
|
||||
if($consultstreet_sticky_bar_logo != null) :
|
||||
$output_css .=".header-fixed-top .navbar-brand {
|
||||
display: none !important;
|
||||
}
|
||||
.not-sticky .sticky-navbar-brand {
|
||||
display: none !important;
|
||||
}\n";
|
||||
endif;
|
||||
|
||||
if ( is_user_logged_in() && is_admin_bar_showing() ) {
|
||||
$output_css .="@media (min-width: 600px){
|
||||
.navbar.header-fixed-top{top:32px;}
|
||||
}\n";
|
||||
}
|
||||
|
||||
wp_add_inline_style( 'consultstreet-style', $output_css );
|
||||
}
|
||||
endif;
|
||||
add_action( 'wp_enqueue_scripts', 'consultstreet_custom_customizer_options' );
|
||||
|
||||
/**
|
||||
* Get started notice
|
||||
*/
|
||||
|
||||
add_action( 'wp_ajax_consultstreet_dismissed_notice_handler', 'consultstreet_ajax_notice_handler' );
|
||||
|
||||
/**
|
||||
* AJAX handler to store the state of dismissible notices.
|
||||
*/
|
||||
function consultstreet_ajax_notice_handler() {
|
||||
if ( isset( $_POST['type'] ) ) {
|
||||
// Pick up the notice "type" - passed via jQuery (the "data-notice" attribute on the notice)
|
||||
$type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
|
||||
// Store it in the options table
|
||||
update_option( 'dismissed-' . $type, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
function consultstreet_deprecated_hook_admin_notice() {
|
||||
// Check if it's been dismissed...
|
||||
if ( ! get_option('dismissed-get_started', FALSE ) ) {
|
||||
// Added the class "notice-get-started-class" so jQuery pick it up and pass via AJAX,
|
||||
// and added "data-notice" attribute in order to track multiple / different notices
|
||||
// multiple dismissible notice states ?>
|
||||
<div class="updated notice notice-get-started-class is-dismissible" data-notice="get_started">
|
||||
<div class="consultstreet-getting-started-notice clearfix">
|
||||
<div class="consultstreet-theme-screenshot">
|
||||
<img src="<?php echo esc_url( get_stylesheet_directory_uri() ); ?>/screenshot.png" class="screenshot" alt="<?php esc_attr_e( 'Theme Screenshot', 'consultstreet' ); ?>" />
|
||||
</div><!-- /.consultstreet-theme-screenshot -->
|
||||
<div class="consultstreet-theme-notice-content">
|
||||
<h2 class="consultstreet-notice-h2">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: welcome page link starting html tag, 2: welcome page link ending html tag. */
|
||||
esc_html__( 'Welcome! Thank you for choosing %1$s!', 'consultstreet' ), '<strong>'. wp_get_theme()->get('Name'). '</strong>' );
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<p class="plugin-install-notice"><?php echo sprintf(__('To take full advantage of all the features of this theme, please install and activate the <strong>Arile Extra</strong> plugin, then enjoy this theme.', 'consultstreet')) ?></p>
|
||||
|
||||
<a class="consultstreet-btn-get-started button button-primary button-hero consultstreet-button-padding" href="#" data-name="" data-slug="">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: welcome page link starting html tag, 2: welcome page link ending html tag. */
|
||||
esc_html__( 'Get started with %1$s', 'consultstreet' ), '<strong>'. wp_get_theme()->get('Name'). '</strong>' );
|
||||
?>
|
||||
|
||||
</a><span class="consultstreet-push-down">
|
||||
<?php
|
||||
/* translators: %1$s: Anchor link start %2$s: Anchor link end */
|
||||
printf(
|
||||
'or %1$sCustomize theme%2$s</a></span>',
|
||||
'<a target="_blank" href="' . esc_url( admin_url( 'customize.php' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</div><!-- /.consultstreet-theme-notice-content -->
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
}
|
||||
|
||||
add_action( 'admin_notices', 'consultstreet_deprecated_hook_admin_notice' );
|
||||
|
||||
/**
|
||||
* Plugin installer
|
||||
*/
|
||||
|
||||
add_action( 'wp_ajax_install_act_plugin', 'consultstreet_admin_install_plugin' );
|
||||
|
||||
function consultstreet_admin_install_plugin() {
|
||||
/**
|
||||
* Install Plugin.
|
||||
*/
|
||||
include_once ABSPATH . '/wp-admin/includes/file.php';
|
||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
||||
|
||||
if ( ! file_exists( WP_PLUGIN_DIR . '/arile-extra' ) ) {
|
||||
$api = plugins_api( 'plugin_information', array(
|
||||
'slug' => sanitize_key( wp_unslash( 'arile-extra' ) ),
|
||||
'fields' => array(
|
||||
'sections' => false,
|
||||
),
|
||||
) );
|
||||
|
||||
$skin = new WP_Ajax_Upgrader_Skin();
|
||||
$upgrader = new Plugin_Upgrader( $skin );
|
||||
$result = $upgrader->install( $api->download_link );
|
||||
}
|
||||
|
||||
// Activate plugin.
|
||||
if ( current_user_can( 'activate_plugin' ) ) {
|
||||
$result = activate_plugin( 'arile-extra/arile-extra.php' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Menu
|
||||
*/
|
||||
function consultstreet_custom_menu_script()
|
||||
{
|
||||
$custom_logo = get_theme_mod( 'custom_logo' );
|
||||
if(display_header_text()== true && $custom_logo != null && get_bloginfo( 'title' ) !== '' ){
|
||||
$toggle_value = 2;
|
||||
}else{
|
||||
$toggle_value = 1;
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
// This JS added for the Toggle button to work with the focus element.
|
||||
if (window.innerWidth < 992) {
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
let isTabPressed = e.key === 'Tab' || e.keyCode === 9;
|
||||
if (!isTabPressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const focusableElements =
|
||||
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
||||
const modal = document.querySelector('.navbar.navbar-expand-lg'); // select the modal by it's id
|
||||
|
||||
const firstFocusableElement = modal.querySelectorAll(focusableElements)[<?php echo $toggle_value; ?>]; // get first element to be focused inside modal
|
||||
const focusableContent = modal.querySelectorAll(focusableElements);
|
||||
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal
|
||||
|
||||
if (e.shiftKey) { // if shift key pressed for shift + tab combination
|
||||
if (document.activeElement === firstFocusableElement) {
|
||||
lastFocusableElement.focus(); // add focus for the last focusable element
|
||||
e.preventDefault();
|
||||
}
|
||||
} else { // if tab key is pressed
|
||||
if (document.activeElement === lastFocusableElement) { // if focused has reached to last focusable element then focus first focusable element after pressing tab
|
||||
firstFocusableElement.focus(); // add focus for the first focusable element
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action('wp_footer','consultstreet_custom_menu_script');
|
||||
|
||||
function display_upgrade_pro_admin_notice() {
|
||||
?>
|
||||
<div class="notice notice-success">
|
||||
<p class="notice-text">
|
||||
<?php
|
||||
$current_user = wp_get_current_user();
|
||||
$theme_info = wp_get_theme();
|
||||
|
||||
printf(
|
||||
/* Translators: %1$s current user display name., %2$s this theme name., %3$s discount coupon code., %4$s discount percentage. */
|
||||
esc_html__(
|
||||
'Howdy, %1$s! You\'ve been using %2$s theme for a while now, and we hope you\'re happy with it. To access more premium features you can always upgrade to pro. All contents and settings will remain as it is after upgrading to pro, you basically start from where you left. %3$s the %4$s of the theme Plan. This limited-time offer is available during checkout—grab it before its gone!',
|
||||
'consultstreet'
|
||||
),
|
||||
'<strong>' . esc_html( $current_user->display_name ) . '</strong>',
|
||||
'<strong>' . esc_html( $theme_info->Name ). '</strong>',
|
||||
'<strong>Unlock premium features with 35% OFF</strong>',
|
||||
'<strong>Pro version</strong>',
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<div class="links">
|
||||
<a href="https://themearile.com/consultstreet-pro-theme/" class="button button-primary" target="_blank">
|
||||
<span class="dashicons dashicons-thumbs-up"></span>
|
||||
<span><?php esc_html_e( 'Upgrade to pro', 'consultstreet' ); ?></span>
|
||||
</a>
|
||||
|
||||
<a href="https://themearile.com/contact/" class="button button-secondary" target="_blank">
|
||||
<span class="dashicons dashicons-info"></span>
|
||||
<span><?php esc_html_e( 'Got pre sales queries?', 'consultstreet' ); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_action( 'admin_notices', 'display_upgrade_pro_admin_notice' );
|
||||
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if( ! function_exists( 'consultstreet_custom_typography_css' ) ):
|
||||
function consultstreet_custom_typography_css() {
|
||||
|
||||
$consultstreet_typography_disabled = get_theme_mod('consultstreet_typography_disabled', false);
|
||||
If($consultstreet_typography_disabled == true):
|
||||
|
||||
$output_css = '';
|
||||
if(get_theme_mod('consultstreet_typography_base_font_family') != null):
|
||||
$output_css .="body { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_base_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_base_font_size') != null):
|
||||
$output_css .="body { font-size: " .esc_attr( get_theme_mod('consultstreet_typography_base_font_size') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_h1_font_family') != null):
|
||||
$output_css .="h1 { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_h1_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_h2_font_family') != null):
|
||||
$output_css .="h2 { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_h2_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_h3_font_family') != null):
|
||||
$output_css .="h3 { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_h3_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_h4_font_family') != null):
|
||||
$output_css .="h4 { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_h4_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_h5_font_family') != null):
|
||||
$output_css .="h5 { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_h5_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
if(get_theme_mod('consultstreet_typography_h6_font_family') != null):
|
||||
$output_css .="h6 { font-family: " .esc_attr( get_theme_mod('consultstreet_typography_h6_font_family') )." !important; }\n";
|
||||
endif;
|
||||
|
||||
wp_add_inline_style( 'consultstreet-style', $output_css );
|
||||
|
||||
endif;
|
||||
|
||||
}
|
||||
endif;
|
||||
add_action( 'wp_enqueue_scripts', 'consultstreet_custom_typography_css' );
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user