Skip to content

Commit

Permalink
Merge pull request #7 from FameThemes/development
Browse files Browse the repository at this point in the history
Update to version 1.0.5
  • Loading branch information
shrimp2t committed Mar 31, 2016
2 parents a97434f + a95ad5d commit a63b73f
Show file tree
Hide file tree
Showing 21 changed files with 186 additions and 103 deletions.
6 changes: 3 additions & 3 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Ooops... Error 404', 'codilight-lite' ); ?></h1>
<h3 class="page-subtitle"><?php esc_html_e( 'Sorry, but the page you are looking for doesn\'t exist. ', 'codilight-lite' ); ?></h4>
<h1 class="page-title"><?php esc_html_e( 'Ooops&hellip; Error 404', 'codilight-lite' ); ?></h1>
<h3 class="page-subtitle"><?php esc_html_e( 'Sorry, but the page you are looking for doesn&rsquo;t exist. ', 'codilight-lite' ); ?></h3>
</header><!-- .page-header -->

<div class="page-content">
Expand All @@ -28,7 +28,7 @@
<div class="latest-posts-404">
<h4><?php esc_html_e( 'Latest Posts', 'codilight-lite' ); ?></h4>
<?php
$custom_query = new WP_Query( apply_filters( '404_latest_posts_args', array(
$custom_query = new WP_Query( apply_filters( 'page_404_latest_posts_args', array(
'post_type' => 'post',
'posts_per_page' => 6,
'post_status' => 'publish',
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
====================================================================
CHANGELOG
====================================================================
## 1.0.5
* Change Action hooks prefix.
* Fix Dashboard: Correct capability.
* Fix Menu Link: Correct capability.
* Fix Escaping: admin_url().
* Fix Escaping and translating URLs.
* Fix Proper ellipsis.
* Update Pagination.
* Remove Textarea customizer control.
* Remove widget Advertising.
* Remove file rtl.css.
* Add css hyphens for long page title issue.

## 1.0.4
* Add css hyphens for long title issue.
* Change theme tag.
Expand Down
35 changes: 33 additions & 2 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

<?php
$layout_archive_posts = get_theme_mod( 'layout_archive_posts', 'grid' );
global $wp_query;
$total_pages = $wp_query->max_num_pages;
$current_page = max(1, get_query_var('paged'));

if ( $layout_archive_posts == 'grid' ) {
echo '<div class="block1 block1_grid">';
echo '<div class="row">';
Expand All @@ -38,14 +42,41 @@
endwhile;
echo '</div>';
echo '</div>';
codilight_lite_custom_paginate();

/**
* Show pagination if more than 1 page.
*/
if ( $wp_query->max_num_pages > 1 ) {
echo '<div class="ft-paginate">';
the_posts_pagination(array(
'prev_next' => True,
'prev_text' => '<i class="fa fa-angle-left"></i>',
'next_text' => '<i class="fa fa-angle-right"></i>',
'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'codilight-lite') . ' </span>',
));
printf( '<span class="total-pages">'. esc_html__( 'Page %1$s of %2$s', 'codilight-lite' ) .'</span>', $current_page, $total_pages );
echo '</div>';
}

} else {
echo '<div class="block1 block1_list">';
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content-list' );
endwhile;
codilight_lite_custom_paginate();
/**
* Show pagination if more than 1 page.
*/
if ( $wp_query->max_num_pages > 1 ) {
echo '<div class="ft-paginate">';
the_posts_pagination(array(
'prev_next' => True,
'prev_text' => '<i class="fa fa-angle-left"></i>',
'next_text' => '<i class="fa fa-angle-right"></i>',
'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'codilight-lite') . ' </span>',
));
printf( '<span class="total-pages">'. esc_html__( 'Page %1$s of %2$s', 'codilight-lite' ) .'</span>', $current_page, $total_pages );
echo '</div>';
}
echo '</div>';
}
?>
Expand Down
4 changes: 4 additions & 0 deletions assets/sass/_contents.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
@include rem('margin-bottom', 5px);
}
}

.entry-title {
hyphens: auto;
}
8 changes: 8 additions & 0 deletions assets/sass/_template_parts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@
color: $meta_color;
font-style: italic;
}
.pagination {
float: left;
}
&::after {
@include clearfix();
clear: both;
}

}

/* Comments
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: http://www.famethemes.com/themes/codilight-lite
Author: FameThemes
Author URI: http://www.famethemes.com
Description: Codilight Lite is a news magazine style WordPress theme from FameThemes which is a perfect option to create any kind of magazine or blog websites.
Version: 1.0.4
Version: 1.0.5
Text Domain: codilight-lite
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down
35 changes: 33 additions & 2 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

<?php
$layout_archive_posts = get_theme_mod( 'layout_archive_posts', 'grid' );
global $wp_query;
$total_pages = $wp_query->max_num_pages;
$current_page = max(1, get_query_var('paged'));

if ( $layout_archive_posts == 'grid' ) {
echo '<div class="block1 block1_grid">';
echo '<div class="row">';
Expand All @@ -38,14 +42,41 @@
endwhile;
echo '</div>';
echo '</div>';
codilight_lite_custom_paginate();

/**
* Show pagination if more than 1 page.
*/
if ( $wp_query->max_num_pages > 1 ) {
echo '<div class="ft-paginate">';
the_posts_pagination(array(
'prev_next' => True,
'prev_text' => '<i class="fa fa-angle-left"></i>',
'next_text' => '<i class="fa fa-angle-right"></i>',
'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'codilight-lite') . ' </span>',
));
printf( '<span class="total-pages">'. esc_html__( 'Page %1$s of %2$s', 'codilight-lite' ) .'</span>', $current_page, $total_pages );
echo '</div>';
}

} else {
echo '<div class="block1 block1_list">';
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content-list' );
endwhile;
codilight_lite_custom_paginate();
/**
* Show pagination if more than 1 page.
*/
if ( $wp_query->max_num_pages > 1 ) {
echo '<div class="ft-paginate">';
the_posts_pagination(array(
'prev_next' => True,
'prev_text' => '<i class="fa fa-angle-left"></i>',
'next_text' => '<i class="fa fa-angle-right"></i>',
'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'codilight-lite') . ' </span>',
));
printf( '<span class="total-pages">'. esc_html__( 'Page %1$s of %2$s', 'codilight-lite' ) .'</span>', $current_page, $total_pages );
echo '</div>';
}
echo '</div>';
}
?>
Expand Down
16 changes: 8 additions & 8 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'codilight-lite' ); ?></a>
<?php do_action( '_before_topbar' ); ?>
<?php do_action( 'codilight_lite_before_topbar' ); ?>
<div id="topbar" class="site-topbar">
<div class="container">
<div class="topbar-left pull-left">
Expand All @@ -37,30 +37,30 @@
</div>
<div class="topbar-right pull-right">
<ul class="topbar-elements">
<?php do_action( '_before_topbar_search' ); ?>
<?php do_action( 'codilight_lite_before_topbar_search' ); ?>
<li class="topbar-search">
<a href="javascript:void(0)"><i class="search-icon fa fa-search"></i><span><?php esc_html_e( 'Search', 'codilight-lite' ); ?></span></a>
<div class="dropdown-content dropdown-search">
<?php get_search_form( true ); ?>
</div>
</li>
<?php do_action( '_after_topbar_search' ); ?>
<?php do_action( 'codilight_lite_after_topbar_search' ); ?>
<div class="clear"></div>
</ul>
</div>
</div>
</div><!--#topbar-->
<?php do_action( '_after_topbar' ); ?>
<?php do_action( 'codilight_lite_after_topbar' ); ?>

<div class="mobile-navigation">
<?php do_action( '_before_mobile_navigation' ); ?>
<?php do_action( 'codilight_lite_before_mobile_navigation' ); ?>
<ul>
<?php wp_nav_menu( array('theme_location' => 'primary', 'container' => '', 'items_wrap' => '%3$s', 'fallback_cb' => 'codilight_lite_link_to_menu_editor' ) ); ?>
</ul>
<?php do_action( '_after_mobile_navigation' ); ?>
<?php do_action( 'codilight_lite_after_mobile_navigation' ); ?>
</div>

<?php do_action( '_before_site_header' ); ?>
<?php do_action( 'codilight_lite_lite_before_site_header' ); ?>
<header id="masthead" class="site-header" role="banner">
<div class="container">
<div class="site-branding">
Expand All @@ -81,4 +81,4 @@
</div><!-- .site-branding -->
</div>
</header><!-- #masthead -->
<?php do_action( '_after_site_header' ); ?>
<?php do_action( 'codilight_lite_after_site_header' ); ?>
14 changes: 0 additions & 14 deletions inc/customizer-controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ public function render_content() {
}
}

class Codilight_Lite_Textarea_Custom_Control extends WP_Customize_Control
{
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<textarea class="large-text" cols="20" rows="5" <?php $this->link(); ?>>
<?php echo esc_textarea( $this->value() ); ?>
</textarea>
<p class="description"><?php echo $this->description ?></p>
</label>
<?php
}
}

class Codilight_Lite_Theme_Support extends WP_Customize_Control {
public function render_content() {
Expand Down
2 changes: 1 addition & 1 deletion inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function codilight_lite_customize_register( $wp_customize ) {
'list' => 'List',
'grid' => 'Grid',
),
'description' => esc_html__( 'Category, Tag, Author, Archive Page ...', 'codilight-lite' ),
'description' => esc_html__( 'Category, Tag, Author, Archive Page&hellip;', 'codilight-lite' ),
) );

$wp_customize->add_setting( 'codilight_lite_color_message',
Expand Down
8 changes: 4 additions & 4 deletions inc/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
add_action('admin_menu', 'codilight_lite_theme_info');
function codilight_lite_theme_info() {
$theme_data = wp_get_theme();
add_theme_page( sprintf( esc_html__( '%s Theme Dashboard', 'codilight-lite' ), $theme_data->Name ), sprintf( esc_html__('%s', 'codilight-lite'), $theme_data->Name), 'edit_themes', 'ft_codilight_lite', 'codilight_lite_theme_info_page');
add_theme_page( sprintf( esc_html__( '%s Theme Dashboard', 'codilight-lite' ), $theme_data->Name ), sprintf( esc_html__('%s', 'codilight-lite'), $theme_data->Name), 'edit_theme_options', 'ft_codilight_lite', 'codilight_lite_theme_info_page');
}

function codilight_lite_theme_info_page() {
Expand All @@ -28,21 +28,21 @@ function codilight_lite_theme_info_page() {
<h3><?php esc_html_e( 'Theme Customizer', 'codilight-lite' ); ?></h3>
<p class="about"><?php printf(esc_html__('%s supports the Theme Customizer for all theme settings. Click "Customize" to start customize your site.', 'codilight-lite'), $theme_data->Name); ?></p>
<p>
<a href="<?php echo admin_url('customize.php'); ?>" class="button button-primary"><?php esc_html_e('Start Customize', 'codilight-lite'); ?></a>
<a href="<?php echo esc_url( admin_url('customize.php') ); ?>" class="button button-primary"><?php esc_html_e('Start Customize', 'codilight-lite'); ?></a>
</p>
</div>
<div class="theme_link">
<h3><?php esc_html_e( 'Theme Documentation', 'codilight-lite' ); ?></h3>
<p class="about"><?php printf(esc_html__('Need any help to setup and configure %s? Please have a look at our documentations instructions.', 'codilight-lite'), $theme_data->Name); ?></p>
<p>
<a href="<?php echo esc_url( esc_html__( 'http://docs.famethemes.com/category/30-codilight-lite', 'codilight-lite' ) ); ?>" target="_blank" class="button button-secondary"><?php esc_html_e('Online Documentation', 'codilight-lite'); ?></a>
<a href="http://docs.famethemes.com/category/30-codilight-lite" target="_blank" class="button button-secondary"><?php esc_html_e('Online Documentation', 'codilight-lite'); ?></a>
</p>
</div>
<div class="theme_link">
<h3><?php esc_html_e( 'Having Trouble, Need Support?', 'codilight-lite' ); ?></h3>
<p class="about"><?php printf(esc_html__('Support for %s WordPress theme is conducted through the WordPress free theme support forum.', 'codilight-lite'), $theme_data->Name); ?></p>
<p>
<a href="<?php echo esc_url( esc_html__( 'https://wordpress.org/support/theme/codilight-lite', 'codilight-lite' ) ); ?>" target="_blank" class="button button-secondary"><?php echo sprintf( esc_html('Go To %s Support Forum', 'codilight-lite'), $theme_data->Name); ?></a>
<a href="https://wordpress.org/support/theme/codilight-lite" target="_blank" class="button button-secondary"><?php echo sprintf( esc_html('Go To %s Support Forum', 'codilight-lite'), $theme_data->Name); ?></a>
</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function codilight_lite_cat_count_inline($links) {
*/
function codilight_lite_link_to_menu_editor( $args )
{
if ( ! current_user_can( 'manage_options' ) )
if ( ! current_user_can( 'edit_theme_options' ) )
{
return;
}
Expand All @@ -88,7 +88,7 @@ function codilight_lite_link_to_menu_editor( $args )
extract( $args );

$link = $link_before
. '<li><a href="' .admin_url( 'nav-menus.php' ) . '">' . $before . 'Add a menu' . $after . '</a></li>'
. '<li><a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">' . $before . esc_html__( 'Add a menu', 'codilight-lite' ) . $after . '</a></li>'
. $link_after;

// We have a list
Expand Down
29 changes: 0 additions & 29 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,6 @@ function codilight_lite_meta_1() {
}
endif;

if ( ! function_exists( 'codilight_lite_custom_paginate' ) ) :
/**
* Retrieve paginated link for archive post pages.
*/
function codilight_lite_custom_paginate() {
global $wp_query;
$total_pages = $wp_query->max_num_pages;
$big = 999999999;
$translated = __( 'Page', 'codilight-lite' );

if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
echo '<div class="ft-paginate">';
echo paginate_links(array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'prev_next' => True,
'prev_text' => '<i class="fa fa-angle-left"></i>',
'next_text' => '<i class="fa fa-angle-right"></i>',
'current' => $current_page,
'total' => $total_pages,
'before_page_number' => '<span class="screen-reader-text">'.$translated.' </span>'
));
//echo '<span class="total-pages">Page '. $current_page .' of '. $total_pages .'</span>';
printf( '<span class="total-pages">'. esc_html__( 'Page %1$s of %2$s', 'codilight-lite' ) .'</span>', $current_page, $total_pages );
echo '</div>';
}
}
endif;

if ( ! function_exists( 'codilight_lite_posted_on' ) ) :
/**
Expand Down
6 changes: 2 additions & 4 deletions inc/widgets/block_1_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function update( $new_instance, $old_instance ) {
$instance['ignore_sticky'] = isset($new_instance['ignore_sticky']) ? strip_tags($new_instance['ignore_sticky']) : '';
$instance['layout'] = $new_instance['layout'];
$instance['featured_categories'] = $new_instance['featured_categories'];
$instance['number_posts'] = $new_instance['number_posts'];
$instance['number_posts'] = absint( $new_instance['number_posts'] );
$instance['orderby'] = $new_instance['orderby'];

return $instance;
Expand Down Expand Up @@ -226,9 +226,7 @@ public function form( $instance ) {
<?php } ?>
</select>
</p>
<p>
<?php wp_kses( _e('<strong>Upgrade To Pro:</strong> This is the Lite Version of this widget with only basic options. You can upgrade to <a target="_blank" href="http://www.famethemes.com/themes/codilight/?utm_source=codilight_lite_widget&utm_medium=text_link&utm_campaign=codilight_lite">Codilight Pro</a> for more features and options.', 'codilight-lite' ), array( 'strong' => array(), 'a' => array( 'href' => array() ) ) ); ?><br />
</p>

<?php
}
}
6 changes: 2 additions & 4 deletions inc/widgets/block_2_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function update( $new_instance, $old_instance ) {
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['ignore_sticky'] = isset($new_instance['ignore_sticky']) ? strip_tags($new_instance['ignore_sticky']) : '';
$instance['featured_categories'] = $new_instance['featured_categories'];
$instance['number_posts'] = $new_instance['number_posts'];
$instance['number_posts'] = absint( $new_instance['number_posts'] );
$instance['orderby'] = $new_instance['orderby'];

return $instance;
Expand Down Expand Up @@ -215,9 +215,7 @@ public function form( $instance ) {
<?php } ?>
</select>
</p>
<p>
<?php wp_kses( _e('<strong>Upgrade To Pro:</strong> This is the Lite Version of this widget with only basic options. You can upgrade to <a target="_blank" href="http://www.famethemes.com/themes/codilight/?utm_source=codilight_lite_widget&utm_medium=text_link&utm_campaign=codilight_lite">Codilight Pro</a> for more features and options.', 'codilight-lite' ), array( 'strong' => array(), 'a' => array( 'href' => array() ) ) ); ?><br />
</p>

<?php
}
}
Loading

0 comments on commit a63b73f

Please sign in to comment.