Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions elementor/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function post_type_container(){
function post_type_content($content){
global $post,$wp_query;

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

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

return $content;
return parse_content($content);


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

// add your own custom vars

//$custom_vars=apply_filters( 'custom_vars', 'custom' ); //soon
$custom_vars=apply_filters( 'eletheme_vars', $custom_vars );

foreach($custom_vars as $key=>$value){
$$key=$value;
}

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

}

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

add_action('elementor/frontend/widget/before_render', function($widget){
global $wp_query,$post;
$post = get_post( $wp_query->post->ID );
setup_postdata( $post );
}, 10, 1);
/*-----------------------------------------------------------------------------------*/
/* Define header and footer constants
/*-----------------------------------------------------------------------------------*/
Expand All @@ -323,7 +319,7 @@ function set_eletheme(){
$page = get_page_by_title('[body]', OBJECT, 'elementor_library');
if($page)
list($myhead,$myfooter)=explode("{{content}}",get_eletheme($page->ID));
define( 'ELE_HEADER',clean_header($myhead));
define( 'ELE_FOOTER',$myfooter);
define( 'ELE_HEADER',parse_content(clean_header($myhead)));
define( 'ELE_FOOTER',parse_content($myfooter));
}
add_action( 'wp_head', 'set_eletheme', 23 );
8 changes: 8 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );


// Add custom keywords to the eletheme
add_filter( 'eletheme_vars', 'new_keywords');
function new_keywords( $custom_vars ) {
$custom_vars['current_year']=date('Y');
return $custom_vars;
}

add_action( 'after_setup_theme', 'eletheme_setup' );
function eletheme_setup()
{
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: Theme builder, Elementor

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

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

== Changelog ==

= 1.1.0 =
* added the ability to insert new keywords and values into tha page
* added {{current_year}} keyword
* fixed issue with Elementor PRO 2

= 1.0.9 =
* fixed issue with Eementor PRO Posts Widget

Expand Down
4 changes: 2 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Theme Name: Eletheme
Theme URI: https://www.eletemplator.com
Author: Liviu Duda
Author URI: https://www.leadpro.ro
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.
Version: 1.0.9
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.
Version: 1.1.0
License: GNU General Public License
License URI: https://www.gnu.org/licenses/gpl.html
Tags: Theme builder, elementor
Expand Down