Skip to content

Commit

Permalink
Typography update + CSS updates
Browse files Browse the repository at this point in the history
* Removed: Recommendation of Everest Backup plugin.
* Fixed: PHP error - `PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function get_day_link(), 1 passed in /breadcrumbs.php on line 802 and exactly 3 expected.`
* Added: Typography options for body and headings.
* Fix: Minor style fixes.
* Fix: Minor PHP fixes.
* Updated: WPCS maintained.
  • Loading branch information
Asok17 committed Apr 25, 2023
1 parent e601474 commit aa2547e
Show file tree
Hide file tree
Showing 35 changed files with 40,215 additions and 101 deletions.
12 changes: 9 additions & 3 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@
* @hooked royale_news_breadcrumb_action - 10
*/
do_action( 'royale_news_breadcrumb' );

$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

$primary_container_class = '';

if ( 'left' === $royale_news_sidebar_position || 'right' === $royale_news_sidebar_position ) {
$primary_container_class = 'royale-news-sidebar-position-' . $royale_news_sidebar_position;
}
?>
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?>">
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?> <?php echo esc_attr( $primary_container_class ); ?>">
<main id="main" class="site-main">
<div class="container">
<div class="row">
<?php
$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

if (
'none' === $royale_news_sidebar_position ||
! is_active_sidebar( 'sidebar-1' )
Expand Down
2 changes: 1 addition & 1 deletion assets/dist/css/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/css/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/src/scss/custom/_skin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ input[type="submit"]:hover {
.news-content-top:hover .news-image .mask {

background-color: rgba(0, 0, 0, .5);
}
}
9 changes: 6 additions & 3 deletions assets/src/scss/custom/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ body.no-sidebar.boxed .alignwide {
.ticker-news a {

color: rgba(255, 255, 255, 1);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.current-date-container,
Expand Down Expand Up @@ -1539,7 +1537,6 @@ body.no-sidebar.boxed .alignwide {

.nav-links {
text-align: center;
overflow: auto;
}

.page-numbers {
Expand Down Expand Up @@ -2169,5 +2166,11 @@ b.fn {
height:350px;
}

.archive-section-content .news-image {
margin-bottom: 15px;
}

.royale-news-sidebar-position-right .royale-news-sidebar {
margin-top: 30px;
}
}
8 changes: 4 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ function royale_news_scripts() {
'all'
);

if ( ! royale_news_get_option( 'royale_news_disable_google_fonts' ) ) {
if ( royale_news_has_google_fonts() ) {

wp_enqueue_style(
wp_enqueue_style( // phpcs:ignore
'royale-news-font',
royale_news_fonts_url(),
royale_news_get_google_fonts_url(),
array(),
ROYALE_NEWS_VERSION,
null,
'all'
);
}
Expand Down
79 changes: 76 additions & 3 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ function royale_news_customize_register( $wp_customize ) {
// Active callbacks.
require_once trailingslashit( get_template_directory() ) . '/themebeez/customizer/active-callback.php';

// Customization Options.
require_once trailingslashit( get_template_directory() ) . '/themebeez/customizer/options.php';

// Upspell.
require_once trailingslashit( get_template_directory() ) . '/themebeez/customizer/upsell.php';

$wp_customize->register_section_type( 'Royale_News_Customize_Section_Upsell' );

// Typography Control.
require get_template_directory() . '/themebeez/customizer/controls/typography/class-royale-news-customize-typography-control.php';
$wp_customize->register_section_type( 'Royale_News_Customize_Typography_Control' );

// Customization Options.
require_once trailingslashit( get_template_directory() ) . '/themebeez/customizer/options.php';

if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial(
'blogname',
Expand Down Expand Up @@ -135,3 +139,72 @@ function royale_news_customizer_js() {
);
}
add_action( 'customize_controls_enqueue_scripts', 'royale_news_customizer_js' );


if ( ! function_exists( 'royale_news_get_customize_responsive_icon_desktop' ) ) {
/**
* Renders desktop device switcher.
*
* @since 1.0.0
*/
function royale_news_get_customize_responsive_icon_desktop() {
?>
<li class="desktop">
<button type="button" class="preview-desktop active" data-device="desktop">
<?php
echo apply_filters( // phpcs:ignore
'royale_news_filter_responsive_icon_desktop',
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M4 5v11h16V5H4zm-2-.993C2 3.451 2.455 3 2.992 3h18.016c.548 0 .992.449.992 1.007V18H2V4.007zM1 19h22v2H1v-2z"/></svg>'
);
?>
</button>
</li>
<?php
}
}


if ( ! function_exists( 'royale_news_get_customize_responsive_icon_tablet' ) ) {
/**
* Renders tablet device switcher.
*
* @since 1.0.0
*/
function royale_news_get_customize_responsive_icon_tablet() {
?>
<li class="tablet">
<button type="button" class="preview-tablet" data-device="tablet">
<?php
echo apply_filters( // phpcs:ignore
'royale_news_filter_responsive_icon_tablet',
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M6 4v16h12V4H6zM5 2h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm7 15a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>'
);
?>
</button>
</li>
<?php
}
}


if ( ! function_exists( 'royale_news_get_customize_responsive_icon_mobile' ) ) {
/**
* Renders mobile device switcher.
*
* @since 1.0.0
*/
function royale_news_get_customize_responsive_icon_mobile() {
?>
<li class="tablet">
<button type="button" class="preview-mobile" data-device="mobile">
<?php
echo apply_filters( // phpcs:ignore
'royale_news_filter_responsive_icon_mobile',
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M7 4v16h10V4H7zM6 2h12a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 15a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>'
);
?>
</button>
</li>
<?php
}
}
6 changes: 3 additions & 3 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ function royale_news_posted_on() {

$posted_on = '';

if ( true === $show_date ) {
if ( true === $show_date || 1 === $show_date ) {
?>
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark"><?php echo $time_string; // phpcs:ignore. ?></a>
<?php
}

$byline = '';

if ( true === $show_author ) {
if ( true === $show_author || 1 === $show_author ) {
?>
<span class="author vcard"><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php echo esc_html( get_the_author() ); ?></a>
<?php
Expand All @@ -52,7 +52,7 @@ function royale_news_posted_on() {
$comment = '';

if (
true === $show_comments_no &&
( true === $show_comments_no || 1 === $show_comments_no ) &&
comments_open()
) {

Expand Down
13 changes: 9 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@
*/

get_header();
$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

$primary_container_class = '';

if ( 'left' === $royale_news_sidebar_position || 'right' === $royale_news_sidebar_position ) {
$primary_container_class = 'royale-news-sidebar-position-' . $royale_news_sidebar_position;
}
?>
<div id="primary" class="content-area <?php royale_news_home_inner_container_class(); ?>">
<div id="primary" class="content-area <?php royale_news_home_inner_container_class(); ?> <?php echo esc_attr( $primary_container_class ); ?>">
<main id="main" class="site-main">
<?php

$royale_news_enable_feature = royale_news_get_option( 'royale_news_enable_featured_post' );

if (
is_active_sidebar( 'sidebar-2' ) &&
true === $royale_news_enable_feature
( true === $royale_news_enable_feature || 1 === $royale_news_enable_feature )
) {
?>
<div class="featured-widget-container">
Expand All @@ -36,8 +43,6 @@
<div class="container">
<div class="row">
<?php
$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

if (
'none' === $royale_news_sidebar_position ||
! is_active_sidebar( 'sidebar-1' )
Expand Down
12 changes: 9 additions & 3 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
* @hooked royale_news_breadcrumb_action - 10
*/
do_action( 'royale_news_breadcrumb' );

$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

$primary_container_class = '';

if ( 'left' === $royale_news_sidebar_position || 'right' === $royale_news_sidebar_position ) {
$primary_container_class = 'royale-news-sidebar-position-' . $royale_news_sidebar_position;
}
?>
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?>">
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?> <?php echo esc_attr( $primary_container_class ); ?>">
<main id="main" class="site-main">
<div class="container">
<div class="row">
<?php
$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

if (
'none' === $royale_news_sidebar_position ||
! is_active_sidebar( 'sidebar-1' )
Expand Down
11 changes: 10 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Royale News is a simple, clean, minimal and lightweight WordPress theme for crea

== Copyright ==

Royale News WordPress Theme, Copyright (C) 2022, themebeez
Royale News WordPress Theme, Copyright (C) 2023, themebeez
Royale News is distributed under the terms of the GNU GPL

== Credits ==
Expand Down Expand Up @@ -82,6 +82,15 @@ Royale News includes support for Infinite Scroll in Jetpack.

== Changelog ==

== 2.2.1 - 25 April, 2022 ==

* Removed: Recommendation of Everest Backup plugin.
* Fixed: PHP error - `PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function get_day_link(), 1 passed in /breadcrumbs.php on line 802 and exactly 3 expected.`
* Added: Typography options for body and headings.
* Fix: Minor style fixes.
* Fix: Minor PHP fixes.
* Updated: WPCS maintained.

== 2.2.0 - 29 May, 2022 ==

* Update: Everest Backup plugin recommended.
Expand Down
12 changes: 9 additions & 3 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@
* @hooked royale_news_breadcrumb_action - 10
*/
do_action( 'royale_news_breadcrumb' );

$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

$primary_container_class = '';

if ( 'left' === $royale_news_sidebar_position || 'right' === $royale_news_sidebar_position ) {
$primary_container_class = 'royale-news-sidebar-position-' . $royale_news_sidebar_position;
}
?>
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?>">
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?> <?php echo esc_attr( $primary_container_class ); ?>">
<main id="main" class="site-main">
<div class="container">
<div class="row">
<?php
$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

if (
'none' === $royale_news_sidebar_position ||
! is_active_sidebar( 'sidebar-1' )
Expand Down
2 changes: 1 addition & 1 deletion sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
return;
}
?>
<div class="col-md-4 sticky-section">
<div class="col-md-4 royale-news-sidebar sticky-section">
<div class="row clearfix sidebar">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div><!-- .row.clearfix.sidebar -->
Expand Down
12 changes: 9 additions & 3 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@
* @hooked royale_news_breadcrumb_action - 10
*/
do_action( 'royale_news_breadcrumb' );

$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

$primary_container_class = '';

if ( 'left' === $royale_news_sidebar_position || 'right' === $royale_news_sidebar_position ) {
$primary_container_class = 'royale-news-sidebar-position-' . $royale_news_sidebar_position;
}
?>
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?>">
<div id="primary" class="content-area <?php royale_news_inner_container_class(); ?> <?php echo esc_attr( $primary_container_class ); ?>">
<main id="main" class="site-main">
<div class="container">
<div class="row">
<?php
$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

if (
'none' === $royale_news_sidebar_position ||
! is_active_sidebar( 'sidebar-1' )
Expand Down
18 changes: 12 additions & 6 deletions template-frontpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,29 @@
</div>
<?php
}

$royale_news_sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

$primary_container_class = '';

if ( 'left' === $royale_news_sidebar_position || 'right' === $royale_news_sidebar_position ) {
$primary_container_class = 'royale-news-sidebar-position-' . $royale_news_sidebar_position;
}
?>
<div class="<?php royale_news_home_middle_class(); ?>">
<div class="<?php royale_news_home_middle_class(); ?> <?php echo esc_attr( $primary_container_class ); ?>">
<div class="container">
<div class="row clearfix middle-section">
<?php
$sidebar_position = royale_news_get_option( 'royale_news_sidebar_position' );

if (
'none' === $sidebar_position ||
'none' === $royale_news_sidebar_position ||
! is_active_sidebar( 'sidebar-1' )
) {
$class = 'col-md-12';
} else {
$class = 'col-md-8 sticky-section';
}

if ( 'left' === $sidebar_position ) {
if ( 'left' === $royale_news_sidebar_position ) {
get_sidebar();
}
?>
Expand All @@ -53,7 +59,7 @@
?>
</div>
<?php
if ( 'right' === $sidebar_position ) {
if ( 'right' === $royale_news_sidebar_position ) {
get_sidebar();
}
?>
Expand Down
5 changes: 4 additions & 1 deletion template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
</div><!-- .news-section-info -->
<div class="single-news-content">
<?php
if ( has_post_thumbnail() && true === $royale_news_display_featured_image ) {
if (
has_post_thumbnail() &&
( true === $royale_news_display_featured_image || 1 === $royale_news_display_featured_image )
) {
?>
<div class="news-image">
<?php
Expand Down
Loading

0 comments on commit aa2547e

Please sign in to comment.