Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #128 from Codeinwp/development
Browse files Browse the repository at this point in the history
Improve Customize layout
Fixed issue with the button in Big Title section fixed width
Added Clarina child theme in the About Llorix page
Rempved frontpage template and use the front-page.php file for the frontpage
Fixed compatibility with Llorix One Companion and Llorix One Plus
Allow tel protocol in the very top header - phone number
  • Loading branch information
rodica-andronache authored Dec 23, 2016
2 parents 2e5eee7 + 4a5ed9b commit 364ba99
Show file tree
Hide file tree
Showing 14 changed files with 319 additions and 157 deletions.
8 changes: 8 additions & 0 deletions content-frontpage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/**
* The template used for displaying page content on frontpage.
*
* @package llorix-one-lite
*/

the_content();
6 changes: 3 additions & 3 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@

</div><!-- .footer-bottom-wrap -->

<div class="powered-by">
<?php echo apply_filters( 'llorix_one_lite_powered_by',"<a class='' href='http://themeisle.com/themes/llorix-one/' rel='nofollow'>Llorix One Lite </a>" . esc_html__( 'powered by','llorix-one-lite' ) . "<a class='' href='http://wordpress.org/' rel='nofollow'>" . esc_html__( 'WordPress','llorix-one-lite' ) . '</a>' ); ?>
</div>

<?php echo apply_filters( 'llorix_one_plus_footer_text_filter','<div class="powered-by"><a href="http://themeisle.com/themes/llorix-one/" rel="nofollow">Llorix One Lite </a>' . esc_html__( 'powered by','llorix-one-lite' ) . '<a href="http://wordpress.org/" rel="nofollow">' . esc_html__( 'WordPress','llorix-one-lite' ) . '</a></div>' ); ?>


</div><!-- container -->

Expand Down
33 changes: 17 additions & 16 deletions template-frontpage.php → front-page.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<?php
/**
* Template name: Frontpage
* Front page
*
* @package llorix-one-lite
*/


get_header();
get_header();

?>

<!-- =========================
PRE LOADER
PRE LOADER
============================== -->
<?php

global $wp_customize;
global $wp_customize;

if ( ! isset( $wp_customize ) ) :
if ( ! isset( $wp_customize ) ) :

$llorix_one_lite_disable_preloader = get_theme_mod( 'llorix_one_lite_disable_preloader' );

if ( isset( $llorix_one_lite_disable_preloader ) && ($llorix_one_lite_disable_preloader != 1) ) :

echo '<div class="preloader">';
echo '<div class="status">&nbsp;</div>';
echo '<div class="status">&nbsp;</div>';
echo '</div>';

endif;

endif;

llorix_one_lite_get_template_part( apply_filters( 'llorix_one_lite_header_layout','/sections/llorix_one_lite_header_section' ) );
endif;

llorix_one_lite_get_template_part( apply_filters( 'llorix_one_lite_header_layout','/sections/llorix_one_lite_header_section' ) );

?>
</div>
<!-- /END COLOR OVER IMAGE -->
</div>
<!-- /END COLOR OVER IMAGE -->
</header>
<!-- /END HOME / HEADER -->

<div itemprop id="content" class="content-wrap" role="main">

<?php
<?php

$sections_array = apply_filters(
'llorix_one_companion_sections_filter',
Expand All @@ -50,22 +50,23 @@
'sections/llorix_one_lite_our_story_section',
'sections/llorix_one_lite_ribbon_section',
'sections/llorix_one_lite_latest_news_section',
'sections/llorix_one_lite_content_section',
'sections/llorix_one_lite_contact_info_section',
'sections/llorix_one_lite_map_section',
)
);
)
);

if ( ! empty( $sections_array ) ) {
foreach ( $sections_array as $section ) {
llorix_one_lite_get_template_part( $section );
}
}
?>
?>

</div><!-- .content-wrap -->

<?php

get_footer();
get_footer();

?>
17 changes: 13 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function llorix_one_lite_setup() {
*/
function llorix_one_lite_is_not_static_front_page() {
$frontpage_id = get_option( 'page_on_front' );
if ( get_option( 'show_on_front' ) === 'page' && ! empty( $frontpage_id ) && get_page_template_slug( $frontpage_id ) === 'template-frontpage.php' ) {
if ( get_option( 'show_on_front' ) === 'page' ) {
return true;
}

Expand Down Expand Up @@ -248,14 +248,14 @@ function llorix_one_lite_scripts() {
) );

$llorix_one_lite_enable_move = get_theme_mod( 'llorix_one_lite_enable_move' );
if ( ! empty( $llorix_one_lite_enable_move ) && $llorix_one_lite_enable_move && ( is_front_page() || is_page_template( 'template-frontpage.php' ) ) ) {
if ( ! empty( $llorix_one_lite_enable_move ) && $llorix_one_lite_enable_move && ( is_front_page() ) ) {

wp_enqueue_script( 'llorix-one-lite-parallax', llorix_one_lite_get_file( '/js/vendor/parallax.min.js' ), array(), '1.0.1', true );
wp_enqueue_script( 'llorix-one-lite-home-plugin', llorix_one_lite_get_file( '/js/plugin.home.js' ), array( 'jquery', 'llorix-one-lite-custom-all', 'llorix-one-lite-parallax' ), '1.0.1', true );

}

if ( is_front_page() || is_page_template( 'template-frontpage.php' ) ) {
if ( is_front_page() ) {

wp_enqueue_script( 'llorix-one-lite-custom-home', llorix_one_lite_get_file( '/js/custom.home.js' ), array( 'jquery' ), '1.0.0', true );
}
Expand Down Expand Up @@ -414,7 +414,7 @@ function llorix_one_lite_php_style() {
$custom_css .= 'body{ color: ' . $llorix_one_lite_text_color . '}';
}

if ( ( empty( $llorix_one_lite_enable_move ) || ! $llorix_one_lite_enable_move ) && ( is_front_page() || is_page_template( 'template-frontpage.php' ) ) ) {
if ( ( empty( $llorix_one_lite_enable_move ) || ! $llorix_one_lite_enable_move ) && ( is_front_page() ) ) {

if ( ! empty( $llorix_one_header_image ) ) {
$custom_css .= '.header{ background-image: url(' . $llorix_one_header_image . ');}';
Expand Down Expand Up @@ -659,3 +659,12 @@ function llorix_one_lite_post_date_box_function( $class ) {
}
}
add_action( 'llorix_one_lite_post_date_box','llorix_one_lite_post_date_box_function', 10, 1 );

/**
* Filter the front page template so it's bypassed entirely if the user selects
* to display blog posts on their homepage instead of a static page.
*/
function llorix_one_lite_filter_front_page_template( $template ) {
return is_home() ? '' : $template;
}
add_filter( 'frontpage_template', 'llorix_one_lite_filter_front_page_template' );
11 changes: 7 additions & 4 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

global $wp_customize;

if ( (is_front_page() || is_page_template( 'template-frontpage.php' )) && ! isset( $wp_customize ) && get_option( 'show_on_front' ) != 'page' ) :
if ( is_front_page() && ! isset( $wp_customize ) && get_option( 'show_on_front' ) != 'page' ) :

$llorix_one_lite_disable_preloader = get_theme_mod( 'llorix_one_lite_disable_preloader' );

Expand Down Expand Up @@ -61,7 +61,7 @@
if ( isset( $llorix_one_lite_sticky_header ) && ($llorix_one_lite_sticky_header != 1) ) {
$fixedheader = 'sticky-navigation-open';
} else {
if ( ! is_front_page() && is_page_template( 'template-frontpage.php' ) ) {
if ( is_front_page() ) {
$fixedheader = 'sticky-navigation-open';
} else {
$fixedheader = '';
Expand All @@ -83,6 +83,8 @@

/* VERY TOP HEADER */
$llorix_one_lite_very_top_header_show = get_theme_mod( 'llorix_one_lite_very_top_header_show', apply_filters( 'llorix_one_lite_very_top_header_show_filter',0 ) );
$allowed_protocols = wp_allowed_protocols();
array_push( $allowed_protocols,'callto' );

/* If section is not disabled */
if ( isset( $llorix_one_lite_very_top_header_show ) && $llorix_one_lite_very_top_header_show != 1 ) {
Expand All @@ -93,10 +95,11 @@
$llorix_one_lite_very_top_header_phone = get_theme_mod( 'llorix_one_lite_very_top_header_phone',esc_html__( '(+9) 0999.500.400','llorix-one-lite' ) );
$llorix_one_lite_very_top_header_phone_text = get_theme_mod( 'llorix_one_lite_very_top_header_phone_text',esc_html__( 'Call us: ','llorix-one-lite' ) );


if ( ! empty( $llorix_one_lite_very_top_header_phone ) || ! empty( $llorix_one_lite_very_top_header_phone_text ) ) {
echo '<div class="very-top-left">';
echo $llorix_one_lite_very_top_header_phone_text;
echo '<span>' . esc_attr( $llorix_one_lite_very_top_header_phone ) . '</span>';
echo '<span>' . wp_kses( $llorix_one_lite_very_top_header_phone, 'post', $allowed_protocols ) . '</span>';
echo '</div>';
} elseif ( isset( $wp_customize ) ) {
echo '<div class="very-top-left llorix_one_lite_only_customizer"><span></span></div>';
Expand Down Expand Up @@ -142,7 +145,7 @@
if ( ! empty( $llorix_one_lite_very_top_header_phone ) ) {
echo '<div class="very-top-left">';
echo esc_html_e( 'Call us:', 'llorix-one-lite' ) . ' ';
echo '<span>' . esc_attr( $llorix_one_lite_very_top_header_phone ) . '</span>';
echo '<span>' . wp_kses( $llorix_one_lite_very_top_header_phone, 'post', $allowed_protocols ) . '</span>';
echo '</div>';
} elseif ( isset( $wp_customize ) ) {
echo '<div class="very-top-left llorix_one_lite_only_customizer">' . esc_html_e( 'Call us:', 'llorix-one-lite' ) . '<span></span></div>';
Expand Down
Binary file added inc/admin/welcome-screen/img/clarina.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 31 additions & 1 deletion inc/admin/welcome-screen/sections/child-themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Child themes template
*
* @package llorix-one-lite
* @package Llorix One Lite
*/
?>
<div id="child_themes" class="llorix-one-lite-tab-pane">
Expand Down Expand Up @@ -49,4 +49,34 @@
</div>


<div class="llorix-one-lite-tab-pane-half llorix-one-lite-tab-pane-last-half">

<!-- Clarina -->
<div class="llorix-one-lite-child-theme-container">
<div class="llorix-one-lite-child-theme-image-container">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/inc/admin/welcome-screen/img/clarina.png'; ?>" alt="" />
<div class="llorix-one-lite-child-theme-description">
<h2><?php echo 'Clarina'; ?></h2>
</div>
</div>
<div class="llorix-one-lite-child-theme-details">
<?php if ( 'Clarina' != $current_theme['Name'] ) { ?>
<div class="theme-details">
<span class="theme-name">Clarina</span>
<a href="https://wordpress.org/themes/download/clarina.0.1.zip?nostats=1" class="button button-primary install right"><?php echo 'Get now'; ?></a>
<a class="button button-secondary preview right" target="_blank" href="http://justfreethemes.com/demo?theme=Clarina"><?php echo 'Live Preview'; ?></a>
<div class="llorix-one-lite-clear"></div>
</div>
<?php } else { ?>
<div class="theme-details active">
<span class="theme-name"><?php echo 'Clarina - Current theme'; ?></span>
<a class="button button-secondary customize right" target="_blank" href="<?php echo get_site_url() . '/wp-admin/customize.php' ?>"><?php echo 'Customize'; ?></a>
<div class="llorix-one-lite-clear"></div>
</div>
<?php } ?>
</div>
</div>

</div>

</div>
14 changes: 14 additions & 0 deletions inc/customize-pro/class-llorix-one-lite-customize-upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ public function sections( $manager ) {
)
)
);

$page_on_front_id = get_option( 'page_on_front' );

if ( 'posts' === get_option( 'show_on_front' ) ) {
$manager->add_section( new Llorix_One_Lite_Customizer_Upsell_Frontpage_Sections( $manager, 'llorix-one-lite-frontpage-instrucctions',
array(
'upsell_text' => __( 'To customize the Frontpage sections please create a page and select the template "Frontpage" for that page. After that, go to Appearance -> Customize -> Static Front Page and under "Static Front Page" select "A static page". Finally, for "Front page" choose the page you previously created.','llorix-one-lite' ) . '<br><br>' . __( 'Need further informations? Check this','llorix-one-lite' ) . ' <a href="http://docs.themeisle.com/article/236-how-to-set-up-the-home-page-for-llorix-one">' . __( 'doc','llorix-one-lite' ) . '</a>',
'panel' => 'llorix_one_lite_front_page_sections',
'priority' => 1,
)
)
);
}

}

/**
Expand Down
12 changes: 12 additions & 0 deletions inc/customize-pro/llorix-one-lite-upsell-customize-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,16 @@
}
} );

api.sectionConstructor['llorix-one-lite-frontpage-instrucctions'] = api.Section.extend( {

// No events for this type of section.
attachEvents: function () {},

// Always make the section active.
isContextuallyActive: function () {
return true;
}
} );


} )( wp.customize );
43 changes: 22 additions & 21 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,6 @@ function llorix_one_lite_customize_register( $wp_customize ) {
'priority' => 4,
)));

/* Frontpage - instructions for users when not on Frontpage template */

$wp_customize->add_section( 'llorix_one_lite_front_page_instructions', array(
'title' => __( 'Frontpage settings', 'llorix-one-lite' ),
'priority' => 70,
) );

$wp_customize->add_setting( 'llorix_one_lite_front_page_instructions', array(
'sanitize_callback' => 'llorix_one_lite_sanitize_text',
) );

$wp_customize->add_control( new Llorix_One_Lite_Message( $wp_customize, 'llorix_one_lite_front_page_instructions',
array(
'section' => 'llorix_one_lite_front_page_instructions',
'priority' => 1,
'llorix_one_lite_message' => __( 'To customize the Frontpage sections please create a page and select the template "Frontpage" for that page. After that, go to Appearance -> Customize -> Static Front Page and under "Static Front Page" select "A static page". Finally, for "Front page" choose the page you previously created.','llorix-one-lite' ) . '<br><br>' . __( 'Need further informations? Check this','llorix-one-lite' ) . ' <a href="http://docs.themeisle.com/article/236-how-to-set-up-the-home-page-for-llorix-one">' . __( 'doc','llorix-one-lite' ) . '</a>',
)
));

/* FRONTPAGE SECTIONS */

$wp_customize->add_panel( 'llorix_one_lite_front_page_sections', array(
Expand Down Expand Up @@ -663,6 +644,26 @@ function llorix_one_lite_customize_register( $wp_customize ) {
'priority' => 10,
));

/* FRONTPAGE CONTENT SECTION */

$wp_customize->add_section( 'llorix_one_lite_frontpage_content_section' , array(
'title' => esc_html__( 'Frontpage content section', 'llorix-one-lite' ),
'priority' => 150,
'panel' => 'llorix_one_lite_front_page_sections',
));

/* Frontpage content show/hide */
$wp_customize->add_setting( 'llorix_one_lite_frontpage_content_show', array(
'sanitize_callback' => 'llorix_one_lite_sanitize_text',
));

$wp_customize->add_control( 'llorix_one_lite_frontpage_content_show', array(
'type' => 'checkbox',
'label' => __( 'Disable the Frontpage Content section?','llorix-one-lite' ),
'section' => 'llorix_one_lite_frontpage_content_section',
'priority' => 1,
));

/* CONTACT INFO SECTION */

$wp_customize->add_section( 'llorix_one_lite_contact_section' , array(
Expand Down Expand Up @@ -908,7 +909,7 @@ function llorix_one_lite_sanitize_html( $input ) {
* @return mixed
*/
function llorix_one_lite_show_on_front() {
return is_page_template( 'template-frontpage.php' );
return is_front_page();
}

/**
Expand All @@ -917,5 +918,5 @@ function llorix_one_lite_show_on_front() {
* @return mixed
*/
function llorix_one_lite_not_show_on_front() {
return ! is_page_template( 'template-frontpage.php' );
return ! is_front_page();
}
2 changes: 1 addition & 1 deletion inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function llorix_one_lite_wp_title( $title, $sep ) {

// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || (is_front_page() || is_page_template( 'template-frontpage.php' )) ) ) {
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title .= " $sep $site_description";
}

Expand Down
Loading

0 comments on commit 364ba99

Please sign in to comment.