Skip to content

Commit 6d01e48

Browse files
authored
Merge pull request #17 from dudaster/master
Eletheme v1.1.0
2 parents 596409f + 3c806e0 commit 6d01e48

4 files changed

Lines changed: 25 additions & 16 deletions

File tree

elementor/container.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function post_type_container(){
153153
function post_type_content($content){
154154
global $post,$wp_query;
155155

156-
if ($wp_query->queried_object_id != $post->ID && !defined('ARCHIVE_LOOP')) return $content; // prevents infinite loop
156+
if ($wp_query->queried_object_id != $post->ID && !defined('ARCHIVE_LOOP')) return parse_content($content); // prevents infinite loop
157157

158158
if (is_single()) {
159159
$after="[single]";
@@ -163,7 +163,7 @@ function post_type_content($content){
163163
$page = get_current_template($after); // get the template
164164
if($page) return parse_content(get_eletheme($page->ID),$post,$content);
165165

166-
return $content;
166+
return parse_content($content);
167167

168168

169169
}
@@ -250,7 +250,11 @@ function parse_content($t,$post=NULL,$content=""){
250250

251251
// add your own custom vars
252252

253-
//$custom_vars=apply_filters( 'custom_vars', 'custom' ); //soon
253+
$custom_vars=apply_filters( 'eletheme_vars', $custom_vars );
254+
255+
foreach($custom_vars as $key=>$value){
256+
$$key=$value;
257+
}
254258

255259
/** end seting custom vars **/
256260
// replacing the keystrings from the template with the actual values. (ie for $content you have {content})
@@ -301,15 +305,7 @@ function passtheid( $widget ) {
301305

302306
}
303307

304-
/*-----------------------------------------------------------------------------------*/
305-
/* Set the current(global) post to widget rendering not the elementor_library theme post
306-
/*-----------------------------------------------------------------------------------*/
307308

308-
add_action('elementor/frontend/widget/before_render', function($widget){
309-
global $wp_query,$post;
310-
$post = get_post( $wp_query->post->ID );
311-
setup_postdata( $post );
312-
}, 10, 1);
313309
/*-----------------------------------------------------------------------------------*/
314310
/* Define header and footer constants
315311
/*-----------------------------------------------------------------------------------*/
@@ -323,7 +319,7 @@ function set_eletheme(){
323319
$page = get_page_by_title('[body]', OBJECT, 'elementor_library');
324320
if($page)
325321
list($myhead,$myfooter)=explode("{{content}}",get_eletheme($page->ID));
326-
define( 'ELE_HEADER',clean_header($myhead));
327-
define( 'ELE_FOOTER',$myfooter);
322+
define( 'ELE_HEADER',parse_content(clean_header($myhead)));
323+
define( 'ELE_FOOTER',parse_content($myfooter));
328324
}
329325
add_action( 'wp_head', 'set_eletheme', 23 );

functions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
55
remove_action( 'wp_print_styles', 'print_emoji_styles' );
66

7+
8+
// Add custom keywords to the eletheme
9+
add_filter( 'eletheme_vars', 'new_keywords');
10+
function new_keywords( $custom_vars ) {
11+
$custom_vars['current_year']=date('Y');
12+
return $custom_vars;
13+
}
14+
715
add_action( 'after_setup_theme', 'eletheme_setup' );
816
function eletheme_setup()
917
{

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: Theme builder, Elementor
55

66
Requires at least: 4.0
77
Tested up to: 4.9.2
8-
Stable tag: 1.0.8
8+
Stable tag: 1.1.0
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -73,6 +73,11 @@ Check https://www.eletemplator.com/ or https://github.com/dudaster/eletheme
7373

7474
== Changelog ==
7575

76+
= 1.1.0 =
77+
* added the ability to insert new keywords and values into tha page
78+
* added {{current_year}} keyword
79+
* fixed issue with Elementor PRO 2
80+
7681
= 1.0.9 =
7782
* fixed issue with Eementor PRO Posts Widget
7883

style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Theme Name: Eletheme
33
Theme URI: https://www.eletemplator.com
44
Author: Liviu Duda
55
Author URI: https://www.leadpro.ro
6-
Description: Theme builder for Elementor. It works with Elementor but upgrade to Elementor PRO to unlock it's full potential (it worths every penny). Soon we'll come with a complementary plugin that can help you build woocommerce product pages and custom archive post lists. Check other Elementor addons to help build your desired website.
7-
Version: 1.0.9
6+
Description: Theme builder for Elementor. It works with Elementor 2.x and Elementor PRO 2.x. Check other Elementor addons to help build your desired website.
7+
Version: 1.1.0
88
License: GNU General Public License
99
License URI: https://www.gnu.org/licenses/gpl.html
1010
Tags: Theme builder, elementor

0 commit comments

Comments
 (0)