Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redelivre/coletivo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: rodineicosta/coletivo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Apr 23, 2021

  1. Alterações mínimas

    rodineicosta committed Apr 23, 2021
    Copy the full SHA
    9de5c04 View commit details
  2. Copy the full SHA
    429f272 View commit details
  3. Coding standards nos arquivos da pasta inc

    - class-metabox.php;
    - dashboard.php;
    - template-tags.php.
    rodineicosta committed Apr 23, 2021
    Copy the full SHA
    e58ee1a View commit details
  4. Coding standards (pasta section-parts)

    - section-services.php;
    - section-social.php;
    - section-yourslider.php.
    rodineicosta committed Apr 23, 2021
    Copy the full SHA
    31a464b View commit details

Commits on May 6, 2021

  1. Coding standards e componentização do Customizer

    - Refatoração WPCS no arquivo do Customizer;
    - Separação em diversos arquivos de trechos de seções do Customizer.
    rodineicosta committed May 6, 2021
    Copy the full SHA
    6eae9c7 View commit details
  2. Coding standards em arquivos do customizer

    - customizer-controls.php;
    - customizer-selective-refresh.php;
    - customizer-update-fields.php.
    rodineicosta committed May 6, 2021
    Copy the full SHA
    00520c2 View commit details

Commits on May 7, 2021

  1. Coding standards em arquivos da pasta inc

    - dashboard.php;
    - extras.php;
    - template-tags.php.
    rodineicosta committed May 7, 2021
    Copy the full SHA
    1b6987a View commit details
  2. Coding standards (pasta section-parts)

    - section-contact.php;
    - section-featuredpage.php;
    - section-features.php.
    rodineicosta committed May 7, 2021
    Copy the full SHA
    20a8028 View commit details

Commits on May 8, 2021

  1. Alterações mínimas

    rodineicosta committed May 8, 2021
    Copy the full SHA
    1557b95 View commit details
  2. Copy the full SHA
    b6b303a View commit details
  3. Coding standards (pasta section-parts)

    - section-gallery.php;
    - section-hero.php;
    - section-news.php.
    rodineicosta committed May 8, 2021
    Copy the full SHA
    ac335e8 View commit details
  4. Coding standards (pasta section-parts)

    - section-portfolio.php;
    - section-services.php;
    - section-social.php.
    rodineicosta committed May 8, 2021
    Copy the full SHA
    9161efc View commit details
  5. Alteração mínima

    rodineicosta committed May 8, 2021
    Copy the full SHA
    a5256ed View commit details
  6. Coding standards (pasta section-parts)

    - section-team.php;
    - section-videolightbox.php;
    - section-yourslider.php.
    rodineicosta committed May 8, 2021
    Copy the full SHA
    3f26cb6 View commit details
  7. Fix: Sanitização

    rodineicosta committed May 8, 2021
    Copy the full SHA
    0d909b6 View commit details

Commits on May 9, 2021

  1. Copy the full SHA
    799ef7f View commit details
  2. Copy the full SHA
    02cf488 View commit details
  3. Copy the full SHA
    d0959bd View commit details
  4. Copy the full SHA
    2da98a7 View commit details
  5. Copy the full SHA
    5e9c5e8 View commit details
  6. Copy the full SHA
    ad40afe View commit details
  7. Copy the full SHA
    48e511e View commit details
  8. Copy the full SHA
    a724aa3 View commit details

Commits on May 12, 2021

  1. Atualização do Composer

    - Upgrade para versão 2.0.13 do Composer;
    - Atualização dos nomes de arquivos das Classes;
    - Atualização dos nomes das Classes;
    rodineicosta committed May 12, 2021
    Copy the full SHA
    bb31161 View commit details

Commits on May 14, 2021

  1. Copy the full SHA
    dcbdb74 View commit details

Commits on May 15, 2021

  1. Copy the full SHA
    41564e3 View commit details

Commits on May 18, 2021

  1. Copy the full SHA
    7d9fca8 View commit details
  2. Refatoração

    - Transferência de todas as funções de sanitização para o mesmo arquivo;
    - Reposicionamento de Hooks após as funções;
    - Retorno do echo na linha 56 do arquivo template-tags.php;
    - Retorno da função wp_localize_script no arquivo customizer.php.
    rodineicosta committed May 18, 2021
    Copy the full SHA
    ae8bcfa View commit details

Commits on May 19, 2021

  1. Copy the full SHA
    9bc1603 View commit details
  2. Copy the full SHA
    c75569f View commit details
  3. Copy the full SHA
    ffdfa12 View commit details
  4. Alteração mínima

    rodineicosta committed May 19, 2021
    Copy the full SHA
    834a14f View commit details
Showing with 8,928 additions and 6,217 deletions.
  1. +12 −3 .gitignore
  2. +16 −13 404.php
  3. +4 −4 README.md
  4. +28 −22 archive.php
  5. +19 −17 comments.php
  6. +22 −0 composer.json
  7. +18 −0 composer.lock
  8. +31 −30 footer.php
  9. +165 −124 functions.php
  10. +12 −10 header.php
  11. +32 −32 home.php
  12. +105 −0 inc/classes/AlphaColorControl.php
  13. +466 −0 inc/classes/CustomizeRepeatableControl.php
  14. +57 −0 inc/classes/EditorCustomControl.php
  15. +65 −0 inc/classes/EditorScripts.php
  16. +61 −0 inc/classes/MiscControl.php
  17. +102 −80 inc/{class-metabox.php → classes/Odin_Metabox.php}
  18. +35 −0 inc/classes/TextareaCustomControl.php
  19. +44 −0 inc/customizer-components/customizer-blog-page-settings.php
  20. +104 −0 inc/customizer-components/customizer-footer.php
  21. +83 −0 inc/customizer-components/customizer-global-settings.php
  22. +207 −0 inc/customizer-components/customizer-header.php
  23. +71 −0 inc/customizer-components/customizer-hero-options.php
  24. +376 −0 inc/customizer-components/customizer-section-contact.php
  25. +182 −0 inc/customizer-components/customizer-section-featured-page.php
  26. +218 −0 inc/customizer-components/customizer-section-features.php
  27. +343 −0 inc/customizer-components/customizer-section-gallery.php
  28. +491 −0 inc/customizer-components/customizer-section-hero.php
  29. +199 −0 inc/customizer-components/customizer-section-news.php
  30. +190 −0 inc/customizer-components/customizer-section-portfolio.php
  31. +66 −0 inc/customizer-components/customizer-section-sections.php
  32. +215 −0 inc/customizer-components/customizer-section-services.php
  33. +132 −0 inc/customizer-components/customizer-section-slider.php
  34. +165 −0 inc/customizer-components/customizer-section-social.php
  35. +197 −0 inc/customizer-components/customizer-section-team.php
  36. +148 −0 inc/customizer-components/customizer-section-video-lightbox.php
  37. +46 −0 inc/customizer-components/customizer-site-identity.php
  38. +22 −0 inc/customizer-components/customizer-site-options.php
  39. +33 −725 inc/customizer-controls.php
  40. +362 −305 inc/customizer-selective-refresh.php
  41. +16 −11 inc/customizer-update-fields.php
  42. +368 −2,767 inc/customizer.php
  43. +190 −165 inc/dashboard.php
  44. +163 −142 inc/extras.php
  45. +899 −843 inc/template-tags.php
  46. +27 −25 index.php
  47. +14 −12 page.php
  48. +14 −13 search.php
  49. +140 −115 section-parts/section-contact.php
  50. +66 −60 section-parts/section-featuredpage.php
  51. +96 −68 section-parts/section-features.php
  52. +66 −51 section-parts/section-gallery.php
  53. +86 −48 section-parts/section-hero.php
  54. +74 −49 section-parts/section-news.php
  55. +72 −49 section-parts/section-portfolio.php
  56. +132 −111 section-parts/section-services.php
  57. +85 −63 section-parts/section-social.php
  58. +102 −72 section-parts/section-team.php
  59. +42 −41 section-parts/section-videolightbox.php
  60. +45 −32 section-parts/section-yourslider.php
  61. +2 −1 sidebar-page.php
  62. +2 −1 sidebar.php
  63. +12 −9 single-jetpack-portfolio.php
  64. +13 −11 single.php
  65. +1 −1 style.css
  66. +26 −26 template-frontpage.php
  67. +12 −10 template-fullwidth.php
  68. +12 −11 template-parts/content-list.php
  69. +1 −1 template-parts/content-none.php
  70. +6 −5 template-parts/content-page.php
  71. +5 −4 template-parts/content-single.php
  72. +18 −15 template-parts/content.php
  73. +16 −17 template-withsidebar.php
  74. +7 −0 vendor/autoload.php
  75. +479 −0 vendor/composer/ClassLoader.php
  76. +285 −0 vendor/composer/InstalledVersions.php
  77. +21 −0 vendor/composer/LICENSE
  78. +18 −0 vendor/composer/autoload_classmap.php
  79. +9 −0 vendor/composer/autoload_namespaces.php
  80. +10 −0 vendor/composer/autoload_psr4.php
  81. +55 −0 vendor/composer/autoload_real.php
  82. +44 −0 vendor/composer/autoload_static.php
  83. +5 −0 vendor/composer/installed.json
  84. +24 −0 vendor/composer/installed.php
  85. +4 −3 woocommerce.php
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
._*
.cache
.DS_Store
.editorconfig
.idea
.project
.settings
@@ -30,7 +31,15 @@ node_modules
.sass-cache

# Ignore project files
sftp-config.json
bin/
tests/
.ftppass
*.zip
src/node_modules/*
.phpcs.xml.dist
.travis.yml
sftp-config.json
phpcs.ruleset.xml
phpunit.xml.dist

vendor/*
!vendor/autoload.php
!vendor/composer/
29 changes: 16 additions & 13 deletions 404.php
Original file line number Diff line number Diff line change
@@ -4,10 +4,11 @@
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
* @package coletivo
* @package Coletivo
*/

get_header(); ?>
get_header();
?>
<div id="content" class="site-content">
<div id="content-inside" class="container no-sidebar">
<h1 class="fullheader-title">404</h1>
@@ -24,22 +25,24 @@

<?php the_widget( 'WP_Widget_Recent_Posts' ); ?>

<?php if ( coletivo_categorized_blog() ) : // Only show the widget if site has multiple categories. ?>
<?php if ( coletivo_categorized_blog() ) { // Only show the widget if site has multiple categories. ?>
<div class="widget widget_categories">
<h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', 'coletivo' ); ?></h2>
<ul>
<?php
wp_list_categories( array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 3,
) );
wp_list_categories(
array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 3,
)
);
?>
</ul>
</div><!-- .widget -->
<?php endif; ?>
<?php } ?>

<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>

@@ -51,5 +54,5 @@

</div><!--#content-inside -->
</div><!-- #content -->
<?php get_footer(); ?>

<?php get_footer(); ?>
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ for business, portfolio, digital agency, product showcase, freelancers and
everyone else who appreciate good design. Is a fork of the OnePress theme,
by Fame Themes.

* Contributors: redelivre, brasadesign, famethemes, congthien, kientrong, diegorojas, matheusgimenez, 2aces
* Contributors: [redelivre](https://github.com/redelivre), [brasadesign](https://profiles.wordpress.org/brasadesign/), [famethemes](https://profiles.wordpress.org/famethemes/), [congthien](https://profiles.wordpress.org/congthien/), [kientrong](https://profiles.wordpress.org/kientrong/), [diegorojas](https://profiles.wordpress.org/diegorojas/), [matheusgimenez](https://profiles.wordpress.org/matheusgimenez/), [2aces](https://profiles.wordpress.org/2aces/), [rodineicosta](https://profiles.wordpress.org/rodineicosta/)
* Tags: one-column, two-columns, left-sidebar, right-sidebar, fluid-layout, responsive-layout, custom-menu, featured-images, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, blue, light
* Tested up to: 5.2
* Stable tag: 1.7
@@ -16,7 +16,7 @@ by Fame Themes.

Coletivo is distributed under the terms of the GNU GPL

[![Join the chat at https://telegram.me/IdentidadeDigital](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/RedeLivreOrg)
<a href="http://www.gnu.org/licenses/gpl-2.0.html"><img src="https://img.shields.io/badge/License-GPL%20v2-orange.svg"></a> [![Join the chat at https://telegram.me/IdentidadeDigital](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/RedeLivreOrg)

# capturas
![Screenshot](./screenshot.png)
@@ -27,12 +27,12 @@ Coletivo is distributed under the terms of the GNU GPL
2. Click Upload and Choose File, then select the theme's .zip file. Click Install Now.
3. Click Activate to use your new theme right away.

## Frequently Asked Questions
## Frequently Asked Questions

### How to set up the blog page?
First create a page and give it a name ( Note this page will also be the URL of your blog, example "Blog", "News" ... ), at the right site - Template section select Blog Page and then Save. Now you can access your blog at http://yourdomain.com/blog ( or http://yourdomain.com/news )

### How to set up the one page menu like the demo?
### How to set up the one page menu like the demo?

There are a lot of sections available in these theme: Hero, Features, Your Slider, Featured Page, Services, Portfolio, Video Lightbox, Gallery, Team, News, Contact.
For each section, you will need to create a text link menu with anchor point to the ID of the section, like:
50 changes: 28 additions & 22 deletions archive.php
Original file line number Diff line number Diff line change
@@ -7,49 +7,55 @@
* @package coletivo
*/

get_header(); ?>
get_header();
?>

<div id="content" class="site-content">

<div class="page-header">
<div class="container">
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
<?php the_archive_description( '<div class="taxonomy-description">', '</div>' ); ?>
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</div><!-- container -->
</div><!-- page-header -->

<?php if ( function_exists( 'coletivo_breadcrumb' ) ) : ?>
<?php echo coletivo_breadcrumb(); ?>
<?php endif; ?>
<?php
if ( function_exists( 'coletivo_breadcrumb' ) ) {
echo wp_kses_post( coletivo_breadcrumb() );
}
?>

<div id="content-inside" class="container">
<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>
<?php
if ( have_posts() ) {

<?php while ( have_posts() ) : the_post(); ?>
while ( have_posts() ) {
the_post();

<?php
/*
* 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', 'list' );
?>
/*
* 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', 'list' );

<?php endwhile; ?>
}

<?php the_posts_navigation(); ?>
the_posts_navigation();

<?php else : ?>
} else {

<?php get_template_part( 'template-parts/content', 'none' ); ?>
get_template_part( 'template-parts/content', 'none' );

<?php endif; ?>
}
?>

</main><!-- #main -->
</div><!--#content-inside -->
</div><!-- #content -->

<?php get_footer(); ?>
<?php get_footer(); ?>
36 changes: 19 additions & 17 deletions comments.php
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package coletivo
* @package Coletivo
*/

/*
@@ -24,18 +24,18 @@

<?php // You can start editing here -- including this comment! ?>

<?php if ( have_comments() ) : ?>
<?php if ( have_comments() ) { ?>
<h3 class="comments-title">
<?php
printf( // WPCS: XSS OK.
esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'coletivo' ) ),
number_format_i18n( get_comments_number() ),
'<span>' . get_the_title() . '</span>'
printf(
esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'coletivo' ) ), // phpcs:ignore
wp_kses_post( number_format_i18n( get_comments_number() ) ),
'<span>' . esc_html( get_the_title() ) . '</span>'
);
?>
</h3>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?>
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'coletivo' ); ?></h2>
<div class="nav-links">
@@ -45,17 +45,19 @@

</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // Check for comment navigation. ?>
<?php } // Check for comment navigation. ?>

<ol class="comment-list">
<?php
wp_list_comments( array(
wp_list_comments(
array(
'callback' => 'coletivo_comment',
) );
)
);
?>
</ol><!-- .comment-list -->

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'coletivo' ); ?></h2>
<div class="nav-links">
@@ -65,16 +67,16 @@

</div><!-- .nav-links -->
</nav><!-- #comment-nav-below -->
<?php endif; // Check for comment navigation. ?>
<?php } // Check for comment navigation. ?>

<?php endif; // Check for have_comments(). ?>
<?php } // Check for have_comments(). ?>

<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) {
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'coletivo' ); ?></p>
<?php endif; ?>
<?php } ?>

<?php comment_form(); ?>

22 changes: 22 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "redelivre/coletivo",
"description": "Coletivo theme is an outstanding creative and flexible WordPress one page theme well suited for business, portfolio, digital agency, product showcase, freelancers and everyone else who appreciate good design.",
"homepage": "https://tema.coletivowp.com.br/",
"type": "wordpress-theme",
"license": "GPLv2",
"authors": [
{
"name": "Rede Livre"
},
{
"name": "Rodinei Costa",
"email": "rodineicosta@physistec.com.br",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"RedeLivre\\Coletivo\\": "inc/classes/"
}
}
}
18 changes: 18 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 31 additions & 30 deletions footer.php
Original file line number Diff line number Diff line change
@@ -6,38 +6,39 @@
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package coletivo
* @package Coletivo
*/

?>
<footer id="colophon" class="site-footer" role="contentinfo">
<?php $coletivo_btt_disable = get_theme_mod( 'coletivo_btt_disable' ); ?>
<div class="site-info">
<div class="container">
<?php if ( $coletivo_btt_disable != '1' ) : ?>
<div class="btt">
<a class="back-top-top" href="#page" title="<?php echo esc_html__('Back To Top', 'coletivo') ?>"><i class="fa fa-angle-double-up wow flash" data-wow-duration="2s"></i></a>
</div><!-- btt -->
<?php endif; ?>
<?php
/**
* Hooked: coletivo_footer_site_info
*
* @see coletivo_footer_site_info
*/
do_action( 'coletivo_footer_site_info' );
?>
</div><!-- container -->
</div><!-- .site-info -->
</footer><!-- #colophon -->
<?php
/**
* Hooked: coletivo_site_footer
*
* @see coletivo_site_footer
*/
do_action( 'coletivo_site_end' );
?>
<footer id="colophon" class="site-footer" role="contentinfo">
<?php $coletivo_btt_disable = get_theme_mod( 'coletivo_btt_disable' ); ?>
<div class="site-info">
<div class="container">
<?php if ( true !== $coletivo_btt_disable ) { ?>
<div class="btt">
<a class="back-top-top" href="#page" title="<?php echo esc_html__( 'Back To Top', 'coletivo' ); ?>"><i class="fa fa-angle-double-up wow flash" data-wow-duration="2s"></i></a>
</div><!-- btt -->
<?php } ?>

<?php
/**
* Hooked: coletivo_footer_site_info
*
* @see coletivo_footer_site_info
*/
do_action( 'coletivo_footer_site_info' );
?>
</div><!-- container -->
</div><!-- .site-info -->
</footer><!-- #colophon -->
<?php
/**
* Hooked: coletivo_site_footer
*
* @see coletivo_site_footer
*/
do_action( 'coletivo_site_end' );
?>
</div><!-- #page -->

<?php wp_footer(); ?>
289 changes: 165 additions & 124 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
<?php
/**
* coletivo functions and definitions.
* Coletivo functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package coletivo
* @package Coletivo
*/

if ( ! function_exists( 'coletivo_setup' ) ) :
defined( 'ABSPATH' ) || exit;

/**
* Current version number
*
* @var string
* @since 1.7
*/
const VERSION = '1.7';

/**
* Theme URI
*
* @var string
* @since 1.7
*/
const THEME_URI = 'https://tema.coletivowp.com.br';

/**
* Theme Wiki GitHub URI
*
* @var string
* @since 1.7
*/
const THEME_WIKI_GITHUB_URI = 'https://github.com/redelivre/coletivo/wiki/Inicial';

if ( ! function_exists( 'coletivo_setup' ) ) {
/**
* Sets up theme defaults and registers support for various WordPress features.
*
@@ -55,22 +81,27 @@ function coletivo_setup() {
/*
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'coletivo' ),
'secondary' => esc_html__( 'Page Menu', 'coletivo' ),
) );
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Menu', 'coletivo' ),
'secondary' => esc_html__( 'Page Menu', 'coletivo' ),
)
);

/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);

/*
* This theme styles the visual editor to resemble the theme style.
@@ -82,24 +113,27 @@ function coletivo_setup() {
*/
add_theme_support( 'woocommerce' );

/**
* Add theme Support custom logo
* @since WP 4.5
* @sin 1.2.1
*/
add_theme_support( 'custom-logo', array(
'height' => 36,
'width' => 160,
'flex-height' => true,
'flex-width' => true,
//'header-text' => array( 'site-title', 'site-description' ), //
) );
/**
* Add theme Support custom logo
*
* @since WP 4.5
* @since 1.2.1
*/
add_theme_support(
'custom-logo',
array(
'height' => 36,
'width' => 160,
'flex-height' => true,
'flex-width' => true,
)
);

// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );

}
endif;
}
add_action( 'after_setup_theme', 'coletivo_setup' );

/**
@@ -120,59 +154,60 @@ function coletivo_content_width() {
add_action( 'after_setup_theme', 'coletivo_content_width', 0 );

/**
* Add theme support for Portfolio Custom Post Type.
*/
add_action( 'after_setup_theme', 'slug_jetpack_portfolio_cpt' );
* Add theme support for Portfolio Custom Post Type.
*/
function slug_jetpack_portfolio_cpt() {
add_theme_support( 'jetpack-portfolio' );
}
add_action( 'after_setup_theme', 'slug_jetpack_portfolio_cpt' );

/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
add_action( 'widgets_init', 'coletivo_widgets_init' );
function coletivo_widgets_init() {
register_sidebar(

array(
'name' => esc_html__( 'Sidebar', 'coletivo' ),
'id' => 'sidebar-1',
'description' => esc_html__('Default sidebar for blog template', 'coletivo'),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
'name' => esc_html__( 'Sidebar', 'coletivo' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Default sidebar for blog template', 'coletivo' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);

register_sidebar(
array(
'name' => esc_html__( 'Page', 'coletivo' ),
'id' => 'sidebar-2',
'description' => esc_html__('Sidebar for template With Sidebar', 'coletivo'),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
'name' => esc_html__( 'Page', 'coletivo' ),
'id' => 'sidebar-2',
'description' => esc_html__( 'Sidebar for template With Sidebar', 'coletivo' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);

}
add_action( 'widgets_init', 'coletivo_widgets_init' );

/**
* Enqueue scripts and styles.
*/
function coletivo_scripts() {
// Check if a child theme or a plugin disable default fonts
// Check if a child theme or a plugin disable default fonts.
if ( true === apply_filters( 'coletivo_load_default_fonts', true ) ) {
wp_enqueue_style( 'coletivo-fonts', coletivo_fonts_url(), array(), null );
wp_enqueue_style( 'coletivo-fonts', coletivo_fonts_url(), array(), VERSION );
}
wp_enqueue_style( 'coletivo-animate', get_template_directory_uri() .'/assets/css/animate.min.css', array(), '1.0.0' );
wp_enqueue_style( 'coletivo-fa', get_template_directory_uri() .'/assets/css/font-awesome.min.css', array(), '4.4.0' );
wp_enqueue_style( 'coletivo-bootstrap', get_template_directory_uri() .'/assets/css/bootstrap.min.css', false, '4.0.0' );
wp_enqueue_style( 'coletivo-style', get_template_directory_uri().'/style.css' );
wp_enqueue_style( 'coletivo-animate', get_template_directory_uri() . '/assets/css/animate.min.css', array(), '1.0.0' );
wp_enqueue_style( 'coletivo-fa', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), '4.4.0' );
wp_enqueue_style( 'coletivo-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', false, '4.0.0' );
wp_enqueue_style( 'coletivo-style', get_template_directory_uri() . '/style.css', false, VERSION );
if ( is_child_theme() ) {
wp_enqueue_style( 'coletivo-style-child', get_stylesheet_directory_uri() .'/style.css' );
wp_enqueue_style( 'coletivo-style-child', get_stylesheet_directory_uri() . '/style.css', false, VERSION );
}
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'coletivo-js-plugins', get_template_directory_uri() . '/assets/js/plugins.js', array(), '1.0.0', true );
@@ -187,108 +222,114 @@ function coletivo_scripts() {
'coletivo_disable_animation' => get_theme_mod( 'coletivo_animation_disable' ),
'coletivo_disable_sticky_header' => get_theme_mod( 'coletivo_sticky_header_disable' ),
'coletivo_vertical_align_menu' => get_theme_mod( 'coletivo_vertical_align_menu' ),
'hero_animation' => get_theme_mod( 'coletivo_hero_option_animation', 'flipInX' ),
'hero_speed' => intval( get_theme_mod( 'coletivo_hero_option_speed', 5000 ) ),
'hero_animation' => get_theme_mod( 'coletivo_hero_option_animation', 'flipInX' ),
'hero_speed' => intval( get_theme_mod( 'coletivo_hero_option_speed', 5000 ) ),
);
wp_localize_script( 'jquery', 'coletivo_js_settings', $coletivo_js_settings );

// Load gallery scripts
$galley_disable = get_theme_mod( 'coletivo_gallery_disable' ) == 1 ? true : false;
if ( ! $galley_disable || is_customize_preview() ) {
$coletivo_js_settings['gallery_enable'] = 1;
$display = get_theme_mod( 'coletivo_gallery_display', 'grid' );
if ( ! is_customize_preview() ) {
switch ( $display ) {
case 'masonry':
wp_enqueue_script('coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js');
break;
case 'justified':
wp_enqueue_script('coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js');
break;
case 'slider':
case 'carousel':
wp_enqueue_script('coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js');
break;
default:
break;
}
} else {
wp_enqueue_script('coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js');
wp_enqueue_script('coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js');
wp_enqueue_script('coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js');
}

}

wp_enqueue_style( 'coletivo-gallery-lightgallery', get_template_directory_uri().'/assets/css/lightgallery.css' );
wp_enqueue_script( 'coletivo-theme', get_template_directory_uri() . '/assets/js/theme.js' );
// Load gallery scripts.
$galley_disable = 1 === get_theme_mod( 'coletivo_gallery_disable' ) ? true : false;
if ( ! $galley_disable || is_customize_preview() ) {

$coletivo_js_settings['gallery_enable'] = 1;

$display = get_theme_mod( 'coletivo_gallery_display', 'grid' );

if ( ! is_customize_preview() ) {
switch ( $display ) {
case 'masonry':
wp_enqueue_script( 'coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), VERSION, true );
break;
case 'justified':
wp_enqueue_script( 'coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js', array(), VERSION, true );
break;
case 'slider':
case 'carousel':
wp_enqueue_script( 'coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array(), VERSION, true );
break;
default:
break;
}
} else {
wp_enqueue_script( 'coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), VERSION, true );
wp_enqueue_script( 'coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js', array(), VERSION, true );
wp_enqueue_script( 'coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array(), VERSION, true );
}
}

wp_enqueue_style( 'coletivo-gallery-lightgallery', get_template_directory_uri() . '/assets/css/lightgallery.css', false, VERSION );
wp_enqueue_script( 'coletivo-theme', get_template_directory_uri() . '/assets/js/theme.js', array(), VERSION, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

if ( is_front_page() && is_page_template( 'template-frontpage.php' ) ) {
if ( get_theme_mod( 'coletivo_header_scroll_logo' ) ) {
$coletivo_js_settings['is_home'] = 1;
}
}
if ( is_front_page() && is_page_template( 'template-frontpage.php' ) ) {
if ( get_theme_mod( 'coletivo_header_scroll_logo' ) ) {
$coletivo_js_settings['is_home'] = 1;
}
}
wp_localize_script( 'jquery', 'coletivo_js_settings', $coletivo_js_settings );

}
add_action( 'wp_enqueue_scripts', 'coletivo_scripts' );


if ( ! function_exists( 'coletivo_fonts_url' ) ) :
if ( ! function_exists( 'coletivo_fonts_url' ) ) {
/**
* Register default Google fonts
*/
function coletivo_fonts_url() {
$fonts_url = '';
$fonts_url = '';

/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
$open_sans = _x( 'on', 'Open Sans font: on or off', 'coletivo' );
/*
* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
$open_sans = _x( 'on', 'Open Sans font: on or off', 'coletivo' );

/* Translators: If there are characters in your language that are not
* supported by Raleway, translate this to 'off'. Do not translate
* into your own language.
*/
$raleway = _x( 'on', 'Raleway font: on or off', 'coletivo' );
/*
* Translators: If there are characters in your language that are not
* supported by Raleway, translate this to 'off'. Do not translate
* into your own language.
*/
$raleway = _x( 'on', 'Raleway font: on or off', 'coletivo' );

if ( 'off' !== $raleway || 'off' !== $open_sans ) {
$font_families = array();
if ( 'off' !== $raleway || 'off' !== $open_sans ) {
$font_families = array();

if ( 'off' !== $raleway ) {
$font_families[] = 'Raleway:400,500,600,700,300,100,800,900';
}
if ( 'off' !== $raleway ) {
$font_families[] = 'Raleway:400,500,600,700,300,100,800,900';
}

if ( 'off' !== $open_sans ) {
$font_families[] = 'Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic';
}
if ( 'off' !== $open_sans ) {
$font_families[] = 'Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic';
}

$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$query_args = array(
'family' => rawurlencode( implode( '|', $font_families ) ),
'subset' => rawurlencode( 'latin,latin-ext' ),
);

$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}

return esc_url_raw( $fonts_url );
return esc_url_raw( $fonts_url );
}
endif;
}

if ( ! function_exists( 'coletivo_admin_scripts' ) ) :
if ( ! function_exists( 'coletivo_admin_scripts' ) ) {
/**
* Enqueue scripts for admin page only: Theme info page
*
* @param string $hook The hook.
*/
function coletivo_admin_scripts( $hook ) {
if ( $hook === 'widgets.php' || $hook === 'appearance_page_ft_coletivo' ) {
wp_enqueue_style( 'coletivo-admin-css', get_template_directory_uri() . '/assets/css/admin.css' );
if ( 'widgets.php' === $hook || 'appearance_page_ft_coletivo' === $hook ) {
wp_enqueue_style( 'coletivo-admin-css', get_template_directory_uri() . '/assets/css/admin.css', false, VERSION );
}
}
endif;
}
add_action( 'admin_enqueue_scripts', 'coletivo_admin_scripts' );

/**
22 changes: 12 additions & 10 deletions header.php
Original file line number Diff line number Diff line change
@@ -6,10 +6,11 @@
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package coletivo
* @package Coletivo
*/

?><!DOCTYPE html>
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
@@ -20,14 +21,15 @@
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php do_action( 'coletivo_before_site_star' ); ?>
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'coletivo' ); ?></a>
<?php
/**
* Hooked: coletivo_site_header
*
* @see coletivo_site_header
*/
do_action( 'coletivo_site_start' );
?>
<?php
/**
* Hooked: coletivo_site_header
*
* @see coletivo_site_header
*/
do_action( 'coletivo_site_start' );
?>
64 changes: 32 additions & 32 deletions home.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,10 @@
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#front-page-display
*
* @package coletivo
* @package Coletivo
*/
$blog_style = get_theme_mod( 'coletivo_blog_page_style', 'grid' );

$blog_style = get_theme_mod( 'coletivo_blog_page_style', 'grid' );
$container_class = 'container';
if ( 'list' === $blog_style ) {
$container_class = 'container right-sidebar';
@@ -23,55 +24,54 @@
<h1 class="page-title"><?php single_post_title(); ?></h1>
</div>
</div><!-- container -->

<?php if ( function_exists( 'coletivo_breadcrumb' ) ) : ?>
<?php echo coletivo_breadcrumb(); ?>
<?php endif; ?>

<div id="content-inside" class="<?php echo esc_attr( $container_class );?>">
<?php if ( function_exists( 'coletivo_breadcrumb' ) ) { ?>
<?php echo wp_kses_post( coletivo_breadcrumb() ); ?>
<?php } ?>

<div id="content-inside" class="<?php echo esc_attr( $container_class ); ?>">
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>
<?php
if ( have_posts() ) {
if ( is_home() && ! is_front_page() ) {
?>
<header>
<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
</header>
<?php endif; ?>

<?php
/* Start the Loop */
while ( have_posts() ) : the_post(); ?>
<?php
}

/*
* 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_format() );
?>
<?php endwhile; ?>

<?php the_posts_navigation(); ?>
/* Start the Loop */
while ( have_posts() ) {
the_post();

<?php else : ?>
/*
* 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_format() );
}

<?php get_template_part( 'template-parts/content', 'none' ); ?>
the_posts_navigation();

<?php endif; ?>
} else {
get_template_part( 'template-parts/content', 'none' );
}
?>

</main><!-- #main -->
</section><!-- #primary -->

<?php
if ( 'list' === $blog_style ) {
get_sidebar();
}
if ( 'list' === $blog_style ) {
get_sidebar();
}
?>

</div><!--#content-inside -->
</div><!-- #content -->

<?php get_footer(); ?>
<?php get_footer(); ?>
105 changes: 105 additions & 0 deletions inc/classes/AlphaColorControl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php
/**
* Coletivo Alpha Color Picker Customizer Control
*
* @package Coletivo/Classes
*/

declare(strict_types = 1);

namespace RedeLivre\Coletivo;

use WP_Customize_Control;

// Prevents dipostt access.
defined( 'ABSPATH' ) || exit;

/**
* Alpha Color Picker Customizer Control
*
* This control adds a second slider for opacity to the stock WordPress color picker,
* and it includes logic to seamlessly convert between RGBa and Hex color values as
* opacity is added to or removed from a color.
*
* This Alpha Color Picker is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this Alpha Color Picker. If not, see <http://www.gnu.org/licenses/>.
*/
class AlphaColorControl extends WP_Customize_Control {

/**
* Official control name.
*
* @var string
*/
public $type = 'alpha-color';

/**
* Add support for palettes to be passed in.
*
* Supported palette values are true, false, or an array of RGBa and Hex colors.
*
* @var bool|array
*/
public $palette;

/**
* Add support for showing the opacity value on the slider handle.
*
* @var int
*/
public $show_opacity;

/**
* Enqueue scripts and styles.
*
* Ideally these would get registered and given proper paths before this control object
* gets initialized, then we could simply enqueue them here, but for completeness as a
* stand alone class we'll register and enqueue them here.
*/
public function enqueue() {

}

/**
* Render the control.
*/
public function render_content() {

// Process the palette.
if ( is_array( $this->palette ) ) {
$palette = implode( '|', $this->palette );
} else {
// Default to true.
$palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true';
}

// Support passing show_opacity as string or boolean. Default to true.
$show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true';

// Begin the output.
?>
<label>
<?php
// Output the label and description if they were passed in.
if ( isset( $this->label ) && '' !== $this->label ) {
echo '<span class="customize-control-title">' . esc_html( sanitize_text_field( $this->label ) ) . '</span>';
}
if ( isset( $this->description ) && '' !== $this->description ) {
echo '<span class="description customize-control-description">' . esc_html( sanitize_text_field( $this->description ) ) . '</span>';
}
?>
<input class="alpha-color-control" type="text" data-show-opacity="<?php echo esc_attr( $show_opacity ); ?>" data-palette="<?php echo esc_attr( $palette ); ?>" data-default-color="<?php echo esc_attr( $this->settings['default']->default ); ?>" <?php $this->link(); ?> />
</label>
<?php
}
}
466 changes: 466 additions & 0 deletions inc/classes/CustomizeRepeatableControl.php

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions inc/classes/EditorCustomControl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* Coletivo Editor Custom Control Class
*
* @package Coletivo/Classes
*/

declare(strict_types = 1);

namespace RedeLivre\Coletivo;

use WP_Customize_Control;

// Prevents dipostt access.
defined( 'ABSPATH' ) || exit;

/**
* Editor Custom Control Class
*/
class EditorCustomControl extends WP_Customize_Control {
/**
* The type of customize control being rendered.
*
* @since 1.0.0
* @access public
* @var string
*/
public $type = 'wp_editor';

/**
* Add support for palettes to be passed in.
*
* Supported palette values are true, false, or an array of RGBa and Hex colors.
*
* @var string
*/
public $mod;

/**
* Render the description and title for the sections
*/
public function render_content() {
$this->mod = strtolower( (string) $this->mod );
if ( ! 'html' === $this->mod ) {
$this->mod = 'tmce';
}
?>
<div class="wp-js-editor">
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
</label>
<textarea class="wp-js-editor-textarea large-text" data-editor-mod="<?php echo esc_attr( $this->mod ); ?>" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>
<p class="description"><?php echo esc_html( $this->description ); ?></p>
</div>
<?php
}
}
65 changes: 65 additions & 0 deletions inc/classes/EditorScripts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/**
* Coletivo Editor Script Class
*
* @package Coletivo/Classes
*/

declare(strict_types = 1);

namespace RedeLivre\Coletivo;

// Prevents dipostt access.
defined( 'ABSPATH' ) || exit;

/**
* Editor Script Class
*/
class EditorScripts {

/**
* Init function
*
* @return void
*/
public static function init() {
add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue' ), 95 );
}

/**
* Enqueue scripts/styles.
*
* @since 1.0.0
* @access public
*
* @return void
*/
public static function enqueue() {

if ( ! class_exists( '_WP_Editors' ) ) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}

add_action( 'customize_controls_print_footer_scripts', array( __CLASS__, 'enqueue_editor' ), 2 );
add_action( 'customize_controls_print_footer_scripts', array( '_WP_Editors', 'editor_js' ), 50 );
add_action( 'customize_controls_print_footer_scripts', array( '_WP_Editors', 'enqueue_scripts' ), 1 );
}

/**
* Enqueue Editor
*
* @access public
*
* @return void
*/
public static function enqueue_editor() {
if ( ! isset( $GLOBALS['__wp_mce_editor__'] ) || ! $GLOBALS['__wp_mce_editor__'] ) {
$GLOBALS['__wp_mce_editor__'] = true;
?>
<script id="_wp-mce-editor-tpl" type="text/html">
<?php wp_editor( '', '__wp_mce_editor__' ); ?>
</script>
<?php
}
}
}
61 changes: 61 additions & 0 deletions inc/classes/MiscControl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Coletivo Misc Control Class
*
* @package Coletivo/Classes
*/

declare(strict_types = 1);

namespace RedeLivre\Coletivo;

use WP_Customize_Control;

// Prevents dipostt access.
defined( 'ABSPATH' ) || exit;

/**
* Misc Control Class
*/
class MiscControl extends WP_Customize_Control {

/**
* Settings
*
* @var string
*/
public $settings = 'blogname';

/**
* Description
*
* @var string
*/
public $description = '';

/**
* Group
*
* @var string
*/
public $group = '';

/**
* Render the description and title for the sections
*/
public function render_content() {
switch ( $this->type ) {
case 'heading':
echo '<span class="customize-control-title">' . esc_html( $this->title ) . '</span>';
break;

case 'custom_message':
echo '<p class="description">' . esc_html( $this->description ) . '</p>';
break;

case 'hr':
echo '<hr />';
break;
}
}
}
182 changes: 102 additions & 80 deletions inc/class-metabox.php → inc/classes/Odin_Metabox.php

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions inc/classes/TextareaCustomControl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* Coletivo Text Area Custom Control Class
*
* @package Coletivo/Classes
*/

declare(strict_types = 1);

namespace RedeLivre\Coletivo;

use WP_Customize_Control;

// Prevents dipostt access.
defined( 'ABSPATH' ) || exit;

/**
* Text Area Custom Control Class
*/
class TextareaCustomControl extends WP_Customize_Control {
/**
* Render the description and title for the sections
*/
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<textarea class="large-text" cols="20" rows="5" <?php $this->link(); ?>>
<?php echo esc_textarea( $this->value() ); ?>
</textarea>
<p class="description"><?php echo esc_html( $this->description ); ?></p>
</label>
<?php
}
}
44 changes: 44 additions & 0 deletions inc/customizer-components/customizer-blog-page-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Customizer Page Settings
*
* @package Coletivo
*/

defined( 'ABSPATH' ) || exit;

/**
* Blog Page Settings
*/
$wp_customize->add_section(
'coletivo_blog_page',
array(
'priority' => 15,
'title' => esc_html__( 'Blog Settings', 'coletivo' ),
'description' => '',
'panel' => 'theme_options',
)
);

$wp_customize->add_setting(
'coletivo_blog_page_style',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_blog_page_style',
array(
'label' => esc_html__( 'Blog style', 'coletivo' ),
'section' => 'coletivo_blog_page',
'description' => '',
'type' => 'radio',
'default' => 'grid',
'choices' => array(
'grid' => __( 'Grid', 'coletivo' ),
'list' => __( 'List', 'coletivo' ),
),
)
);
104 changes: 104 additions & 0 deletions inc/customizer-components/customizer-footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php
/**
* Customizer Footer
*
* @package Coletivo
*/

defined( 'ABSPATH' ) || exit;

/**
* Footer
*/
$wp_customize->add_section(
'coletivo_footer_settings',
array(
'priority' => 10,
'title' => esc_html__( 'Footer', 'coletivo' ),
'description' => '',
'panel' => 'theme_options',
)
);

// Footer custom Text.
$wp_customize->add_setting(
'coletivo_footer_text',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Few Rights Reserved', 'coletivo' ),
'transport' => 'refresh',
)
);

$wp_customize->add_control(
'coletivo_footer_text',
array(
'type' => 'text',
'label' => esc_html__( 'Footer Text', 'coletivo' ),
'section' => 'coletivo_footer_settings',
'description' => '',
)
);

// Footer custom Link.
$wp_customize->add_setting(
'coletivo_footer_text_link',
array(
'sanitize_callback' => 'esc_url',
'default' => esc_url( home_url( '/' ) ),
'transport' => 'refresh',
)
);

$wp_customize->add_control(
'coletivo_footer_text_link',
array(
'type' => 'text',
'label' => esc_html__( 'Footer Link', 'coletivo' ),
'section' => 'coletivo_footer_settings',
'description' => '',
)
);

// Footer Info BG Color.
$wp_customize->add_setting(
'coletivo_footer_info_bg',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
'transport' => 'postMessage',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_footer_info_bg',
array(
'label' => esc_html__( 'Footer Info Background', 'coletivo' ),
'section' => 'coletivo_footer_settings',
'description' => '',
)
)
);

// Disable Back to top.
$wp_customize->add_setting(
'coletivo_btt_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
'transport' => 'postMessage',
)
);

$wp_customize->add_control(
'coletivo_btt_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide footer back to top?', 'coletivo' ),
'section' => 'coletivo_footer_settings',
'description' => esc_html__( 'Check this box to hide footer back to top button.', 'coletivo' ),
)
);
83 changes: 83 additions & 0 deletions inc/customizer-components/customizer-global-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/**
* Customizer Global Settings
*
* @package Coletivo
*/

defined( 'ABSPATH' ) || exit;

/**
* Global Settings
*/
$wp_customize->add_section(
'coletivo_global_settings',
array(
'priority' => 1,
'title' => esc_html__( 'Global', 'coletivo' ),
'description' => '',
'panel' => 'theme_options',
)
);

// Primary Color.
$wp_customize->add_setting(
'coletivo_primary_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '#03c4eb',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_primary_color',
array(
'label' => esc_html__( 'Primary Color', 'coletivo' ),
'section' => 'coletivo_global_settings',
'description' => '',
'priority' => 1,
)
)
);

// Disable Animation.
$wp_customize->add_setting(
'coletivo_animation_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_animation_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Disable animation effect?', 'coletivo' ),
'section' => 'coletivo_global_settings',
'description' => esc_html__( 'Check this box to disable all element animation when scroll.', 'coletivo' ),
)
);

// Header Transparent.
$wp_customize->add_setting(
'coletivo_header_transparent',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
'active_callback' => 'coletivo_showon_frontpage',
)
);

$wp_customize->add_control(
'coletivo_header_transparent',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Header Transparent', 'coletivo' ),
'section' => 'coletivo_global_settings',
'description' => esc_html__( 'Apply for front page template only.', 'coletivo' ),
)
);
207 changes: 207 additions & 0 deletions inc/customizer-components/customizer-header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
<?php
/**
* Customizer Header
*
* @package Coletivo
*/

defined( 'ABSPATH' ) || exit;

/**
* Header
*/
$wp_customize->add_section(
'coletivo_header_settings',
array(
'priority' => 5,
'title' => esc_html__( 'Header', 'coletivo' ),
'description' => '',
'panel' => 'theme_options',
)
);

// Hidden field to reorder home sections.
$wp_customize->add_setting(
'coletivo_sections_order',
array(
'default' => apply_filters( 'coletivo_sections_order_default_value', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ),
)
);

$wp_customize->add_control(
'coletivo_sections_order',
array(
'type' => 'hidden',
'section' => 'coletivo_header_settings',
)
);

// Header BG Color.
$wp_customize->add_setting(
'coletivo_header_bg_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_header_bg_color',
array(
'label' => esc_html__( 'Background Color', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => '',
)
)
);

// Site Title Color.
$wp_customize->add_setting(
'coletivo_logo_text_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_logo_text_color',
array(
'label' => esc_html__( 'Site Title Color', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => esc_html__( 'Only set if you don\'t use an image logo.', 'coletivo' ),
)
)
);

// Header Menu Color.
$wp_customize->add_setting(
'coletivo_menu_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_menu_color',
array(
'label' => esc_html__( 'Menu Link Color', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => '',
)
)
);

// Header Menu Hover Color.
$wp_customize->add_setting(
'coletivo_menu_hover_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_menu_hover_color',
array(
'label' => esc_html__( 'Menu Link Hover/Active Color', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => '',
)
)
);

// Header Menu Hover BG Color.
$wp_customize->add_setting(
'coletivo_menu_hover_bg_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_menu_hover_bg_color',
array(
'label' => esc_html__( 'Menu Link Hover/Active BG Color', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => '',
)
)
);

// Reponsive Mobile button color.
$wp_customize->add_setting(
'coletivo_menu_toggle_button_color',
array(
'sanitize_callback' => 'sanitize_hex_color_no_hash',
'sanitize_js_callback' => 'maybe_hash_hex_color',
'default' => '',
)
);

$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'coletivo_menu_toggle_button_color',
array(
'label' => esc_html__( 'Responsive Menu Button Color', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => '',
)
)
);

// Vertical align menu.
$wp_customize->add_setting(
'coletivo_vertical_align_menu',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_vertical_align_menu',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Center vertical align for menu', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => esc_html__( 'If you use logo and your logo is too tall, check this box to auto vertical align menu.', 'coletivo' ),
)
);

// Disable Sticky Header.
$wp_customize->add_setting(
'coletivo_sticky_header_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_sticky_header_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Disable Sticky Header?', 'coletivo' ),
'section' => 'coletivo_header_settings',
'description' => esc_html__( 'Check this box to disable sticky header when scroll.', 'coletivo' ),
)
);
71 changes: 71 additions & 0 deletions inc/customizer-components/customizer-hero-options.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/**
* Customizer Hero Options
*
* @package Coletivo
*/

defined( 'ABSPATH' ) || exit;

/**
* Hero Options
*/
$wp_customize->add_section(
'coletivo_hero_options',
array(
'title' => __( 'Hero Options', 'coletivo' ),
'panel' => 'theme_options',
'priority' => 20,
)
);

$wp_customize->add_setting(
'coletivo_hero_option_animation',
array(
'default' => 'flipInX',
'sanitize_callback' => 'sanitize_text_field',
)
);

/**
* Animate CSS
*
* @see https://github.com/daneden/animate.css
*/
$animations_css = 'bounce flash pulse rubberBand shake headShake swing tada wobble jello bounceIn bounceInDown bounceInLeft bounceInRight bounceInUp bounceOut bounceOutDown bounceOutLeft bounceOutRight bounceOutUp fadeIn fadeInDown fadeInDownBig fadeInLeft fadeInLeftBig fadeInRight fadeInRightBig fadeInUp fadeInUpBig fadeOut fadeOutDown fadeOutDownBig fadeOutLeft fadeOutLeftBig fadeOutRight fadeOutRightBig fadeOutUp fadeOutUpBig flipInX flipInY flipOutX flipOutY lightSpeedIn lightSpeedOut rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight hinge rollIn rollOut zoomIn zoomInDown zoomInLeft zoomInRight zoomInUp zoomOut zoomOutDown zoomOutLeft zoomOutRight zoomOutUp slideInDown slideInLeft slideInRight slideInUp slideOutDown slideOutLeft slideOutRight slideOutUp';
$animations_css = explode( ' ', $animations_css );
$animations = array();

foreach ( $animations_css as $v ) {
$v = trim( $v );
if ( $v ) {
$animations[ $v ] = $v;
}
}

$wp_customize->add_control(
'coletivo_hero_option_animation',
array(
'label' => __( 'Text animation', 'coletivo' ),
'section' => 'coletivo_hero_options',
'type' => 'select',
'choices' => $animations,
)
);

$wp_customize->add_setting(
'coletivo_hero_option_speed',
array(
'default' => '5000',
'sanitize_callback' => 'sanitize_text_field',
)
);

$wp_customize->add_control(
'coletivo_hero_option_speed',
array(
'label' => __( 'Speed', 'coletivo' ),
'description' => esc_html__( 'The delay between the changing of each phrase in milliseconds.', 'coletivo' ),
'section' => 'coletivo_hero_options',
)
);
376 changes: 376 additions & 0 deletions inc/customizer-components/customizer-section-contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,376 @@
<?php
/**
* Customizer Section Contact
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: Contact
*/
$wp_customize->add_panel(
'coletivo_contact',
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_contact' ),
'title' => esc_html__( 'Section: Contact', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_showon_frontpage',
)
);

$wp_customize->add_section(
'coletivo_contact_settings',
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_contact',
)
);

// Show Content.
$wp_customize->add_setting(
'coletivo_contact_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide this section?', 'coletivo' ),
'section' => 'coletivo_contact_settings',
'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ),
)
);

// Show Form.
$wp_customize->add_setting(
'coletivo_contact_cf7_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_cf7_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide contact form completely.', 'coletivo' ),
'section' => 'coletivo_contact_settings',
'description' => esc_html__( 'Check this box to hide contact form.', 'coletivo' ),
)
);

// Section ID.
$wp_customize->add_setting(
'coletivo_contact_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__( 'contact', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_contact_id',
array(
'label' => esc_html__( 'Section ID:', 'coletivo' ),
'section' => 'coletivo_contact_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ),
)
);

// Title.
$wp_customize->add_setting(
'coletivo_contact_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Get in touch', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_contact_title',
array(
'label' => esc_html__( 'Section Title', 'coletivo' ),
'section' => 'coletivo_contact_settings',
'description' => '',
)
);

// Sub Title.
$wp_customize->add_setting(
'coletivo_contact_subtitle',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Section subtitle', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_contact_subtitle',
array(
'label' => esc_html__( 'Section Subtitle', 'coletivo' ),
'section' => 'coletivo_contact_settings',
'description' => '',
)
);

// Description.
$wp_customize->add_setting(
'coletivo_contact_desc',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
new EditorCustomControl(
$wp_customize,
'coletivo_contact_desc',
array(
'label' => esc_html__( 'Section Description', 'coletivo' ),
'section' => 'coletivo_contact_settings',
'description' => '',
)
)
);

$wp_customize->add_section(
'coletivo_contact_content',
array(
'priority' => 6,
'title' => esc_html__( 'Section Content', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_contact',
)
);

// Contact form guide.
$wp_customize->add_setting(
'coletivo_contact_cf7_guide',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
)
);

$wp_customize->add_control(
new MiscControl(
$wp_customize,
'coletivo_contact_cf7_guide',
array(
'section' => 'coletivo_contact_content',
'type' => 'custom_message',
'description' => __( 'In order to display a contact form install a plugin and then copy the shortcode and paste it here, the shortcode will be like this <code>[contact-form][contact-field...][/contact-form]</code>', 'coletivo' ),
)
)
);

// Contact Form Shortcode.
$wp_customize->add_setting(
'coletivo_contact_cf7',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_cf7',
array(
'label' => esc_html__( 'Contact Form Shortcode', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
);

// hr.
$wp_customize->add_setting(
'coletivo_contact_text_hr',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
)
);

$wp_customize->add_control(
new MiscControl(
$wp_customize,
'coletivo_contact_text_hr',
array(
'section' => 'coletivo_contact_content',
'type' => 'hr',
)
)
);

// Contact Text.
$wp_customize->add_setting(
'coletivo_contact_address_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_address_title',
array(
'label' => esc_html__( 'Contact Box Title', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
);

$wp_customize->add_setting(
'coletivo_contact_text',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
new EditorCustomControl(
$wp_customize,
'coletivo_contact_text',
array(
'label' => esc_html__( 'Contact Text', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
)
);

// Address Box.
// Contact Address.
$wp_customize->add_setting(
'coletivo_contact_address',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_address',
array(
'label' => esc_html__( 'Address', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
);

// Contact Phone.
$wp_customize->add_setting(
'coletivo_contact_phone',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_phone',
array(
'label' => esc_html__( 'Phone', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
);

// Contact WhatsApp.
$wp_customize->add_setting(
'coletivo_contact_whats',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_whats',
array(
'label' => esc_html__( 'What´s App', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
);

// Contact Email.
$wp_customize->add_setting(
'coletivo_contact_email',
array(
'sanitize_callback' => 'sanitize_email',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_email',
array(
'label' => esc_html__( 'Email', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => '',
)
);

// Contact Social Networks.
$wp_customize->add_setting(
'coletivo_contact_fb',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_fb',
array(
'label' => esc_html__( 'Facebook', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => esc_html__( 'Enter the name of the page url after the "/" (example of url https://www.facebook.com/facebook, just put facebook)', 'coletivo' ),
)
);

$wp_customize->add_setting(
'coletivo_contact_instagram',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_instagram',
array(
'label' => esc_html__( 'Instagram', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => esc_html__( 'Enter your Instagram username', 'coletivo' ),
)
);

$wp_customize->add_setting(
'coletivo_contact_twitter',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_contact_twitter',
array(
'label' => esc_html__( 'Twitter', 'coletivo' ),
'section' => 'coletivo_contact_content',
'description' => esc_html__( 'Enter your Twitter username', 'coletivo' ),
)
);
182 changes: 182 additions & 0 deletions inc/customizer-components/customizer-section-featured-page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<?php
/**
* Customizer Section Featured Page
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: Featured Page
*/
$wp_customize->add_panel(
'coletivo_featuredpage',
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_featuredpage' ),
'title' => esc_html__( 'Section: Page Featured', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_showon_frontpage',
)
);

$wp_customize->add_section(
'coletivo_featuredpage_settings',
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_featuredpage',
)
);

// Show Content.
$wp_customize->add_setting(
'coletivo_featuredpage_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_featuredpage_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide this section?', 'coletivo' ),
'section' => 'coletivo_featuredpage_settings',
'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ),
)
);

// Title.
$wp_customize->add_setting(
'coletivo_featuredpage_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_featuredpage_title',
array(
'label' => esc_html__( 'Title section in customizer', 'coletivo' ),
'section' => 'coletivo_featuredpage_settings',
'description' => esc_html__( 'This title is only showed in customizer', 'coletivo' ),
)
);

// Section ID.
$wp_customize->add_setting(
'coletivo_featuredpage_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__( 'featuredpage', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_featuredpage_id',
array(
'label' => esc_html__( 'Section ID:', 'coletivo' ),
'section' => 'coletivo_featuredpage_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ),
)
);

$wp_customize->add_section(
'coletivo_featuredpage_content',
array(
'priority' => 6,
'title' => esc_html__( 'Section Content', 'coletivo' ),
'panel' => 'coletivo_featuredpage',
)
);

// Select Page.
$wp_customize->add_setting(
'coletivo_featuredpage_content',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);

$wp_customize->add_control(
'coletivo_featuredpage_content',
array(
'label' => esc_html__( 'Featured Page', 'coletivo' ),
'section' => 'coletivo_featuredpage_content',
'description' => esc_html__( 'You need to select a Featured Image for a background in full size.', 'coletivo' ),
'type' => 'select',
'choices' => $option_pages,
'fields' => array(
'options' => $option_pages,
),
)
);

// Featured page content source.
$wp_customize->add_setting(
'coletivo_featuredpage_content_source',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 'content',
)
);

$wp_customize->add_control(
'coletivo_featuredpage_content_source',
array(
'label' => esc_html__( 'Content source', 'coletivo' ),
'section' => 'coletivo_featuredpage_content',
'type' => 'select',
'choices' => array(
'content' => esc_html__( 'Full Page Content', 'coletivo' ),
'excerpt' => esc_html__( 'Page Excerpt', 'coletivo' ),
),
)
);

// More Button.
$wp_customize->add_setting(
'coletivo_featuredpage_more_text',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Discover', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_featuredpage_more_text',
array(
'label' => esc_html__( 'Featured Page Button Text', 'coletivo' ),
'section' => 'coletivo_featuredpage_content',
'description' => '',
)
);

// Overlay color.
$wp_customize->add_setting(
'coletivo_featuredpage_overlay_color',
array(
'sanitize_callback' => 'coletivo_sanitize_color_alpha',
'default' => 'rgba(0,0,0,.3)',
'transport' => 'refresh', // refresh or postMessage.
)
);

$wp_customize->add_control(
new AlphaColorControl(
$wp_customize,
'coletivo_featuredpage_overlay_color',
array(
'label' => esc_html__( 'Background Overlay Color', 'coletivo' ),
'section' => 'coletivo_featuredpage_content',
'priority' => 30,
)
)
);
218 changes: 218 additions & 0 deletions inc/customizer-components/customizer-section-features.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
<?php
/**
* Customizer Section Features
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: Features
*/
$wp_customize->add_panel(
'coletivo_features',
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_features' ),
'title' => esc_html__( 'Section: Features', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_showon_frontpage',
)
);

$wp_customize->add_section(
'coletivo_features_settings',
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_features',
)
);

// Show Content.
$wp_customize->add_setting(
'coletivo_features_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_features_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide this section?', 'coletivo' ),
'section' => 'coletivo_features_settings',
'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ),
)
);

// Section ID.
$wp_customize->add_setting(
'coletivo_features_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__( 'features', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_features_id',
array(
'label' => esc_html__( 'Section ID:', 'coletivo' ),
'section' => 'coletivo_features_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ),
)
);

// Title.
$wp_customize->add_setting(
'coletivo_features_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Features', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_features_title',
array(
'label' => esc_html__( 'Section Title', 'coletivo' ),
'section' => 'coletivo_features_settings',
'description' => '',
)
);

// Sub Title.
$wp_customize->add_setting(
'coletivo_features_subtitle',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Section subtitle', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_features_subtitle',
array(
'label' => esc_html__( 'Section Subtitle', 'coletivo' ),
'section' => 'coletivo_features_settings',
'description' => '',
)
);

// Description.
$wp_customize->add_setting(
'coletivo_features_desc',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
new EditorCustomControl(
$wp_customize,
'coletivo_features_desc',
array(
'label' => esc_html__( 'Section Description', 'coletivo' ),
'section' => 'coletivo_features_settings',
'description' => '',
)
)
);

// Features layout.
$wp_customize->add_setting(
'coletivo_features_layout',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => '3',
)
);

$wp_customize->add_control(
'coletivo_features_layout',
array(
'label' => esc_html__( 'Features Layout Setting', 'coletivo' ),
'section' => 'coletivo_features_settings',
'description' => '',
'type' => 'select',
'choices' => array(
'3' => esc_html__( '4 Columns', 'coletivo' ),
'4' => esc_html__( '3 Columns', 'coletivo' ),
'6' => esc_html__( '2 Columns', 'coletivo' ),
),
)
);

$wp_customize->add_section(
'coletivo_features_content',
array(
'priority' => 6,
'title' => esc_html__( 'Section Content', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_features',
)
);

// Order & Styling.
$wp_customize->add_setting(
'coletivo_features_boxes',
array(
'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field',
'transport' => 'refresh', // refresh or postMessage.
)
);

$wp_customize->add_control(
new CustomizeRepeatableControl(
$wp_customize,
'coletivo_features_boxes',
array(
'label' => esc_html__( 'Features content', 'coletivo' ),
'description' => '',
'section' => 'coletivo_features_content',
'live_title_id' => 'title', // apply for unput text and textarea only.
'title_format' => esc_html__( '[live_title]', 'coletivo' ),
'max_item' => 12, // Maximum item can add.
'limited_msg' => esc_html__( 'Only 12 features allowed', 'coletivo' ),
'fields' => array(
'title' => array(
'title' => esc_html__( 'Title', 'coletivo' ),
'type' => 'text',
),
'icon_type' => array(
'title' => esc_html__( 'Custom icon', 'coletivo' ),
'type' => 'select',
'options' => array(
'icon' => esc_html__( 'Icon', 'coletivo' ),
'image' => esc_html__( 'image', 'coletivo' ),
),
),
'icon' => array(
'title' => esc_html__( 'Icon', 'coletivo' ),
'type' => 'icon',
'required' => array( 'icon_type', '=', 'icon' ),
),
'image' => array(
'title' => esc_html__( 'Image', 'coletivo' ),
'type' => 'media',
'required' => array( 'icon_type', '=', 'image' ),
),
'desc' => array(
'title' => esc_html__( 'Description', 'coletivo' ),
'type' => 'editor',
),
'link' => array(
'title' => esc_html__( 'Custom Link', 'coletivo' ),
'type' => 'text',
),
),
)
)
);
343 changes: 343 additions & 0 deletions inc/customizer-components/customizer-section-gallery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
<?php
/**
* Customizer Section Gallery
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: Gallery
*/
$wp_customize->add_panel(
'coletivo_gallery',
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_gallery' ),
'title' => esc_html__( 'Section: Gallery', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_showon_frontpage',
)
);

$wp_customize->add_section(
'coletivo_gallery_settings',
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_gallery',
)
);

// Show Content.
$wp_customize->add_setting(
'coletivo_gallery_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => 1,
)
);

$wp_customize->add_control(
'coletivo_gallery_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide this section?', 'coletivo' ),
'section' => 'coletivo_gallery_settings',
'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ),
)
);

// Section ID.
$wp_customize->add_setting(
'coletivo_gallery_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__( 'gallery', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_gallery_id',
array(
'label' => esc_html__( 'Section ID:', 'coletivo' ),
'section' => 'coletivo_gallery_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ),
)
);

// Title.
$wp_customize->add_setting(
'coletivo_gallery_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Gallery', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_gallery_title',
array(
'label' => esc_html__( 'Section Title', 'coletivo' ),
'section' => 'coletivo_gallery_settings',
'description' => '',
)
);

// Sub Title.
$wp_customize->add_setting(
'coletivo_gallery_subtitle',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Section subtitle', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_gallery_subtitle',
array(
'label' => esc_html__( 'Section Subtitle', 'coletivo' ),
'section' => 'coletivo_gallery_settings',
'description' => '',
)
);

// Description.
$wp_customize->add_setting(
'coletivo_gallery_desc',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
new EditorCustomControl(
$wp_customize,
'coletivo_gallery_desc',
array(
'label' => esc_html__( 'Section Description', 'coletivo' ),
'section' => 'coletivo_gallery_settings',
'description' => '',
)
)
);

$wp_customize->add_section(
'coletivo_gallery_content',
array(
'priority' => 6,
'title' => esc_html__( 'Section Content', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_gallery',
)
);

// Source page settings.
$wp_customize->add_setting(
'coletivo_gallery_source_page',
array(
'sanitize_callback' => 'coletivo_sanitize_number',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_gallery_source_page',
array(
'label' => esc_html__( 'Select Gallery Page', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'type' => 'select',
'priority' => 10,
'choices' => $option_pages,
'description' => esc_html__( 'Select a page which have content contain [gallery] shortcode.', 'coletivo' ),
)
);

// Gallery Layout.
$wp_customize->add_setting(
'coletivo_gallery_layout',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 'default',
)
);

$wp_customize->add_control(
'coletivo_gallery_layout',
array(
'label' => esc_html__( 'Layout', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'type' => 'select',
'priority' => 40,
'choices' => array(
'default' => esc_html__( 'Default, inside container', 'coletivo' ),
'full-width' => esc_html__( 'Full Width', 'coletivo' ),
),
)
);

// Gallery Display.
$wp_customize->add_setting(
'coletivo_gallery_display',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 'default',
)
);

$wp_customize->add_control(
'coletivo_gallery_display',
array(
'label' => esc_html__( 'Display', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'type' => 'select',
'priority' => 50,
'choices' => array(
'grid' => esc_html__( 'Grid', 'coletivo' ),
'carousel' => esc_html__( 'Carousel', 'coletivo' ),
'slider' => esc_html__( 'Slider', 'coletivo' ),
'justified' => esc_html__( 'Justified', 'coletivo' ),
),
)
);

// Gallery grid spacing.
$wp_customize->add_setting(
'coletivo_g_spacing',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 20,
)
);

$wp_customize->add_control(
'coletivo_g_spacing',
array(
'label' => esc_html__( 'Item Spacing', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 55,
)
);

// Gallery grid spacing.
$wp_customize->add_setting(
'coletivo_g_row_height',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 120,
)
);

$wp_customize->add_control(
'coletivo_g_row_height',
array(
'label' => esc_html__( 'Row Height', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 57,
)
);

// Gallery grid gird col.
$wp_customize->add_setting(
'coletivo_g_col',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => '4',
)
);

$wp_customize->add_control(
'coletivo_g_col',
array(
'label' => esc_html__( 'Layout columns', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 60,
'type' => 'select',
'choices' => array(
'1' => 1,
'2' => 2,
'3' => 3,
'4' => 4,
'5' => 5,
'6' => 6,
),
)
);

// Gallery max number.
$wp_customize->add_setting(
'coletivo_g_number',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 10,
)
);

$wp_customize->add_control(
'coletivo_g_number',
array(
'label' => esc_html__( 'Number items', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 65,
)
);

// Gallery grid spacing.
$wp_customize->add_setting(
'coletivo_g_lightbox',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => 1,
)
);

$wp_customize->add_control(
'coletivo_g_lightbox',
array(
'label' => esc_html__( 'Enable Lightbox', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 70,
'type' => 'checkbox',
)
);

// Gallery readmore link.
$wp_customize->add_setting(
'coletivo_g_readmore_link',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_g_readmore_link',
array(
'label' => esc_html__( 'Read More Link', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 90,
'type' => 'text',
)
);

$wp_customize->add_setting(
'coletivo_g_readmore_text',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'View More', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_g_readmore_text',
array(
'label' => esc_html__( 'Read More Text', 'coletivo' ),
'section' => 'coletivo_gallery_content',
'priority' => 100,
'type' => 'text',
)
);
491 changes: 491 additions & 0 deletions inc/customizer-components/customizer-section-hero.php

Large diffs are not rendered by default.

199 changes: 199 additions & 0 deletions inc/customizer-components/customizer-section-news.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
<?php
/**
* Customizer Section News
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: News
*/
$wp_customize->add_panel(
'coletivo_news',
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_news' ),
'title' => esc_html__( 'Section: News', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_showon_frontpage',
)
);

$wp_customize->add_section(
'coletivo_news_settings',
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_news',
)
);

// Show Content.
$wp_customize->add_setting(
'coletivo_news_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_news_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide this section?', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ),
)
);

// Section ID.
$wp_customize->add_setting(
'coletivo_news_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__( 'news', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_news_id',
array(
'label' => esc_html__( 'Section ID:', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ),
)
);

// Title.
$wp_customize->add_setting(
'coletivo_news_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Latest News', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_news_title',
array(
'label' => esc_html__( 'Section Title', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => '',
)
);

// Sub Title.
$wp_customize->add_setting(
'coletivo_news_subtitle',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Section subtitle', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_news_subtitle',
array(
'label' => esc_html__( 'Section Subtitle', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => '',
)
);

// Description.
$wp_customize->add_setting(
'coletivo_news_desc',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
new EditorCustomControl(
$wp_customize,
'coletivo_news_desc',
array(
'label' => esc_html__( 'Section Description', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => '',
)
)
);

// hr.
$wp_customize->add_setting(
'coletivo_news_settings_hr',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
)
);

$wp_customize->add_control(
new MiscControl(
$wp_customize,
'coletivo_news_settings_hr',
array(
'section' => 'coletivo_news_settings',
'type' => 'hr',
)
)
);

// Number of post to show.
$wp_customize->add_setting(
'coletivo_news_number',
array(
'sanitize_callback' => 'coletivo_sanitize_number',
'default' => '3',
)
);

$wp_customize->add_control(
'coletivo_news_number',
array(
'label' => esc_html__( 'Number of post to show', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => '',
)
);

// Blog Button.
$wp_customize->add_setting(
'coletivo_news_more_link',
array(
'sanitize_callback' => 'esc_url',
'default' => '#',
)
);

$wp_customize->add_control(
'coletivo_news_more_link',
array(
'label' => esc_html__( 'More News button link', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => esc_html__( 'It should be your blog page link.', 'coletivo' ),
)
);

$wp_customize->add_setting(
'coletivo_news_more_text',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Read Our Blog', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_news_more_text',
array(
'label' => esc_html__( 'More News Button Text', 'coletivo' ),
'section' => 'coletivo_news_settings',
'description' => '',
)
);
190 changes: 190 additions & 0 deletions inc/customizer-components/customizer-section-portfolio.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?php
/**
* Customizer Section Portfolio
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: Portfolio
*/
$wp_customize->add_panel(
'coletivo_portfolio',
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_portfolio' ),
'title' => esc_html__( 'Section: Portfolio', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_is_jetpack_active',
)
);

$wp_customize->add_section(
'coletivo_portfolio_settings',
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_portfolio',
)
);

// Show Content.
$wp_customize->add_setting(
'coletivo_portfolio_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);

$wp_customize->add_control(
'coletivo_portfolio_disable',
array(
'type' => 'checkbox',
'label' => esc_html__( 'Hide this section?', 'coletivo' ),
'section' => 'coletivo_portfolio_settings',
'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ),
)
);

// Section ID.
$wp_customize->add_setting(
'coletivo_portfolio_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__( 'portfolio', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_portfolio_id',
array(
'label' => esc_html__( 'Section ID:', 'coletivo' ),
'section' => 'coletivo_portfolio_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ),
)
);

// Number of projects to show..
$wp_customize->add_setting(
'coletivo_portfolio_number',
array(
'sanitize_callback' => 'coletivo_sanitize_number',
'default' => '3',
)
);

$wp_customize->add_control(
'coletivo_portfolio_number',
array(
'label' => esc_html__( 'Number of projects to show', 'coletivo' ),
'section' => 'coletivo_portfolio_settings',
'description' => '',
)
);

$wp_customize->add_section(
'coletivo_portfolio_content',
array(
'priority' => 6,
'title' => esc_html__( 'Section Content', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_portfolio',
)
);

// Title.
$wp_customize->add_setting(
'coletivo_portfolio_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Our Work', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_portfolio_title',
array(
'label' => esc_html__( 'Section Title', 'coletivo' ),
'section' => 'coletivo_portfolio_content',
'description' => '',
)
);

// Sub Title.
$wp_customize->add_setting(
'coletivo_portfolio_subtitle',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'Section subtitle', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_portfolio_subtitle',
array(
'label' => esc_html__( 'Section Subtitle', 'coletivo' ),
'section' => 'coletivo_portfolio_content',
'description' => '',
)
);

// Description.
$wp_customize->add_setting(
'coletivo_portfolio_desc',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);

$wp_customize->add_control(
new EditorCustomControl(
$wp_customize,
'coletivo_portfolio_desc',
array(
'label' => esc_html__( 'Section Description', 'coletivo' ),
'section' => 'coletivo_portfolio_content',
'description' => '',
)
)
);

// Portfolio Button.
$wp_customize->add_setting(
'coletivo_portfolio_more_link',
array(
'sanitize_callback' => 'esc_url',
'default' => '#',
)
);

$wp_customize->add_control(
'coletivo_portfolio_more_link',
array(
'label' => esc_html__( 'Portfolio Button Link', 'coletivo' ),
'section' => 'coletivo_portfolio_content',
'description' => esc_html__( 'It should be your portfolio page link.', 'coletivo' ),
)
);

$wp_customize->add_setting(
'coletivo_portfolio_more_text',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__( 'See Our Portfolio', 'coletivo' ),
)
);

$wp_customize->add_control(
'coletivo_portfolio_more_text',
array(
'label' => esc_html__( 'Portfolio Button Text', 'coletivo' ),
'section' => 'coletivo_portfolio_content',
'description' => '',
)
);
66 changes: 66 additions & 0 deletions inc/customizer-components/customizer-section-sections.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
/**
* Customizer Section Sections ordering
*
* @package Coletivo
*/

namespace RedeLivre\Coletivo;

defined( 'ABSPATH' ) || exit;

/**
* Section: Sections
*/
$wp_customize->add_section(
'coletivo_sections_options',
array(
'priority' => 130,
'title' => esc_html__( 'Sections', 'coletivo' ),
'description' => '',
)
);

// Sections ordering.
$wp_customize->add_setting(
'coletivo_section_order',
array(
'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field',
'transport' => 'refresh', // refresh or postMessage.
)
);

$wp_customize->add_control(
new CustomizeRepeatableControl(
$wp_customize,
'coletivo_section_order',
array(
'label' => esc_html__( 'Sections', 'coletivo' ),
'is_order_field' => true,
'description' => esc_html__( 'Organize with drag and drop to define sections order, open it to customize each one', 'coletivo' ),
'section' => 'coletivo_sections_options',
'live_title_id' => 'section_order', // apply for unput text and textarea only.
'title_format' => __( '[live_title] <a>(Edit Section)</a>', 'coletivo' ),
'max_item' => 200, // Maximum item can add.
'limited_msg' => '',
'fields' => array(),

)
)
);

// Hidden field to reorder home sections.
$wp_customize->add_setting(
'coletivo_sections_order',
array(
'default' => apply_filters( 'coletivo_sections_order_default_value', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ),
)
);

$wp_customize->add_control(
'coletivo_sections_order',
array(
'type' => 'hidden',
'section' => 'coletivo_sections_options',
)
);
Loading