").attr(c.extend(d(this),{type:"text"}))}a.removeAttr("name").data({"placeholder-password":f,"placeholder-id":g}).bind("focus.placeholder",e),f.data({"placeholder-textinput":a,"placeholder-id":g}).before(a)}f=f.removeAttr("id").hide().prev().attr("id",g).show()}f.addClass("placeholder"),f[0].value=f.attr("placeholder")}else f.removeClass("placeholder")}function g(){try{return b.activeElement}catch(a){}}var h,i,j="[object OperaMini]"==Object.prototype.toString.call(a.operamini),k="placeholder"in b.createElement("input")&&!j,l="placeholder"in b.createElement("textarea")&&!j,m=c.fn,n=c.valHooks,o=c.propHooks;k&&l?(i=m.placeholder=function(){return this},i.input=i.textarea=!0):(i=m.placeholder=function(){var a=this;return a.filter((k?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":e,"blur.placeholder":f}).data("placeholder-enabled",!0).trigger("blur.placeholder"),a},i.input=k,i.textarea=l,h={get:function(a){var b=c(a),d=b.data("placeholder-password");return d?d[0].value:b.data("placeholder-enabled")&&b.hasClass("placeholder")?"":a.value},set:function(a,b){var d=c(a),h=d.data("placeholder-password");return h?h[0].value=b:d.data("placeholder-enabled")?(""==b?(a.value=b,a!=g()&&f.call(a)):d.hasClass("placeholder")?e.call(a,!0,b)||(a.value=b):a.value=b,d):a.value=b}},k||(n.input=h,o.value=h),l||(n.textarea=h,o.value=h),c(function(){c(b).delegate("form","submit.placeholder",function(){var a=c(".placeholder",this).each(e);setTimeout(function(){a.each(f)},10)})}),c(a).bind("beforeunload.placeholder",function(){c(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery);
3 |
--------------------------------------------------------------------------------
/attachment.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
9 |
10 | Maera()->views->header();
11 | Maera()->views->render();
12 | Maera()->views->footer();
13 |
--------------------------------------------------------------------------------
/author.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
8 |
9 | Maera()->views->header();
10 | Maera()->views->render();
11 | Maera()->views->footer();
12 |
--------------------------------------------------------------------------------
/bbpress.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
4 |
5 | $context = Maera()->cache->get_context();
6 | $post = Timber::query_post();
7 | $context['post'] = $post;
8 | $context['content'] = maera_get_echo( 'the_content' );
9 |
10 | Maera()->views->header();
11 | Maera()->views->render( 'bbp.twig', $context );
12 | Maera()->views->footer();
13 |
--------------------------------------------------------------------------------
/buddypress.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
4 |
5 | $context = Maera()->cache->get_context();
6 | $post = Timber::query_post();
7 | $context['post'] = $post;
8 | $context['content'] = maera_get_echo( 'the_content' );
9 |
10 | Maera()->views->header();
11 | Maera()->views->render( 'bp.twig', $context );
12 | Maera()->views->footer();
13 |
--------------------------------------------------------------------------------
/comments.php:
--------------------------------------------------------------------------------
1 | views->render( array(
21 | 'comments-' . $post->ID . '.twig',
22 | $post->post_type . '-comments.twig',
23 | 'comments.twig'
24 | ));
25 |
--------------------------------------------------------------------------------
/content.php:
--------------------------------------------------------------------------------
1 | views->render( array(
8 | 'content-' . $post->ID . '.twig',
9 | 'content-' . $post->post_type . '.twig',
10 | 'content.twig'
11 | ));
12 |
--------------------------------------------------------------------------------
/core-shell/assets/images/grid-back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codemonkey-jack/maera/70530cfab1a4ed1b59af96ee43de7dedfac418bc/core-shell/assets/images/grid-back.png
--------------------------------------------------------------------------------
/core-shell/assets/js/vendor/menu.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | $(function() {
3 | $( ".menu-button" ).click( function() {
4 | $( "body" ).toggleClass( "show-menu" );
5 | });
6 | $( "#layout, .page-header" ).click( function() {
7 | $( "body" ).removeClass( "show-menu" );
8 | });
9 | });
10 | })(jQuery);
--------------------------------------------------------------------------------
/core-shell/views/base.twig:
--------------------------------------------------------------------------------
1 | {#
3 |
4 |
5 |
6 | {% do action( 'maera/wrap/before', post.ID ) %}
7 | {% do action( 'maera/content/before', post.ID ) %}
8 | {% do action( 'maera/main/before', post.ID ) %}
9 | {% block main %}{{ fn( 'esc_html__', 'Sorry, no content', 'maera' ) }}{% endblock %}
10 | {% do action( 'maera/main/after', post.ID ) %}
11 |
12 |
13 |
18 |
19 | {% do action( 'maera/content/after' ) %}
20 | {% do action( 'maera/footer/before', post.ID ) %}
21 |
26 | {% do action( 'maera/footer/after', post.ID ) %}
27 |
28 | {{ function( 'wp_footer' ) }}
29 |
30 |
--------------------------------------------------------------------------------
/core-shell/views/content-single-entry-header.twig:
--------------------------------------------------------------------------------
1 | {#
2 | This file is empty on purpose.
3 | #}
4 |
--------------------------------------------------------------------------------
/core-shell/views/header.twig:
--------------------------------------------------------------------------------
1 |
2 | {% block head %}
3 |
4 |
5 |
6 |
7 |
8 | {% if wp_title %}
9 | {{ function( 'wp_title', '|', true, 'right' ) }}
10 | {% else %}
11 | {{ site.name }}
12 | {% endif %}
13 |
14 |
15 |
16 | {{ function( 'wp_head' ) }}
17 |
18 |
19 | {% endblock %}
20 |
21 |
22 | {{ fn('esc_html__', 'Skip to main content', 'maera') }}
23 |
24 | {% if function( 'has_nav_menu', 'primary_navigation' ) %}
25 |
26 |
36 | {% endif %}
37 | {% do action( 'get_header' ) %}
38 | {% do action( 'maera/header/before', post.ID ) %}
39 |
53 | {% do action( 'maera/header/after', post.ID ) %}
54 |
--------------------------------------------------------------------------------
/core-shell/views/macros/column_classes.html.twig:
--------------------------------------------------------------------------------
1 | {% macro column_classes(sizes) %}
2 | {% if sizes is iterable %}
3 | {% for size in sizes %}
4 | {% if size.mobile %} u-1 u-sm-{{ size.mobile * 2 }}-24 {% endif %}
5 | {% if size.tablet %} u-1 u-sm-{{ size.tablet * 2 }}-24 {% endif %}
6 | {% if size.medium %} u-1 u-md-{{ size.medium * 2 }}-24 {% endif %}
7 | {% if size.large %} u-1 u-lg-{{ size.large * 2 }}-24 {% endif %}
8 | {% endfor %}
9 | {% endif %}
10 | {% endmacro %}
11 |
--------------------------------------------------------------------------------
/core-shell/views/macros/grid_classes.html.twig:
--------------------------------------------------------------------------------
1 | {% macro container() %}g{% endmacro %}
2 |
3 | {% macro row() %}g{% endmacro %}
4 |
5 | {% macro column() %}u{% endmacro %}
6 |
--------------------------------------------------------------------------------
/core-shell/views/pagination.twig:
--------------------------------------------------------------------------------
1 | {#
3 | {% if pagination.prev %}
4 |
5 | {% endif %}
6 |
7 | {% for page in pagination.pages %}
8 |
9 | {% if page.link %}
10 | {{ page.title }}
11 | {% else %}
12 | {{ page.title }}
13 | {% endif %}
14 |
15 | {% endfor %}
16 |
17 | {% if pagination.next %}
18 |
19 | {% endif %}
20 |
21 |
--------------------------------------------------------------------------------
/edd_templates/widget-cart-checkout.php:
--------------------------------------------------------------------------------
1 |
2 | " . edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ); ?>
3 |
4 |
--------------------------------------------------------------------------------
/edd_templates/widget-cart-item.php:
--------------------------------------------------------------------------------
1 |
2 | {item_title}
3 | {item_amount}
4 |
5 |
6 |
--------------------------------------------------------------------------------
/footer.php:
--------------------------------------------------------------------------------
1 | views->render( 'footer.twig' );
9 |
--------------------------------------------------------------------------------
/functions.php:
--------------------------------------------------------------------------------
1 | views->render( 'header.twig' );
9 |
--------------------------------------------------------------------------------
/includes/admin/tabs/docs.php:
--------------------------------------------------------------------------------
1 | 'General & FAQ',
5 | 'templating' => 'Templating',
6 | 'shells' => 'Shells',
7 | 'theme-supports' => 'Theme Supports',
8 | 'actions' => 'Actions & Hooks',
9 | 'filters' => 'Filters',
10 | );
11 | ?>
12 |
16 |
17 |
18 |
19 | $docs_tab_label ) : ?>
20 |
21 |
22 |
23 |
24 | $docs_tab_label ) : ?>
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
37 |
--------------------------------------------------------------------------------
/includes/admin/tabs/docs/actions.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Available Actions:
5 |
6 |
Below you can see a list of all the available actions in the Maera theme.
7 |
8 |
9 | Generic actions
10 |
11 |
maera/admin/save
12 |
13 |
This action is run when the admin page is saved.
14 | An example usage is when we import the customizer options in a shell that uses a compiler. In that case, when we perform the import we may want to trigger the shell's compiler so that the stylesheets get re-generated, caches dumped etc.
15 |
16 |
maera/shell/include_modules
17 |
18 |
This action is run when the shell is being initialized.
19 |
20 |
21 | Content-injecting actions
22 |
23 |
24 | maera/wrap/before
25 | maera/wrap/after
26 | maera/content/before
27 | maera/content/after
28 | maera/main/before
29 | maera/main/after
30 | maera/page/pre_content
31 | maera/page/after_content
32 | maera/entry/footer
33 | maera/teaser/start
34 | maera/single/top
35 | maera/single/pre_content
36 | maera/single/after_content
37 | maera/in_article/top
38 | maera/footer/before
39 | maera/footer/start
40 | maera/footer/content
41 | maera/footer/end
42 | maera/footer/after
43 | maera/header/before
44 | maera/header/after
45 | maera/index/begin
46 | maera/index/end
47 | maera/in_loop/begin
48 | maera/in_loop/end
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/includes/admin/tabs/docs/general.php:
--------------------------------------------------------------------------------
1 | Maera is a developer-friendly theme that allows you to quickly prototype sites and extend it with your own custom plugins.
2 | It's a kick-ass open-minded theming framework.
3 | It is completely open-source, licensed under the MIT license.
4 | In its heart it uses the twig templating engine and the WordPress Customizer.
5 |
6 | With Maera we're introducing the concept of theme shells . An easy way to completely customize the theme with your own markup, css, scripts and functionality to meet your own needs!
7 |
--------------------------------------------------------------------------------
/includes/admin/tabs/docs/theme-supports.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
When building your own shell, you can activate parts of the Maera framework using theme supports.
4 | Theme supports provide functionality and classes that you can use in your shells without requiring you to write your own code, thus taking advantage of Maera's structure.
5 |
6 |
Theme supports are usually loaded using the after_setup_theme
action.
7 | In addition to the default theme features Kirki includes the following extra features:
8 |
9 |
<?php
10 |
11 | function my_theme_supports () {
12 |
13 | // Add breadcrumbs support.
14 | // prompts for the installation of the Breadcrumb Trail plugin: https://wordpress.org/plugins/breadcrumb-trail/
15 | // You will then have to configure them using this as an example: https://github.com/justintadlock/breadcrumb-trail#breadcrumb-trail
16 | add_theme_support( ' breadcrumbs' );
17 |
18 | // Add Less Compiler support
19 | // Prompts the user to install the compiler plugin: https://wordpress.org/plugins/lessphp/
20 | add_theme_support( ' less_compiler' )
21 |
22 | // Add SASS/SCSS Compiler support
23 | // Prompts the user to install the compiler plugin: https://wordpress.org/plugins/lessphp/
24 | add_theme_support( ' sass_compiler' )
25 |
26 | }
27 | add_action( ' after_setup_theme' , ' my_theme_supports' );
28 |
29 | ? >
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/includes/admin/tabs/general.php:
--------------------------------------------------------------------------------
1 |
2 |
Welcome to the Maera Theme
3 |
4 |
Maera is one of the most versatile and modular WordPress Theme Frameworks, allowing both developers and novice users to build amazing sites and take advantage of its unique features.
5 |
6 |
Maera introduces the concept of shells , essentially child themes built as plugins that can change and affect every aspect of your theme and presentation, allowing you to build a completely customized experience for your site and your users.
7 |
8 |
9 |
10 |
11 |
12 |
Modular in nature
13 |
The core of the theme is a set of libraries that allows you to extend it and use it however you like! Using Shells and plugins you can add or remove features and customize your site using just the bits and pieces that you need.
14 |
15 |
16 |
17 |
18 |
Plugins
19 |
Instead of bundling extra libraries in the plugin, we are requiring you to install some 3rd-party plugins. This way you can get updates for them without the need to update the core of your theme, while at the same time makes it easier for developers to tackle issues when the need arises.
20 |
21 |
22 |
23 |
24 |
Documentation
25 |
We have extended documentation both in the [repository wiki on github](https://github.com/presscodes/maera/wiki) as well as embeded in the theme options page. Just click on the Documentation tab on the top and you'll be able to learn more.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
Twig is an amazing templating engine that uses a simple syntax, allowing non-php developers to understand and tweak their own templates, further customizing their own site. You can find these templates in the /views
folder in your theme.
35 |
36 |
37 |
38 |
39 |
Fast and SEO Optimized
40 |
Taking advantage of internal caching and SEO Optimizations, you can be sure your site will be fast and performant for users as well as search engines.
41 |
42 |
43 |
44 |
45 |
Accessible
46 |
We designed this theme with accessibility standards in mind so everyone will be able to use your sites and try to educate developers so that all future shells will also be accessible.
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/includes/admin/tabs/settings.php:
--------------------------------------------------------------------------------
1 | 'core',
6 | 'import_data' => '',
7 | 'dev_mode' => 1,
8 | 'cache' => '0',
9 | 'cache_mode' => 'default',
10 | ) );
11 |
12 | // Get the available shells
13 | $available_shells = apply_filters( 'maera/shells/available', array() );
14 |
15 | $cache_modes = array(
16 | array( 'value' => 'none', 'label' => esc_html__( 'No Caching', 'maera' ) ),
17 | array( 'value' => 'object', 'label' => esc_html__( 'WP Object Caching', 'maera' ) ),
18 | array( 'value' => 'transient', 'label' => esc_html__( 'Transients', 'maera' ) ),
19 | array( 'value' => 'default', 'label' => esc_html__( 'Default', 'maera' ) ),
20 | );
21 |
22 | $settings = get_option( 'maera_admin_options', $maera_admin_options );
23 |
24 | $settings['shell'] = ! isset( $settings['shell'] ) ? 'core' : $settings['shell'];
25 | $settings['import_data'] = ! isset( $settings['import_data'] ) ? '' : $settings['import_data'];
26 | $settings['dev_mode'] = ! isset( $settings['dev_mode'] ) ? 0 : $settings['dev_mode'];
27 | $settings['cache'] = ! isset( $settings['cache'] ) ? 0 : $settings['cache'];
28 | $settings['cache_mode'] = ! isset( $settings['cache_mode'] ) ? 'none' : $settings['cache_mode'];
29 |
30 | ?>
31 |
97 |
--------------------------------------------------------------------------------
/includes/class-jetpack-color.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codemonkey-jack/maera/70530cfab1a4ed1b59af96ee43de7dedfac418bc/includes/class-jetpack-color.php
--------------------------------------------------------------------------------
/includes/class-maera-caching.php:
--------------------------------------------------------------------------------
1 | dev->dev_mode() ) {
24 | // Get our styles using the maera/styles filter
25 | $data = apply_filters( 'maera/styles', null );
26 | } else {
27 | // Get the cached CSS from the database
28 | $cache = get_theme_mod( 'css_cache', '' );
29 | // If the transient does not exist, then create it.
30 | if ( ! $cache || empty( $cache ) || '' == $cache ) {
31 | // Get our styles using the maera/styles filter
32 | $data = apply_filters( 'maera/styles', null );
33 | // Set the transient for 24 hours.
34 | set_theme_mod( 'css_cache', $data );
35 | } else {
36 | $data = $cache;
37 | }
38 | }
39 |
40 | // Add the CSS inline.
41 | // See http://codex.wordpress.org/Function_Reference/wp_add_inline_style#Examples
42 | wp_add_inline_style( 'maera', $data );
43 |
44 | }
45 |
46 | /**
47 | * Apply global Timber customizations
48 | */
49 | function timber_customizations() {
50 |
51 | // Early exit if Timber is not installed
52 | if ( ! class_exists( 'Timber' ) ) {
53 | return;
54 | }
55 | global $wp_customize;
56 |
57 | if ( ! Maera()->dev->dev_mode() ) {
58 |
59 | // Turn on Timber caching.
60 | // See https://github.com/jarednova/timber/wiki/Performance#cache-the-twig-file-but-not-the-data
61 |
62 | // This is a bit buggy right now on some hosts so we're disabling it.
63 | // Timber::$cache = true;
64 | $this->cache_mode();
65 |
66 |
67 | } else {
68 |
69 | TimberLoader::CACHE_NONE;
70 | Timber::$cache = false;
71 |
72 | $_SERVER['QUICK_CACHE_ALLOWED'] = FALSE;
73 | Maera_Helper::define( 'DONOTCACHEPAGE', TRUE );
74 |
75 | }
76 |
77 | }
78 |
79 | /**
80 | * Timber caching
81 | */
82 | public function cache_duration() {
83 |
84 | $theme_options = get_option( 'maera_admin_options', array() );
85 |
86 | $cache_int = isset( $theme_options['cache'] ) ? intval( $theme_options['cache'] ) : 0;
87 |
88 | if ( 0 == $cache_int ) {
89 |
90 | // No need to proceed if cache=0
91 | return false;
92 |
93 | }
94 |
95 | // Convert minutes to seconds
96 | return ( $cache_int * 60 );
97 |
98 | }
99 |
100 | /**
101 | * Custom implementation for get_context method.
102 | * Implements caching
103 | */
104 | public function get_context() {
105 |
106 | if ( Maera()->dev->dev_mode() ) {
107 | $cached = false;
108 | } else {
109 | $cache = wp_cache_get( 'context', 'maera' );
110 | $cached = ( $cache ) ? true : false;
111 | }
112 |
113 | if ( $cached && $cache ) {
114 | return $cache;
115 | } else {
116 | $context = Maera()->timber->get_context();
117 | wp_cache_set( 'context', $context, 'maera' );
118 | return $context;
119 | }
120 |
121 | }
122 |
123 | public function cache_mode() {
124 |
125 | $options = get_option( 'maera_admin_options', array() );
126 | $cache_mode = isset( $options['cache_mode'] ) ? $options['cache_mode'] : 'default';
127 |
128 | if ( 'none' == $cache_mode ) {
129 | $mode = TimberLoader::CACHE_NONE;
130 | } else if ( 'object' == $cache_mode ) {
131 | $mode = TimberLoader::CACHE_OBJECT;
132 | } else if ( 'transient' == $cache_mode ) {
133 | $mode = TimberLoader::CACHE_TRANSIENT;
134 | } else {
135 | $mode = TimberLoader::CACHE_USE_DEFAULT;
136 | }
137 |
138 | return $mode;
139 |
140 | }
141 |
142 | /**
143 | * Change Timber's cache folder.
144 | * We want to use wp-content/cache/timber
145 | */
146 | function change_twig_cache_dir() {
147 | return WP_CONTENT_DIR . '/cache/timber';
148 | }
149 |
150 | }
151 |
--------------------------------------------------------------------------------
/includes/class-maera-core-customizer.php:
--------------------------------------------------------------------------------
1 | add_section( 'maera_options', array(
21 | 'title' => esc_html__( 'Maera Options', 'maera' ),
22 | 'priority' => 1,
23 | ) );
24 |
25 | }
26 |
27 | /**
28 | * Add the setting
29 | */
30 | function add_settings( $wp_customize ) {
31 |
32 | $wp_customize->add_setting( 'maera_admin_options[shell]', array(
33 | 'default' => 'core',
34 | 'type' => 'option',
35 | 'capability' => 'edit_theme_options',
36 | 'sanitize_callback' => array( $this, 'sanitize_text_value' ),
37 |
38 | ) );
39 |
40 | $wp_customize->add_setting( 'maera_admin_options[dev_mode]', array(
41 | 'default' => 'core',
42 | 'type' => 'option',
43 | 'capability' => 'edit_theme_options',
44 | 'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
45 | ) );
46 |
47 | $wp_customize->add_setting( 'maera_admin_options[cache]', array(
48 | 'default' => 'core',
49 | 'type' => 'option',
50 | 'capability' => 'edit_theme_options',
51 |
52 | ) );
53 |
54 | $wp_customize->add_setting( 'maera_admin_options[cache_mode]', array(
55 | 'default' => 'core',
56 | 'type' => 'option',
57 | 'capability' => 'edit_theme_options',
58 | 'sanitize_callback' => array( $this, 'sanitize_text_value' ),
59 | ) );
60 |
61 | $wp_customize->add_setting( 'maera_admin_options[reset]', array(
62 | 'default' => 'core',
63 | 'type' => 'option',
64 | 'capability' => 'edit_theme_options',
65 | 'sanitize_callback' => array( $this, 'reset_sanitize_callback' ),
66 | ) );
67 |
68 | }
69 |
70 | /**
71 | * Add the controls
72 | */
73 | function add_controls( $wp_customize ) {
74 |
75 | // Get the available shells and format the array properly
76 | $available_shells = apply_filters( 'maera/shells/available', array() );
77 | $shells = array();
78 | foreach ( $available_shells as $available_shell ) {
79 | $shells[$available_shell['value']] = $available_shell['label'];
80 | }
81 |
82 | $wp_customize->add_control( 'maera_shell', array(
83 | 'label' => esc_html__( 'Shell', 'maera' ),
84 | 'section' => 'maera_options',
85 | 'settings' => 'maera_admin_options[shell]',
86 | 'description' => esc_html__( 'You can change the active shell here. Please note that the changes will not take effect immediately. You will have to save and your selection and then refresh this page. All current options will be lost, so we advise you to first export them from the "Theme Options" page on your dashboard.', 'maera' ),
87 | 'type' => 'radio',
88 | 'choices' => $shells,
89 | ) );
90 |
91 | $wp_customize->add_control( 'maera_dev_mode', array(
92 | 'label' => esc_html__( 'Enable Development Mode', 'maera' ),
93 | 'section' => 'maera_options',
94 | 'settings' => 'maera_admin_options[dev_mode]',
95 | 'type' => 'checkbox',
96 | ) );
97 |
98 | $wp_customize->add_control( 'maera_cache_mode', array(
99 | 'label' => esc_html__( 'Cache mode.', 'maera' ),
100 | 'section' => 'maera_options',
101 | 'settings' => 'maera_admin_options[cache_mode]',
102 | 'type' => 'select',
103 | 'default' => 'none',
104 | 'choices' => array(
105 | 'none' => esc_html__( 'No Caching', 'maera' ),
106 | 'object' => esc_html__( 'WP Object Caching', 'maera' ),
107 | 'transient' => esc_html__( 'Transients', 'maera' ),
108 | 'default' => esc_html__( 'Default', 'maera' ),
109 | ),
110 | ) );
111 |
112 | $wp_customize->add_control( 'maera_reset', array(
113 | 'label' => esc_html__( 'Reset', 'maera' ),
114 | 'section' => 'maera_options',
115 | 'description' => esc_html__( 'Please enter RESET to reset the theme mods.', 'maera' ),
116 | 'settings' => 'maera_admin_options[reset]',
117 | 'type' => 'text',
118 | 'default' => '',
119 | ) );
120 |
121 | }
122 |
123 | public function reset_sanitize_callback( $input ) {
124 |
125 | if ( 'reset' == strtolower( $input ) ) {
126 | remove_theme_mods();
127 | }
128 |
129 | return '';
130 |
131 | }
132 |
133 | function sanitize_checkbox( $checked ) {
134 | return ( ( isset( $checked ) && true == $checked ) ? true : false );
135 | }
136 |
137 | function sanitize_text_field( $input ) {
138 | return sanitize_text_field( $input );
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/includes/class-maera-development.php:
--------------------------------------------------------------------------------
1 | dev_mode() ) {
10 | $this->dev_mode = true;
11 | $this->jetpack_dev_mode();
12 | }
13 |
14 | }
15 |
16 | /**
17 | * Detect if dev mode is active OR if we're on the customizer
18 | * @return bool
19 | */
20 | public function dev_mode() {
21 |
22 | global $wp_customize;
23 | $options = get_option( 'maera_admin_options', array() );
24 |
25 | // If we're on the customizer, return true.
26 | if ( isset( $wp_customize ) ) {
27 | return;
28 | }
29 |
30 | // If dev mode is enabled on the dashboard, return true;
31 | if ( isset( $options['dev_mode'] ) && 1 == $options['dev_mode'] ) {
32 | return true;
33 | }
34 |
35 | return false;
36 |
37 | }
38 |
39 | /**
40 | * set JETPACK_DEV_DEBUG to true if not already defined
41 | */
42 | function jetpack_dev_mode() {
43 |
44 | if ( ! defined( 'JETPACK_DEV_DEBUG' ) ) {
45 | define( 'JETPACK_DEV_DEBUG', true);
46 | }
47 |
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/includes/class-maera-edd-compatibility.php:
--------------------------------------------------------------------------------
1 | ID, 'edd_coming_soon', true );
23 | if ( $coming_soon ) {
24 | $classes[] = 'edd_coming_soon';
25 | }
26 |
27 | }
28 |
29 | return $classes;
30 |
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/includes/class-maera-edd-customizer.php:
--------------------------------------------------------------------------------
1 | add_section( 'maera_edd', array(
24 | 'title' => esc_html__( 'Easy Digital Downloads', 'maera' ),
25 | 'priority' => 999,
26 | ) );
27 |
28 | }
29 |
30 | /**
31 | * Create the customizer controls.
32 | * Depends on the Kirki Customizer plugin.
33 | */
34 | function create_settings( $controls ) {
35 |
36 | global $edd_options;
37 |
38 | $controls[] = array(
39 | 'type' => 'select',
40 | 'setting' => 'checkout_color',
41 | 'label' => esc_html__( 'Button color', 'maera' ),
42 | 'subtitle' => esc_html__( 'Select the button color for the purchase/buynow button.', 'maera' ) . ' ' . esc_html__( 'Please note that this change will be applied after you save the options and refresh (no live-preview available).', 'maera' ),
43 | 'section' => 'maera_edd',
44 | 'priority' => 12,
45 | 'default' => $edd_options['checkout_color'],
46 | 'choices' => array(
47 | 'white' => esc_html__( 'White', 'edd' ),
48 | 'gray' => esc_html__( 'Gray', 'edd' ),
49 | 'blue' => esc_html__( 'Blue', 'edd' ),
50 | 'red' => esc_html__( 'Red', 'edd' ),
51 | 'green' => esc_html__( 'Green', 'edd' ),
52 | 'yellow' => esc_html__( 'Yellow', 'edd' ),
53 | 'orange' => esc_html__( 'Orange', 'edd' ),
54 | 'dark-gray' => esc_html__( 'Dark Gray', 'edd' ),
55 | ),
56 |
57 | );
58 |
59 | $controls[] = array(
60 | 'type' => 'select',
61 | 'setting' => 'hover_type',
62 | 'label' => esc_html__( 'Hover Type', 'maera' ),
63 | 'subtitle' => esc_html__( 'Select the hover type for the grid display.', 'maera' ),
64 | 'section' => 'maera_edd',
65 | 'priority' => 13,
66 | 'default' => 'edd',
67 | 'choices' => array(
68 | 'edd' => esc_html__( 'EDD style', 'maera' ),
69 | 'zoe' => esc_html__( 'Zoe', 'maera' ),
70 | ),
71 |
72 | );
73 |
74 | $controls[] = array(
75 | 'type' => 'checkbox',
76 | 'setting' => 'edd_variables_dropdown',
77 | 'label' => esc_html__( 'Replace variables radio select with a dropdown', 'maera' ),
78 | 'section' => 'maera_edd',
79 | 'default' => 0,
80 | 'priority' => 20,
81 | );
82 |
83 | $controls[] = array(
84 | 'type' => 'radio',
85 | 'mode' => 'buttonset',
86 | 'setting' => 'filter_mode',
87 | 'label' => esc_html__( 'Downloads filter mode', 'maera' ),
88 | 'subtitle' => esc_html__( 'Please note that this change will be applied after you save the options and refresh (no live-preview available).', 'maera' ),
89 | 'section' => 'maera_edd',
90 | 'default' => 'php',
91 | 'priority' => 1,
92 | 'choices' => array(
93 | 'isotope' => esc_html__( 'Isotope', 'maera' ),
94 | 'php' => esc_html__( 'PHP', 'maera' ),
95 | ),
96 | );
97 |
98 | return $controls;
99 |
100 | }
101 |
102 | function sync_edd_colors_options() {
103 | global $edd_options;
104 |
105 | $checkout_color = get_theme_mod( 'checkout_color' );
106 |
107 | if ( $checkout_color != $edd_options['checkout_color'] ) {
108 | $edd_options['checkout_color'] = $checkout_color;
109 | update_option( 'edd_settings', $edd_options );
110 | }
111 | }
112 |
113 | function sync_edd_colors_theme_mod() {
114 | global $edd_options;
115 |
116 | $checkout_color = get_theme_mod( 'checkout_color' );
117 |
118 | if ( $checkout_color != $edd_options['checkout_color'] ) {
119 | set_theme_mod( 'checkout_color', $edd_options['checkout_color'] );
120 | }
121 | }
122 |
123 | }
124 |
--------------------------------------------------------------------------------
/includes/class-maera-edd-mods.php:
--------------------------------------------------------------------------------
1 | ';
62 | if ( $prices ) {
63 | echo '';
64 | foreach ( $prices as $key => $price ) {
65 | printf(
66 | ' %6$s ',
67 | checked( 0, $key, false ),
68 | $type,
69 | esc_attr( 'edd_price_option_' . $download_id . '_' . $key ),
70 | esc_attr( 'edd_price_option_' . $download_id ),
71 | esc_attr( $key ),
72 | esc_html( $price['name'] . ' - ' . edd_currency_filter( edd_format_amount( $price[ 'amount' ] ) ) ),
73 | selected( isset( $_GET['price_option'] ), $key, false )
74 | );
75 | do_action( 'edd_after_price_option', $key, $price, $download_id );
76 | }
77 | echo ' ';
78 | }
79 | do_action( 'edd_after_price_options_list', $download_id, $prices, $type );
80 |
81 | echo '';
82 | do_action( 'edd_after_price_options', $download_id );
83 |
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/includes/class-maera-edd-scripts.php:
--------------------------------------------------------------------------------
1 | post_id = $post_id;
14 |
15 | }
16 |
17 | /**
18 | * Build CSS from Tonesque
19 | *
20 | * @uses get_the_ID(), is_single(), get_post_meta(), colorposts_get_post_image(), update_post_meta(), apply_filters()
21 | *
22 | * @since Color Posts 1.0
23 | */
24 | function colors() {
25 |
26 | $thumb_id = get_post_thumbnail_id( $this->post_id );
27 | $thumb_url = wp_get_attachment_image_src( $thumb_id );
28 | $thumb_url = $thumb_url[0];
29 | $value = array();
30 |
31 | if ( $thumb_url ) {
32 | // Grab color from post meta
33 | $tonesque = get_post_meta( $thumb_id, '_post_colors', true );
34 |
35 | // No color? Let's get one
36 | if ( empty( $tonesque ) ) {
37 | $tonesque = new Tonesque( $thumb_url );
38 | $tonesque = array(
39 | 'color' => $tonesque->color(),
40 | 'contrast' => $tonesque->contrast(),
41 | );
42 |
43 | if ( $tonesque['color'] ) {
44 | update_post_meta( $this->post_id, '_post_colors', $tonesque );
45 | } else {
46 | return;
47 | }
48 | }
49 |
50 | extract( $tonesque );
51 | }
52 | if ( ! isset( $color ) || ! $color ) {
53 | $color = 'FFFFFF';
54 | }
55 |
56 | $value['color'] = '#' . $color;
57 |
58 | $white = new Jetpack_Color( '#FFFFFF' );
59 | $color = new Jetpack_Color( '#' . $color );
60 | $value['luminosity'] = $color->toLuminosity();
61 |
62 | $value['fontcolor'] = ( $value['luminosity'] < 0.5 ) ? '#FFFFFF' : '#222222';
63 | $value['readable'] = '#' . $color->getReadableContrastingColor( $white, 6 )->toHex();
64 |
65 | return $value;
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/includes/class-maera-edd.php:
--------------------------------------------------------------------------------
1 | esc_html__( 'Primary Navigation', 'maera' )
71 | ) );
72 |
73 | // Add post thumbnails ( http://codex.wordpress.org/Post_Thumbnails )
74 | add_theme_support( 'post-thumbnails' );
75 |
76 | // Add post formats ( http://codex.wordpress.org/Post_Formats )
77 | add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) );
78 |
79 | // Enable support for HTML5 markup.
80 | add_theme_support( 'html5', array(
81 | 'comment-list',
82 | 'search-form',
83 | 'comment-form',
84 | 'gallery',
85 | 'caption',
86 | ) );
87 |
88 | // Tell the TinyMCE editor to use a custom stylesheet
89 | add_editor_style( '/assets/css/editor-style.css' );
90 |
91 | // Add title-tag support (introduced in WP 4.1)
92 | add_theme_support( 'title-tag' );
93 |
94 | // Add WooCommerce support
95 | add_theme_support( 'woocommerce' );
96 |
97 | // site-logo is included in Jetpack 3.2 and above
98 | add_theme_support( 'site-logo' );
99 |
100 | $lang_dir = get_template_directory() . '/languages';
101 | $custom_path = WP_LANG_DIR . '/maera-' . get_locale() . '.mo';
102 |
103 | if ( file_exists( $custom_path ) ) {
104 | load_textdomain( 'maera', $custom_path );
105 | } else {
106 | load_theme_textdomain( 'maera', false, $lang_dir );
107 | }
108 | }
109 |
110 | function render_title() {
111 | if ( ! function_exists( '_wp_render_title_tag' ) ) : ?>
112 |
113 | plugins = $plugins;
10 |
11 | add_action( 'admin_notices', array( $this, 'required_plugins_notices' ) );
12 |
13 | add_filter( 'maera/plugins/required', array( $this, 'add_filter' ) );
14 |
15 | }
16 |
17 | function add_filter( $required_plugins ) {
18 | return array_merge( $required_plugins, $this->plugins );
19 | }
20 |
21 | /**
22 | * Test if all required plugins are active or not.
23 | * If they are not, returns true;
24 | */
25 | public function test_missing() {
26 |
27 | $plugins = apply_filters( 'maera/plugins/required', array() );
28 | $status = get_transient( 'maera_required_plugins_status' );
29 |
30 | // If the transient exists and is set to 'ok' then no need to proceed.
31 | if ( false === $status && 'ok' == $status ) {
32 | return 'ok';
33 | }
34 |
35 | if ( ! function_exists( 'is_plugin_active' ) ) {
36 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
37 | }
38 |
39 | foreach ( $plugins as $plugin ) {
40 | if ( ! is_plugin_active( $plugin['slug'] . '/' . $plugin['file'] ) ) {
41 | return 'bad';
42 | }
43 | }
44 |
45 | // If we're good to go, set the transient value to 'ok' for 2 minutes
46 | set_transient( 'maera_required_plugins_status', 'ok', 60 * 2 );
47 |
48 | return 'ok';
49 |
50 | }
51 |
52 | /**
53 | * Add the admin notices for the required plugins
54 | */
55 | function required_plugins_notices() {
56 |
57 | $plugin_messages = array();
58 |
59 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
60 |
61 | foreach ( $this->plugins as $plugin ) {
62 | $install_link = 'Install and activate ' . $plugin['name'] . ' ';
63 | if ( ! is_plugin_active( $plugin['slug'] . '/' . $plugin['file'] ) ) {
64 | $plugin_url = 'https://wordpress.org/plugins/' . $plugin['slug'] . '/';
65 | $install_url = self_admin_url( 'update.php?action=install-plugin&plugin=' . $plugin['slug'] . '&_wpnonce=install-plugin_' . $plugin['slug'] );
66 | $plugin_messages[] = 'This theme requires you to install and activate the ' . $plugin['name'] . ' plugin, ' . $install_link . '.';
67 | }
68 | }
69 |
70 | if ( 0 < count( $plugin_messages ) ) {
71 | echo '';
72 |
73 | foreach( $plugin_messages as $message ) {
74 | echo '
' . $message . '
';
75 | }
76 |
77 | echo '
';
78 | }
79 |
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/includes/class-maera-styles.php:
--------------------------------------------------------------------------------
1 | plugins->test_missing() ) {
16 | get_template_part( 'lib/required-error' );
17 | return;
18 | }
19 |
20 | }
21 |
22 | /**
23 | * Get the header.
24 | */
25 | public function header() {
26 | get_header();
27 | }
28 |
29 | /**
30 | * Old, naming, this is just a fallback to the render() method.
31 | */
32 | public function main( $templates = null, $context = null ) {
33 | $this->render( $templates, $context );
34 | }
35 |
36 | /**
37 | * Render a template
38 | * This will render the necessary twig template
39 | */
40 | public function render( $templates = null, $context = null ) {
41 |
42 | if ( is_null( $templates ) ) {
43 | $templates = apply_filters( 'maera/templates', array() );
44 | }
45 |
46 | if ( is_null( $context ) ) {
47 | $context = $this->context();
48 | }
49 |
50 | Timber::render(
51 | $templates,
52 | $context,
53 | Maera()->cache->cache_duration(),
54 | Maera()->cache->cache_mode()
55 | );
56 |
57 | }
58 |
59 | /**
60 | * Get the footer
61 | */
62 | public function footer() {
63 | get_footer();
64 | }
65 |
66 | /**
67 | * Determine the context that will be used by the content() method
68 | */
69 | public function context() {
70 |
71 | global $wp_query;
72 |
73 | $context = Maera()->cache->get_context();
74 | $post = new TimberPost();
75 | $context['post'] = $post;
76 | $context['posts'] = Timber::get_posts();
77 |
78 | // Compatibility hack or plugins that change the content.
79 | if ( $this->plugins_compatibility() ) {
80 | $context['content'] = maera_get_echo( 'the_content' );
81 | }
82 |
83 | if ( is_singular() ) {
84 | $context['wp_title'] .= ' - ' . $post->title();
85 | }
86 |
87 | if ( is_search() ) {
88 | $context['title'] = esc_html__( 'Search results for ', 'maera' ) . get_search_query();
89 | }
90 |
91 | if ( is_archive() || is_home() ) {
92 | $context['posts'] = Timber::query_posts( false, 'TimberPost' );
93 | $context['title'] = get_the_archive_title();
94 |
95 | if ( is_author() ) {
96 | $author = new TimberUser( $wp_query->query_vars['author'] );
97 | $context['author'] = $author;
98 | }
99 |
100 | }
101 |
102 | if ( class_exists( 'WooCommerce' ) ) {
103 | global $product;
104 | $context['product'] = $product;
105 | }
106 |
107 | return $context;
108 | }
109 |
110 | /**
111 | * Add compatibility for some plugins.
112 | */
113 | public function plugins_compatibility() {
114 |
115 | $compatibility = false;
116 |
117 | // bbPress
118 | $compatibility = function_exists( 'is_bbpress' ) && is_bbpress() ? true : $compatibility;
119 | // BuddyPress
120 | $compatibility = function_exists( 'is_buddypress' ) && is_buddypress() ? true : $compatibility;
121 |
122 | return apply_filters( 'maera/template/plugin_compatibility', $compatibility );
123 |
124 | }
125 |
126 | }
127 |
--------------------------------------------------------------------------------
/includes/class-maera-timber.php:
--------------------------------------------------------------------------------
1 | 'ul', 'reply_text' => esc_html__('Reply','maera'), 'short_ping' => true, 'avatar_size' => 60);
46 | $context['site_logo'] = get_option( 'site_logo', false );
47 | $context['content_width'] = $content_width;
48 |
49 | $context['sidebar_template'] = maera_templates_sidebar();
50 |
51 | if ( class_exists( 'Easy_Digital_Downloads' ) ) {
52 | $data['edd_options'] = $edd_options;
53 | $data['download_categories'] = Timber::get_terms( 'download_category' );
54 | $data['download_tags'] = Timber::get_terms( 'download_tag' );
55 | $data['default_image'] = new TimberImage( get_template_directory_uri() . '/assets/images/default.png' );
56 |
57 | }
58 |
59 | return apply_filters( 'maera/timber/context', $context );
60 |
61 | }
62 |
63 | /**
64 | * An array of paths containing our twig files.
65 | * First we search in the childtheme if one is active.
66 | * Then we continue looking for the twig file in the active shell
67 | * and finally fallback to the core twig files.
68 | */
69 | public function twig_locations() {
70 |
71 | $locations = array();
72 | $location_roots = array();
73 |
74 | // Are we using a child theme?
75 | // If yes, then first look in there.
76 | if ( is_child_theme() ) {
77 | $location_roots[] = get_stylesheet_directory();
78 | }
79 | // Active shell
80 | $location_roots[] = MAERA_SHELL_PATH;
81 | // Core twig locations.
82 | $location_roots[] = get_template_directory();
83 | // Allow modifying they location roots using a filter
84 | $location_roots = apply_filters( 'maera/timber/locations/roots', $location_roots );
85 |
86 | foreach ( $location_roots as $location_root ) {
87 | if ( class_exists( 'Easy_Digital_Downloads' ) ) {
88 | $locations[] = $location_root . '/views/edd';
89 | }
90 | if ( class_exists( 'WooCommerce' ) ) {
91 | $locations[] = $location_root . '/views/woocommerce';
92 | }
93 | $locations[] = $location_root . '/macros';
94 | $locations[] = $location_root . '/views/macros';
95 | $locations[] = $location_root . '/views';
96 | $locations[] = $location_root;
97 | }
98 |
99 | return apply_filters( 'maera/timber/locations', $locations );
100 |
101 | }
102 |
103 | /**
104 | * Apply global Timber customizations
105 | */
106 | function timber_customizations() {
107 |
108 | global $wp_customize;
109 |
110 | $locations = $this->twig_locations();
111 | Timber::$locations = $locations;
112 |
113 | }
114 |
115 | /**
116 | * Enable Twig_Extension_StringLoader.
117 | * This allows us to use template_from_string() in our templates.
118 | *
119 | * See http://twig.sensiolabs.org/doc/functions/template_from_string.html for details
120 | */
121 | function add_to_twig( $twig ){
122 | $twig->addExtension( new Twig_Extension_StringLoader() );
123 | return $twig;
124 | }
125 |
126 | }
127 |
--------------------------------------------------------------------------------
/includes/class-maera-widget-dropdown-class.php:
--------------------------------------------------------------------------------
1 | 'maera_widget_width',
8 | * 'label' => esc_html__( 'Width', 'maera' ),
9 | * 'default' => 12,
10 | * 'choices' => array(
11 | * 12 => array( 'label' => 'Full', 'classes' => 'col s12' ),
12 | * 3 => array( 'label' => '1 Quarter', 'classes' => 'col s12 m12 l3' ),
13 | * 4 => array( 'label' => '1 Third', 'classes' => 'col s12 m12 l4' ),
14 | * 6 => array( 'label' => 'Half', 'classes' => 'col s12 m12 l6' ),
15 | * 8 => array( 'label' => '3 quarters', 'classes' => 'col s12 m12 l8' ),
16 | * 9 => array( 'label' => '2 Thirds', 'classes' => 'col s12 m12 l9' ),
17 | * ),
18 | * ));
19 | *
20 | */
21 |
22 | /**
23 | * Creates a dropdown in each widget and then adds the selected options as a CSS class
24 | */
25 | class Maera_Widget_Dropdown_Class {
26 |
27 | private $id;
28 | private $label;
29 | private $choices;
30 | private $default;
31 |
32 | function __construct( $args = array() ) {
33 |
34 | // Early exit if an argument is missing
35 | if ( ! isset( $args['id'] ) || ! isset( $args['label'] ) || ! isset( $args['choices'] ) || ! isset( $args['default'] ) ) {
36 | return;
37 | }
38 |
39 | $this->id = $args['id'];
40 | $this->label = $args['label'];
41 | $this->choices = $args['choices'];
42 | $this->default = $args['default'];
43 |
44 | add_action( 'in_widget_form', array( $this, 'in_widget_form' ), 10, 3 );
45 | add_filter( 'widget_update_callback', array( $this, 'widget_update_callback' ), 10, 2 );
46 | add_filter( 'dynamic_sidebar_params', array( $this, 'dynamic_sidebar_params' ) );
47 |
48 | }
49 |
50 | function dynamic_sidebar_params( $params ) {
51 |
52 | global $wp_registered_widgets;
53 |
54 | $widget_id = $params[0]['widget_id'];
55 | $widget_obj = $wp_registered_widgets[$widget_id];
56 | $widget_opt = get_option( $widget_obj['callback'][0]->option_name );
57 | $widget_num = $widget_obj['params'][0]['number'];
58 |
59 | $option = ( isset( $widget_opt[$widget_num][$this->id] ) ) ? $widget_opt[$widget_num][$this->id] : $this->default;
60 | $value = isset( $this->choices[$option]['classes'] ) ? $this->choices[$option]['classes'] : '';
61 |
62 | preg_match( '/(\<[a-zA-Z]+)(.*?)(\>)/', $params[0]['before_widget'], $mat );
63 |
64 | if ( isset( $value ) && ! empty( $value ) && $value != -1 ) {
65 | if ( preg_match( '/class="/', $params[0]['before_widget'] ) ) {
66 | $params[0]['before_widget'] = preg_replace( '/class="/', "class=\"{$value} ", $params[0]['before_widget'], 1 );
67 | }else{
68 | $params[0]['before_widget'] = preg_replace( '/(\<[a-zA-Z]+)(.*?)(\>)/', "$1 $2 class=\"{$value}\" $3", $params[0]['before_widget'], 1 );
69 | }
70 | }
71 |
72 | return $params;
73 |
74 | }
75 |
76 | function widget_update_callback( $instance, $new_instance ) {
77 |
78 | $instance[$this->id] = $new_instance[$this->id];
79 | return $instance;
80 |
81 | }
82 |
83 | function in_widget_form( $widget, $return, $instance ) {
84 |
85 | $choices = $this->choices;
86 |
87 | $instance[$this->id] = ( ! isset( $instance[$this->id] ) ) ? $this->default : $instance[$this->id];
88 | ?>
89 |
90 |
91 | label; ?>
92 |
93 |
94 | $options ) : ?>
95 |
96 | id], $choice) ?>
97 |
98 |
99 |
100 | shell = new Maera_Shell();
27 | $this->timber = new Maera_Timber();
28 | $this->styles = new Maera_Styles();
29 | $this->dev = new Maera_Development();
30 | $this->cache = new Maera_Caching();
31 | $this->cc = new Maera_Core_Customizer();
32 | $this->views = new Maera_Template();
33 | $this->template = $this->views;
34 | $this->plugins = new Maera_Required_Plugins( $this->required_plugins() );
35 | $this->admin = new Maera_Admin();
36 |
37 | // This is not ready yet so hide it.
38 | // For dev you can add this line to your wp-config.php file:
39 | // define( 'MAERA_HIDE_CORE_CUSTOMIZER', false );
40 | if ( ! defined( 'MAERA_HIDE_CORE_CUSTOMIZER' ) ) {
41 | define( 'MAERA_HIDE_CORE_CUSTOMIZER', true );
42 | }
43 |
44 | add_action( 'wp', array( $this, 'updates' ) );
45 |
46 | }
47 |
48 | public static function get_instance() {
49 | if ( null == self::$instance ) {
50 | self::$instance = new self;
51 | }
52 |
53 | return self::$instance;
54 | }
55 |
56 | /**
57 | * The configuration options for the Kirki Customizer
58 | */
59 | function customizer_config() {
60 |
61 | $args = array(
62 | 'stylesheet_id' => 'maera',
63 | // 'color_active' => '#ffab00',
64 | // 'color_light' => '#ffc107',
65 | // 'color_select' => '#ff9800',
66 | // 'color_accent' => '#ff5722',
67 | // 'color_back' => '#222',
68 | );
69 |
70 | return $args;
71 |
72 | }
73 |
74 | /**
75 | * Build the array of required plugins.
76 | * You can use the 'maera/required_plugins' filter to add or remove plugins.
77 | */
78 | function required_plugins() {
79 |
80 | $plugins = array(
81 | array( 'name' => 'Timber', 'file' => 'timber.php', 'slug' => 'timber-library' ),
82 | array( 'name' => 'Jetpack', 'file' => 'jetpack.php', 'slug' => 'jetpack' ),
83 | );
84 |
85 | if ( current_theme_supports( 'breadcrumbs' ) ) {
86 | $plugins[] = array( 'name' => 'Breadcrumb Trail', 'file' => 'breadcrumb-trail.php', 'slug' => 'breadcrumb-trail' );
87 | }
88 |
89 | if ( current_theme_supports( 'less_compiler' ) || current_theme_supports( 'sass_compiler' ) ) {
90 | $plugins[] = array( 'name' => 'Less & scss compilers', 'file' => 'less-plugin.php', 'slug' => 'lessphp' );
91 | }
92 |
93 | $jetpack_active_modules = get_option( 'jetpack_active_modules' );
94 | if ( isset( $jetpack_active_modules['photon'] ) && $jetpack_active_modules['photon'] ) {
95 | $plugins[] = array( 'name' => 'Timber with Jetpack Photon', 'file' => 'TimberPhoton.php', 'slug' => 'timber-with-jetpack-photon' );
96 | }
97 |
98 | return $plugins;
99 |
100 | }
101 |
102 |
103 | /**
104 | * We can handle any db updates here for backwards-compatibility
105 | */
106 | function updates() {
107 |
108 | $options = get_option( 'maera_admin_options', array() );
109 | if ( !isset( $options['maera_version'] ) ) {
110 | $options['maera_version'] = MAERA_VERSION;
111 | update_option( 'maera_admin_options', $options );
112 | }
113 |
114 | if( get_option( 'maera_version' ) ) {
115 | delete_option( 'maera_version' );
116 | }
117 |
118 | }
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/includes/required-error.php:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/includes/widgets.php:
--------------------------------------------------------------------------------
1 | ' );
10 | $after_title = apply_filters( 'maera/widgets/title/after', '' );
11 |
12 | // Sidebars
13 | register_sidebar( array(
14 | 'name' => esc_html__( 'Primary Sidebar', 'maera' ),
15 | 'id' => 'sidebar_primary',
16 | 'before_widget' => apply_filters( 'maera/widgets/before', '' ),
18 | 'before_title' => $before_title,
19 | 'after_title' => $after_title,
20 | ) );
21 |
22 | }
23 | add_action( 'widgets_init', 'maera_widgets_init' );
24 |
--------------------------------------------------------------------------------
/includes/widgets/extended-posts/assets/script.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | // Inside of this function, $() will work as an alias for jQuery()
3 | // and other libraries also using $ will not be accessible under this shortcut
4 | })(jQuery);
--------------------------------------------------------------------------------
/includes/widgets/extended-posts/assets/style.css:
--------------------------------------------------------------------------------
1 | /**
2 | * For modern browsers
3 | * 1. The space content is one way to avoid an Opera bug when the
4 | * contenteditable attribute is included anywhere else in the document.
5 | * Otherwise it causes space to appear at the top and bottom of elements
6 | * that are clearfixed.
7 | * 2. The use of `table` rather than `block` is only necessary if using
8 | * `:before` to contain the top-margins of child elements.
9 | */
10 | .clearfix:before,
11 | .clearfix:after {
12 | content: " "; /* 1 */
13 | display: table; /* 2 */
14 | }
15 |
16 | .clearfix:after {
17 | clear: both;
18 | }
19 |
20 | /**
21 | * For IE 6/7 only
22 | * Include this rule to trigger hasLayout and contain floats.
23 | */
24 | .clearfix {
25 | *zoom: 1;
26 | }
27 |
28 | .pull-left {
29 | float: left;
30 | }
31 |
--------------------------------------------------------------------------------
/includes/widgets/extended-posts/extended-posts.php:
--------------------------------------------------------------------------------
1 | esc_html__( 'Maera logo widget.', 'maera' ) )
25 | );
26 | }
27 |
28 |
29 | /**
30 | * Render the widget on the back end.
31 | * @todo TODO
32 | * @since 1.0.0
33 | */
34 | function form( $instance ) {
35 | ?>
36 |
37 | views->render( 'site-logo.twig' );
53 |
54 | echo $args['after_widget'];
55 |
56 | }
57 |
58 |
59 | /**
60 | * Widget instance update.
61 | * @todo TODO
62 | * @since 1.0.0
63 | */
64 | function update( $new_instance, $old_instance ) {
65 | $instance = array();
66 | $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
67 | return $instance;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/includes/widgets/logo/logo.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
15 |
16 | Maera()->views->header();
17 | Maera()->views->render();
18 | Maera()->views->footer();
19 |
--------------------------------------------------------------------------------
/languages/maera-en_US.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codemonkey-jack/maera/70530cfab1a4ed1b59af96ee43de7dedfac418bc/languages/maera-en_US.mo
--------------------------------------------------------------------------------
/page.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
21 |
22 | Maera()->views->header();
23 | Maera()->views->render();
24 | Maera()->views->footer();
25 |
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | === Maera ===
2 |
3 | [Maera](#) is a developer-friendly theme that allows you to quickly prototype sites and extend it with your own custom plugins.
4 |
5 | == Instructions ==
6 |
7 | Maera includes a blogging shell. You can get more shells from https://press.codes/
8 |
9 | == Limitations ==
10 |
11 | Maera Requires you to install these plugins:
12 | * [Timber Library](https://wordpress.org/plugins/timber-library/)
13 | * [Jetpack](https://wordpress.org/plugins/jetpack/)
14 | * [Kirki](https://wordpress.org/plugins/kirki/)
15 |
16 | Additional plugins may depend on other plugins and in that case you will be notified from your dashboard
17 |
18 | == Credits ==
19 |
20 | * [_s](https://github.com/Automattic/_s) theme by Automattic, and released under the GPL v2.0.
21 | * [html5shiv](http://code.google.com/p/html5shiv/) script by Remy Sharp, and is dual-licensed under the MIT or GPL Version 2 licenses.
22 |
23 | == Browser Support ==
24 |
25 | Chrome, Firefox, Safari and IE10+ are supported. IE7, IE8 and IE9 are not supported.
26 |
27 | == Changelog ==
28 |
29 | = 2.0 =
30 |
31 | * Fix Multiple DB options
32 | * Fix Template Tag Archive function
33 | * Fix styling of categories when there are 20+ resulting in grouped up categories
34 | * Add post tag display
35 | * Fix Attachment Pages
36 | * Add styling for [audio] and [video] shortcodes
37 | * Fix password protected posts
38 | * Add styling for quote tags
39 | * Fix readability of Byline
40 | * Fix archive page titles
41 | * Add styling for [gallery] shortcode
42 | * Fix multiple responsive issues
43 | * Modify/Fix script registration
44 | * Fix translation and strings
45 | * Fix hardcoding of some scripts
46 | * Add extra sanitzation checks to edd templates and core shell
47 | * Fix missing sanitization for theme Customizer options
48 | * Fix wrong filenames
49 | * Fix multiple issues with translations and textdomains using incorrect functions and missing text domain
50 | * Add support for core WordPress CSS classes
51 | * Fix styling on comments
52 | * Fix styling on widgets
53 |
54 | = 1.4 =
55 |
56 | * Fix searchform.twig causing internal server errors
57 | * Remove search filter breaking external search plugins
58 | * Fix use correct function for locating files
59 | * Fix multiple warnings
60 | * Modification: No Longer require Kirki for the core framework
61 | * Remove admin notice about the add-ons tabs that was removed in prior versions
62 | * Modification: Stop auto-activating plugins
63 | * Remove un-needed jQuery enqueue
64 | * Remove Kirki as an embedded plugin
65 | * Remove Timber as an embedded plugin
66 |
67 | = 1.3 =
68 |
69 | * Bug Fixes
70 |
71 | = 1.2 =
72 |
73 | * New: Kirki & Timber plugins as well as some Jetpack classes are now embedded. Installing external plugins is no longer required for the core theme.
74 | * New: Easy-Digital-Downloads integration
75 | * New: WooCommerce integration
76 | * Fix: Core shell CSS tweaks
77 | * Fix: Change sr-only class to screen-reader-text
78 | * New: Implemented a class autoloader
79 | * Tweak: Deactivate auto-installer
80 | * Tweak: Use dashicons instead of elusive icons
81 | * Tweak: Keep pagination links as anchors
82 | * Fix: Properly use add_query_arg()
83 | * Tweak: Comments template
84 | * Fix: fix incorrect path URLs
85 | * Tweak: better template-hierarchy.php
86 | * Tweak: WordPress coding standards
87 | * Fix: Other minor bugfixes
88 | * Tweak: Add before_widget & after_widget to the logo widget
89 | * Fix: Align left images on the extended-posts widget
90 |
91 | = 1.1.1 =
92 |
93 | * Fix: Added a default license key
94 | * New: More OOP design
95 | * New: Change the Timber cache folder (soon to be supported by Timber core)
96 | * Fix: Undefined index messages on the admin settings screen
97 | * New: Introducing Maera_Widget_Dropdown_Class.php
98 | * Fix: Move core styles to style.css
99 |
100 | = 1.1.0 =
101 |
102 | * Fix: Most methods are not non-static.
103 | * New: The theme is now more OOP.
104 | * New: You can now choose a caching method from the admin options.
105 | * Fix: Disabling file caches (there were issues on sites hosted on WPEngine).
106 | * Fix: Updating the Maera_Logo_Widget rendering method.
107 | * Fix: Typo preventing proper template rendering for tag archives.
108 | * Fix: Added check for MAERA_VERSION constant.
109 | * Fix: Code cleanup.
110 | * New: Introducing a Maera_Helper class.
111 | * Fix: Move file requires outside the main Maera object.
112 | * Fix: Moved test_missing method to the Maera_Required_Plugins class.
113 | * Fix: Moved get_search_form method to the Maera_Template class.
114 | * Fix: Moved body_class method to the Maera_Styles class.
115 | * Fix: Renamed the Maera_Template->main method to Maera_Template->render.
116 | * New: Introducing new "screen-reader-text" classes as per https://make.wordpress.org/accessibility/2015/01/27/test-chat-summary-januari-26/
117 |
118 | = 1.0.3 =
119 |
120 | * Fix: Jetpack was being forced to Dev mode some hosts even when dev mode was disabled from the theme options dashboard.
121 |
122 | = 1.0.2 =
123 |
124 | * Fix: remote-installer scripts were not loading properly
125 |
126 | = 1.0.1 =
127 |
128 | * Fix: typo preventing automatic updates
129 |
130 | = 1.0.0 =
131 |
132 | * Initial release
133 |
--------------------------------------------------------------------------------
/rtl.css:
--------------------------------------------------------------------------------
1 | /*
2 | Theme Name: maera
3 |
4 | Adding support for language written in a Right To Left (RTL) direction is easy -
5 | it's just a matter of overwriting all the horizontal positioning attributes
6 | of your CSS stylesheet in a separate stylesheet file named rtl.css.
7 |
8 | http://codex.wordpress.org/Right_to_Left_Language_Support
9 |
10 | */
11 |
12 | /*
13 | body {
14 | direction: rtl;
15 | unicode-bidi: embed;
16 | }
17 | */
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codemonkey-jack/maera/70530cfab1a4ed1b59af96ee43de7dedfac418bc/screenshot.png
--------------------------------------------------------------------------------
/search.php:
--------------------------------------------------------------------------------
1 |
2 | views->dependencies();
10 |
11 | Maera()->views->header();
12 | Maera()->views->render();
13 | Maera()->views->footer();
14 |
--------------------------------------------------------------------------------
/single.php:
--------------------------------------------------------------------------------
1 | views->dependencies();
9 |
10 | Maera()->views->header();
11 | Maera()->views->render();
12 | Maera()->views->footer();
13 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | /*
2 | Theme Name: Maera
3 | Theme URI: https://wpsatchel.com
4 | Description: Advanced WordPress theme based on Bootstrap.
5 | Version: 2.0
6 | Author: WPSatchel
7 | Contributers: aristath, fovoc
8 | Author URI: https://wpsatchel.com
9 | License: GPL v2 License
10 | License URI: http://www.gnu.org/licenses/gpl.html
11 | Tags: dark, light, one-column, two-columns, left-sidebar, right-sidebar, fluid-layout, custom-background, custom-colors, custom-header, custom-menu, editor-style, microformats, rtl-language-support, holiday, seasonal
12 | Text Domain: maera
13 | */
14 |
15 | /* =WordPress Core
16 | -------------------------------------------------------------- */
17 | .alignnone {
18 | margin: 5px 20px 20px 0;
19 | }
20 |
21 | .aligncenter,
22 | div.aligncenter {
23 | display: block;
24 | margin: 5px auto 5px auto;
25 | }
26 |
27 | .alignright {
28 | float:right;
29 | margin: 5px 0 20px 20px;
30 | }
31 |
32 | .alignleft {
33 | float: left;
34 | margin: 5px 20px 20px 0;
35 | }
36 |
37 | a img.alignright {
38 | float: right;
39 | margin: 5px 0 20px 20px;
40 | }
41 |
42 | a img.alignnone {
43 | margin: 5px 20px 20px 0;
44 | }
45 |
46 | a img.alignleft {
47 | float: left;
48 | margin: 5px 20px 20px 0;
49 | }
50 |
51 | a img.aligncenter {
52 | display: block;
53 | margin-left: auto;
54 | margin-right: auto
55 | }
56 |
57 | .wp-caption {
58 | background: #fff;
59 | border: 1px solid #f0f0f0;
60 | max-width: 96%; /* Image does not overflow the content area */
61 | padding: 5px 3px 10px;
62 | text-align: center;
63 | }
64 |
65 | .wp-caption.alignnone {
66 | margin: 5px 20px 20px 0;
67 | }
68 |
69 | .wp-caption.alignleft {
70 | margin: 5px 20px 20px 0;
71 | }
72 |
73 | .wp-caption.alignright {
74 | margin: 5px 0 20px 20px;
75 | }
76 |
77 | .wp-caption img {
78 | border: 0 none;
79 | height: auto;
80 | margin: 0;
81 | max-width: 98.5%;
82 | padding: 0;
83 | width: auto;
84 | }
85 |
86 | .wp-caption p.wp-caption-text {
87 | font-size: 11px;
88 | line-height: 17px;
89 | margin: 0;
90 | padding: 0 4px 5px;
91 | }
92 |
93 | /* Text meant only for screen readers. */
94 | .screen-reader-text {
95 | clip: rect(1px, 1px, 1px, 1px);
96 | position: absolute !important;
97 | height: 1px;
98 | width: 1px;
99 | overflow: hidden;
100 | }
101 |
102 | .screen-reader-text:hover,
103 | .screen-reader-text:active,
104 | .screen-reader-text:focus {
105 | background-color: #f1f1f1;
106 | border-radius: 3px;
107 | box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
108 | clip: auto !important;
109 | color: #21759b;
110 | display: block;
111 | font-size: 14px;
112 | font-size: 0.875rem;
113 | font-weight: bold;
114 | height: auto;
115 | left: 5px;
116 | line-height: normal;
117 | padding: 15px 23px 14px;
118 | text-decoration: none;
119 | top: 5px;
120 | width: auto;
121 | z-index: 100000; /* Above WP toolbar. */
122 | }
123 |
124 | .clearfix:before,
125 | .clearfix:after {
126 | content: " ";
127 | display: table;
128 | }
129 | .clearfix:after {
130 | clear: both;
131 | }
132 | .pp_woocommerce {
133 | top: 0 !important;
134 | }
135 |
136 |
137 | .sticky {}
138 | .gallery-caption {}
139 | .bypostauthor {}
140 |
--------------------------------------------------------------------------------
/taxonomy-download_category.php:
--------------------------------------------------------------------------------
1 |
5 | {% for post in posts %}
6 | {% if fn('post_password_required', post.ID) %}
7 | {% include ['content-protected.twig'] %}
8 | {% else %}
9 | {% include ['content-'~post.ID~'.twig', 'content-'~post.post_type~'.twig', 'content.twig'] %}
10 | {% endif %}
11 | {{ function( 'wp_link_pages', { 'before': '' . fn( 'esc_html__', 'Pages:', 'maera' ), 'after': '
' }) }}
12 |
13 | {% endfor %}
14 |
15 |
16 | {% endblock %}
17 |
--------------------------------------------------------------------------------
/views/attachment.twig:
--------------------------------------------------------------------------------
1 | {% extends "main.twig" %}
2 | {% block content %}
3 |
4 |
5 | {% for post in posts %}
6 | {% include ['content-attachment-'~post.ID~'.twig', 'content-attachment-'~post.post_type~'.twig', 'content-attachment.twig'] %}
7 | {{ function( 'wp_link_pages', { 'before': '
' . fn( 'esc_html__', 'Pages:', 'maera' ), 'after': '
' }) }}
8 |
9 | {% endfor %}
10 |
11 |
12 | {% endblock %}
13 |
--------------------------------------------------------------------------------
/views/author.twig:
--------------------------------------------------------------------------------
1 | {#
8 | {% do action( 'maera/content/before', post.ID ) %}
9 |
10 |
11 |
12 | {% do action( 'maera/main/before', post.ID ) %}
13 | {% block main %}{{ fn( 'esc_html__', 'Sorry, no content', 'maera' ) }}{% endblock %}
14 | {% do action( 'maera/main/after', post.ID ) %}
15 | {% include 'sidebar.twig'|apply_filters('maera/sidebar_template') %}
16 |
17 |
18 |
19 |
20 | {% do action( 'maera/content/after' ) %}
21 |
22 |
--------------------------------------------------------------------------------
/views/bbp.twig:
--------------------------------------------------------------------------------
1 | {#
7 |
8 |
9 |
10 | {{ content }}
11 | {% do action( 'maera/page/after_content' ) %}
12 |
13 |
14 |
15 |
16 |
17 | {% endblock %}
18 |
--------------------------------------------------------------------------------
/views/bp.twig:
--------------------------------------------------------------------------------
1 | {#
7 |
8 |
9 |
10 | {{ content }}
11 | {% do action( 'maera/page/after_content' ) %}
12 |
13 |
14 |
15 |
16 |
17 | {% endblock %}
18 |
--------------------------------------------------------------------------------
/views/comments.twig:
--------------------------------------------------------------------------------
1 | {#
5 |
6 | {% if post.comment_status == 'closed' %}
7 | {{ alert('warning', fn( 'esc_html__', 'Comments are closed.', 'maera' ), false, 'comments-disabled', false) }}
8 | {% endif %}
9 |
10 |
11 |
{{ fn( 'esc_html__', 'Comments', 'maera' ) }}
12 |
13 | {% if post.comments %}
14 | {{ function( 'wp_list_comments', comments_args ) }}
15 | {% endif %}
16 |
17 | {{ comment_form }}
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/views/content-attachment-entry-content.twig:
--------------------------------------------------------------------------------
1 |
2 | {% do action( 'maera/attachment/pre_content', post.ID ) %}
3 | {{ post.content }}
4 | {% do action( 'maera/attachment/after_content', post.ID ) %}
5 |
6 |
--------------------------------------------------------------------------------
/views/content-attachment-entry-download-meta.twig:
--------------------------------------------------------------------------------
1 | {# This file is empty on purpose. #}
2 |
--------------------------------------------------------------------------------
/views/content-attachment-entry-footer.twig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codemonkey-jack/maera/70530cfab1a4ed1b59af96ee43de7dedfac418bc/views/content-attachment-entry-footer.twig
--------------------------------------------------------------------------------
/views/content-attachment-entry-header.twig:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/views/content-attachment-entry-meta.twig:
--------------------------------------------------------------------------------
1 |
2 | {% if function('get_the_time', 'U', post) is same as(post.get_modified_time('U')) %}
3 |
4 | {{ post.date }}
5 |
6 | {% else %}
7 |
8 | {{ post.modified_date }}
9 |
10 | {% endif %}
11 |
{{ fn( 'esc_html__', 'by', 'maera' ) }} {{ post.author.name }}
12 |
13 |
--------------------------------------------------------------------------------
/views/content-attachment.twig:
--------------------------------------------------------------------------------
1 |
2 | {% do action( 'maera/attachment/top', post.ID ) %}
3 | {% include ['content-attachment-entry-'~post.ID~'-header.twig', 'content-attachment-entry-'~post.post_type~'-header.twig', 'content-attachment-entry-header.twig'] %}
4 | {% include ['content-attachment-entry-'~post.ID~'-meta.twig', 'content-attachment-entry-'~post.post_type~'-meta.twig', 'content-attachment-entry-meta.twig'] %}
5 | {% include ['content-attachment-entry-'~post.ID~'-content.twig', 'content-attachment-entry-'~post.post_type~'-content.twig', 'content-attachment-entry-content.twig'] %}
6 | {% include ['content-attachment-entry-'~post.ID~'-footer.twig', 'content-attachment-entry-'~post.post_type~'-footer.twig', 'content-attachment-entry-footer.twig'] %}
7 |
8 |
--------------------------------------------------------------------------------
/views/content-entry-content-protected.twig:
--------------------------------------------------------------------------------
1 |
2 |
This content is password-protected.
3 |
Click here to input the password
4 |
5 |
6 |
--------------------------------------------------------------------------------
/views/content-entry-content.twig:
--------------------------------------------------------------------------------
1 |
2 | {% if post.thumbnail %}
3 |
4 |
5 |
6 | {% endif %}
7 |
8 | {% if teaser_mode == 'full' %}
9 | {{ post.content }}
10 | {% else %}
11 | {{ post.get_preview }}
12 | {% endif %}
13 |
14 |
15 |
--------------------------------------------------------------------------------
/views/content-entry-footer.twig:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/views/content-entry-header.twig:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/views/content-page.twig:
--------------------------------------------------------------------------------
1 | {#
3 | {% include ['content-single-entry-'~post.ID~'-header.twig', 'content-single-entry-header.twig'] %}
4 | {% do action( 'maera/page/pre_content' ) %}
5 | {{ post.content }}
6 | {% do action( 'maera/page/after_content' ) %}
7 |
8 |
--------------------------------------------------------------------------------
/views/content-protected.twig:
--------------------------------------------------------------------------------
1 | {#
3 | {% block content %}
4 | {% do action('maera/in_article/top', post.ID) %}
5 | {% include ['content-entry-'~post.ID~'-header.twig', 'content-entry-'~post.post_type~'-header.twig', 'content-entry-header.twig'] %}
6 | {% include ['content-entry-'~post.ID~'-content.twig', 'content-entry-'~post.post_type~'-content.twig', 'content-entry-content-protected.twig'] %}
7 | {% include ['content-entry-'~post.ID~'-footer.twig', 'content-entry-'~post.post_type~'-footer.twig', 'content-entry-footer.twig'] %}
8 | {% endblock %}
9 |
10 |
--------------------------------------------------------------------------------
/views/content-single-entry-content.twig:
--------------------------------------------------------------------------------
1 |
2 | {% do action( 'maera/single/pre_content', post.ID ) %}
3 | {{ post.content }}
4 | {% do action( 'maera/single/after_content', post.ID ) %}
5 |
6 |
--------------------------------------------------------------------------------
/views/content-single-entry-download-meta.twig:
--------------------------------------------------------------------------------
1 | {# This file is empty on purpose. #}
2 |
--------------------------------------------------------------------------------
/views/content-single-entry-footer.twig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codemonkey-jack/maera/70530cfab1a4ed1b59af96ee43de7dedfac418bc/views/content-single-entry-footer.twig
--------------------------------------------------------------------------------
/views/content-single-entry-header.twig:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/views/content-single-entry-meta.twig:
--------------------------------------------------------------------------------
1 |
2 | {% if function('get_the_time', 'U', post) is same as(post.get_modified_time('U')) %}
3 |
4 | {{ post.date }}
5 |
6 | {% else %}
7 |
8 | {{ post.modified_date }}
9 |
10 | {% endif %}
11 | {{ fn( 'esc_html__', 'under', 'maera' ) }}
12 | {% for category in post.get_categories %}
13 |
{{ category.name }}{% if not loop.last %}, {% endif %}
14 | {% endfor %}
15 |
{{ fn( 'esc_html__', 'by', 'maera' ) }} {{ post.author.name }}
16 | {% if post.comments %}{{ fn( 'esc_html__', 'with', 'maera' ) }}
{{ post.comment_count }} {{ fn( 'esc_html__', 'comments', 'maera' ) }} {% endif %}
17 |
18 |
--------------------------------------------------------------------------------
/views/content-single-entry-tag.twig:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/views/content-single.twig:
--------------------------------------------------------------------------------
1 |
2 | {% do action( 'maera/single/top', post.ID ) %}
3 | {% include ['content-single-entry-'~post.ID~'-header.twig', 'content-single-entry-'~post.post_type~'-header.twig', 'content-single-entry-header.twig'] %}
4 | {% include ['content-single-entry-'~post.ID~'-meta.twig', 'content-single-entry-'~post.post_type~'-meta.twig', 'content-single-entry-meta.twig'] %}
5 | {% include ['content-single-entry-'~post.ID~'-content.twig', 'content-single-entry-'~post.post_type~'-content.twig', 'content-single-entry-content.twig'] %}
6 | {% include ['content-single-entry-'~post.ID~'-tag.twig', 'content-single-entry-'~post.post_type~'-tag.twig', 'content-single-entry-tag.twig'] %}
7 | {% include ['content-single-entry-'~post.ID~'-footer.twig', 'content-single-entry-'~post.post_type~'-footer.twig', 'content-single-entry-footer.twig'] %}
8 |
9 |
--------------------------------------------------------------------------------
/views/content.twig:
--------------------------------------------------------------------------------
1 | {#
3 | {% block content %}
4 | {% do action('maera/in_article/top', post.ID) %}
5 | {% include ['content-entry-'~post.ID~'-header.twig', 'content-entry-'~post.post_type~'-header.twig', 'content-entry-header.twig'] %}
6 | {% include ['content-entry-'~post.ID~'-content.twig', 'content-entry-'~post.post_type~'-content.twig', 'content-entry-content.twig'] %}
7 | {% include ['content-entry-'~post.ID~'-footer.twig', 'content-entry-'~post.post_type~'-footer.twig', 'content-entry-footer.twig'] %}
8 | {% endblock %}
9 |
10 |
--------------------------------------------------------------------------------
/views/edd/archive-download.twig:
--------------------------------------------------------------------------------
1 | {% extends "main.twig" %}
2 | {% block content %}
3 |
4 |
5 | {% include ['filter-'~theme.theme_mod('filter_mode', 'php')~'.twig', 'filter-php.twig'] %}
6 |
7 |
8 |
9 | {% do action( 'maera/page/pre_content' ) %}
10 | {% filter shortcodes %}[downloads columns="2"]{% endfilter %}
11 | {{ shell.clearfix }}
12 | {{ function( 'wp_link_pages', {
13 | 'before': '' . i18n.pages,
14 | 'after': '
'
15 | }) }}
16 | {{ shell.clearfix }}
17 | {% do action( 'maera/page/after_content' ) %}
18 |
19 |
20 |
21 |
22 |
23 | {% endblock %}
24 |
--------------------------------------------------------------------------------
/views/edd/content-download-content.twig:
--------------------------------------------------------------------------------
1 | {% from 'panel_open.html.twig' import panel_open as panel_open %}
2 | {% from 'panel_close.html.twig' import panel_close as panel_close %}
3 | {% from 'panel_heading_open.html.twig' import panel_heading_open as panel_heading_open %}
4 | {% from 'panel_heading_close.html.twig' import panel_heading_close as panel_heading_close %}
5 |
6 | {{ panel_open('content') }}
7 | {{ panel_heading_open() }}
8 | {{ fn( 'esc_attr', post.title ) }}
9 | {{ panel_heading_close }}
10 | {{ post.get_preview(20|apply_filters(excerpt_length)) }}
11 |
12 | {{ function('edd_get_purchase_link', [{'download_id':post.ID}]) }}
13 |
14 | {{ panel_close() }}
15 |
--------------------------------------------------------------------------------
/views/edd/content-download-footer.twig:
--------------------------------------------------------------------------------
1 | {# This file is empty on purpose. #}
2 |
--------------------------------------------------------------------------------
/views/edd/content-download-header.twig:
--------------------------------------------------------------------------------
1 | {% set width = content_width // 3 %}
2 | {% set height = width // 1.618 %}
3 |
4 |
5 | {% if post.thumbnail %}
6 | {% else %} {% endif %}
7 |
8 |
--------------------------------------------------------------------------------
/views/edd/shortcode-content-price.twig:
--------------------------------------------------------------------------------
1 | {% if not function('edd_has_variable_prices', post.ID) %}
2 |
3 |
4 | {{ function('edd_price', post.ID) }}
5 |
6 |
7 | {% endif %}
8 |
--------------------------------------------------------------------------------
/views/edd/shortcode-download-content-grid.twig:
--------------------------------------------------------------------------------
1 | {# Multiply image dimentions x2 to compensate for retina displays #}
2 | {% set width = content_width * 2 // columns %}
3 | {% set height = width // 1.618 %}
4 |
5 |
6 | {% if display_buy_btn == 'yes' %}
7 |
{% endif %}
29 |
30 | {# The title of the download #}
31 |
32 | {# Excerpt and Content #}
33 | {% if display_excerpt %}
34 | {{ post.get_preview(20|apply_filters(excerpt_length)) }}
35 | {% elseif display_full %}
36 | {{ post.content }}
37 | {% endif %}
38 |
39 |
40 |
--------------------------------------------------------------------------------
/views/edd/shortcode-download-content-list.twig:
--------------------------------------------------------------------------------
1 | {% set width = content_width // columns %}
2 | {% set height = width // 1.618 %}
3 |
4 |
5 | [maera_grid_row_open]
6 |
15 |
16 | {% if display_buy_btn == 'yes' %}
17 | [maera_grid_row_open]
18 |
19 | {% endif %}
20 |
21 |
{{ post.title|striptags }}
22 | {% if display_excerpt == 'yes' %}
23 | {{ post.get_preview(20|apply_filters(excerpt_length)) }}
24 | {% elseif display_full == 'yes' %}
25 | {{ post.content }}
26 | {% endif %}
27 | {% if display_buy_btn == 'yes' %}
28 |
29 |
30 |
46 | {% endif %}
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/views/edd/shortcode-download-content-zoe.twig:
--------------------------------------------------------------------------------
1 | {% set width = content_width // columns %}
2 | {% set height = width // 1.618 %}
3 |
4 |
5 |
6 | {% if post.thumbnail %}
7 | {% else %}
{% endif %}
8 |
9 |
10 |
{{ fn( 'esc_attr', post.title ) }}
11 |
12 | {% if post.edd_coming_soon %}
13 |
14 | {% if post.edd_coming_soon_text %}{{ post.edd_coming_soon_text }}
15 | {% else %}{{ fn( 'esc_html__','Coming Soon', 'maera') }}{% endif %}
16 |
17 | {% else %}
18 | {% if variable_priced %}
19 |
20 |
21 | {% else %}
22 |
23 |
24 | {% endif %}
25 | {% endif %}
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/views/edd/shortcode-download-image.twig:
--------------------------------------------------------------------------------
1 | {% set width = content_width // columns %}
2 | {% set height = width // 1.618 %}
3 |
4 | {% if post.thumbnail %}
5 |
6 | {% else %}
7 |
8 | {% endif %}
9 |
10 |
--------------------------------------------------------------------------------
/views/edd/tease-download-meta.twig:
--------------------------------------------------------------------------------
1 | {# This file is empty on purpose. #}
2 |
--------------------------------------------------------------------------------
/views/edd/tease-download-open.twig:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/views/filter-isotope.twig:
--------------------------------------------------------------------------------
1 | {% from 'button_group_classes.html.twig' import button_group_classes as button_group_classes %}
2 | {% from 'button_classes.html.twig' import button_classes as button_classes %}
3 | {% from 'clearfix.html.twig' import clearfix as clearfix %}
4 |
5 |
6 |
7 |
8 |
11 | {% for download_category in download_categories %}
12 | {% if download_category.get_posts %}
13 |
16 | {% endif %}
17 | {% endfor %}
18 | {% for download_tag in download_tags %}
19 | {% if download_tag.get_posts %}
20 |
23 | {% endif %}
24 | {% endfor %}
25 |
26 |
27 |
33 |
34 |
35 | {{ clearfix() }}
36 |
--------------------------------------------------------------------------------
/views/filter-php.twig:
--------------------------------------------------------------------------------
1 | {#
9 | {{ fn( 'esc_html__', 'Choose a category', 'maera' ) }}
10 |
11 | {{ fn( 'esc_html__', 'All', 'maera' ) }}
12 | {% for download_category in download_categories %}
13 | {% if download_category.get_posts %}
14 |
15 | {{ download_category.name }}
16 |
17 | {% endif %}
18 | {% endfor %}
19 |
20 |
21 |
22 |
23 |
24 | {{ fn( 'esc_html__', 'Choose a tag', 'maera' ) }}
25 |
26 | {{ fn( 'esc_html__', 'All', 'maera' ) }}
27 | {% for download_tag in download_tags %}
28 | {% if download_tag.get_posts %}
29 |
30 | {{ download_tag.name }}
31 |
32 | {% endif %}
33 | {% endfor %}
34 |
35 |
36 |
37 |
38 | {{ row_close('form') }}
39 |
80 | {{ clearfix() }}
--------------------------------------------------------------------------------
/views/footer.twig:
--------------------------------------------------------------------------------
1 | {#
8 | {% do action( 'maera/footer/start', post.ID ) %}
9 |
12 | {% do action( 'maera/footer/end', post.ID ) %}
13 |
14 | {% do action( 'maera/footer/after', post.ID ) %}
15 | {{ function( 'wp_footer' ) }}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/views/head.twig:
--------------------------------------------------------------------------------
1 |
2 | {% block head %}
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ function( 'wp_head' ) }}
11 |
12 | {% endblock %}
13 |
--------------------------------------------------------------------------------
/views/header.twig:
--------------------------------------------------------------------------------
1 | {#
3 | {% include 'head.twig' %}
4 |
5 |
6 | {{ fn( 'esc_html__', 'Skip to main content', 'maera' ) }}
7 |
8 | {% do action( 'get_header' ) %}
9 |
10 | {% do action( 'maera/header/before', post.ID ) %}
11 |
31 | {% do action( 'maera/header/after', post.ID ) %}
32 |
--------------------------------------------------------------------------------
/views/index.twig:
--------------------------------------------------------------------------------
1 | {#
3 | {% if close|default(false) %}
4 | ×
5 | {% endif %}
6 | {{ message|raw }}
7 |
8 | {% endmacro %}
9 |
--------------------------------------------------------------------------------
/views/macros/button_classes.html.twig:
--------------------------------------------------------------------------------
1 | {% macro button_classes(color, size, type, extra) %}
2 |
3 | {% if color == 'info' %}
4 | button-secondary
5 | {% else %}
6 | button-{{ color }}
7 | {% endif %}
8 |
9 | {% if size == 'extra-small' %}button-xsmall{% endif %}
10 | {% if size == 'small' %}button-small{% endif %}
11 | {% if size == 'medium' %}{# No need for an extra class #}{% endif %}
12 | {% if size == 'large' %}button-large{% endif %}
13 | {% if size == 'extra-large' %}button-xlarge{% endif %}
14 |
15 | {{ type }}
16 | {{ extra }}
17 |
18 | {% endmacro %}
19 |
--------------------------------------------------------------------------------
/views/macros/button_dropdown.html.twig:
--------------------------------------------------------------------------------
1 | {% from 'button_classes.html.twig' import button_classes as button_classes %}
2 | {% macro button_dropdown(color, size, type, extra, label, content) %}
3 |
4 |
5 |
6 | {{ label }}
7 |
8 |
9 |
10 |
11 |
12 | {% endmacro %}
13 |
--------------------------------------------------------------------------------
/views/macros/button_group_classes.html.twig:
--------------------------------------------------------------------------------
1 | {% macro button_group_classes(size, type, extra_classes) %}
2 |
3 | btn-group
4 | {% if size == 'xsmall' %}btn-group-xs{% endif %}
5 | {% if size == 'small' %}btn-group-sm{% endif %}
6 | {% if size == 'medium' %}{# No need for an extra class #}{% endif %}
7 | {% if size == 'large' %}btn-group-lg{% endif %}
8 | {% if size == 'xlarge' %}btn-group-lg{% endif %}
9 | {{ type }}
10 | {{ extra_classes }}
11 |
12 | {% endmacro %}
13 |
--------------------------------------------------------------------------------
/views/macros/clearfix.html.twig:
--------------------------------------------------------------------------------
1 | {% macro clearfix() %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/column_classes.html.twig:
--------------------------------------------------------------------------------
1 | {% macro column_classes(sizes) %}
2 | {% if sizes is iterable %}
3 | {% for size in sizes %}
4 | {% if size.mobile %}column column-xs-{{ size.mobile }}{% endif %}
5 | {% if size.tablet %}column column-sm-{{ size.tablet }}{% endif %}
6 | {% if size.medium %}column column-md-{{ size.medium }}{% endif %}
7 | {% if size.large %}column column-lg-{{ size.large }}{% endif %}
8 | {% endfor %}
9 | {% endif %}
10 | {% endmacro %}
11 |
--------------------------------------------------------------------------------
/views/macros/column_close.html.twig:
--------------------------------------------------------------------------------
1 | {% macro column_close(element) %}
2 | {{ element|default('div') }}>
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/column_open.html.twig:
--------------------------------------------------------------------------------
1 | {% from 'column_classes.html.twig' import column_classes as column_classes %}
2 | {% macro column_open(element, sizes, id, extra_classes, properties) %}
3 | <{{ element|default('div') }} class="{{ column_classes( sizes ) }}{{ extra_classes ? ' '~extra_classes : '' }}"{{ id ? ' id="'~id~'"' : '' }}{{ properties ? ' '~properties : '' }}>
4 | {% endmacro %}
5 |
--------------------------------------------------------------------------------
/views/macros/container_close.html.twig:
--------------------------------------------------------------------------------
1 | {% macro container_close(element) %}
2 | {{ element|default('div') }}>
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/container_open.html.twig:
--------------------------------------------------------------------------------
1 | {% import 'grid_classes.html.twig' as grid %}
2 | {% macro container_open(element, id, extra_classes, properties) %}
3 | <{{ element|default('div') }} class="{{ grid.container()|apply_filters( 'maera/container_class' ) }}{{ extra_classes ? ' '~extra_classes : '' }}"{{ id ? ' id="'~id~'"' : '' }}{{ properties ? ' '~properties : '' }}>
4 | {% endmacro %}
5 |
--------------------------------------------------------------------------------
/views/macros/float_class.html.twig:
--------------------------------------------------------------------------------
1 | {% macro float_class(alignment) %}
2 | pull-{{ alignment }}
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/grid_classes.html.twig:
--------------------------------------------------------------------------------
1 | {% macro container() %}container{% endmacro %}
2 |
3 | {% macro row() %}row{% endmacro %}
4 |
5 | {% macro column() %}column{% endmacro %}
6 |
--------------------------------------------------------------------------------
/views/macros/icon.html.twig:
--------------------------------------------------------------------------------
1 | {% macro icon(symbol) %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/pagination_ul_class.html.twig:
--------------------------------------------------------------------------------
1 | {% macro pagination_ul_class() %}
2 | paginator
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/panel_body_close.html.twig:
--------------------------------------------------------------------------------
1 | {% macro panel_body_close() %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/panel_body_open.html.twig:
--------------------------------------------------------------------------------
1 | {% macro panel_body_open(extra_classes) %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/panel_close.html.twig:
--------------------------------------------------------------------------------
1 | {% macro panel_close() %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/panel_footer_close.html.twig:
--------------------------------------------------------------------------------
1 | {% macro panel_footer_close() %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/panel_footer_open.html.twig:
--------------------------------------------------------------------------------
1 | {% macro panel_footer_open(extra_classes) %}
2 |
3 | {% endmacro %}
4 |
--------------------------------------------------------------------------------
/views/macros/panel_heading_open.html.twig:
--------------------------------------------------------------------------------
1 | {% macro panel_heading_open(extra_classes) %}
2 |