Initial commit
752
colormag/inc/admin/class-colormag-admin.php
Normal file
@@ -0,0 +1,752 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Admin Class.
|
||||
*
|
||||
* @author ThemeGrill
|
||||
* @package ColorMag
|
||||
* @since 1.1.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'ColorMag_Admin' ) ) :
|
||||
|
||||
/**
|
||||
* ColorMag_Admin Class.
|
||||
*/
|
||||
class ColorMag_Admin {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
||||
add_action( 'wp_loaded', array( __CLASS__, 'hide_notices' ) );
|
||||
add_action( 'wp_loaded', array( $this, 'admin_notice' ) );
|
||||
add_action( 'wp_ajax_import_button', array( $this, 'colormag_ajax_import_button_handler' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'colormag_ajax_enqueue_scripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Localize array for import button AJAX request.
|
||||
*/
|
||||
public function colormag_ajax_enqueue_scripts() {
|
||||
|
||||
wp_enqueue_script( 'updates' );
|
||||
wp_enqueue_script( 'colormag-plugin-install-helper', get_template_directory_uri() . '/inc/admin/js/plugin-handle.js', array( 'jquery' ), 1, true );
|
||||
wp_localize_script(
|
||||
'colormag-plugin-install-helper', 'colormag_plugin_helper',
|
||||
array(
|
||||
'activating' => esc_html__( 'Activating ', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$translation_array = array(
|
||||
'uri' => esc_url( admin_url( '/themes.php?page=demo-importer&browse=all&colormag-hide-notice=welcome' ) ),
|
||||
'btn_text' => esc_html__( 'Processing...', 'colormag' ),
|
||||
'nonce' => wp_create_nonce( 'colormag_demo_import_nonce' ),
|
||||
);
|
||||
|
||||
wp_localize_script( 'colormag-plugin-install-helper', 'colormag_redirect_demo_page', $translation_array );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the AJAX process while import or get started button clicked.
|
||||
*/
|
||||
public function colormag_ajax_import_button_handler() {
|
||||
|
||||
check_ajax_referer( 'colormag_demo_import_nonce', 'security' );
|
||||
|
||||
$state = '';
|
||||
if ( is_plugin_active( 'themegrill-demo-importer/themegrill-demo-importer.php' ) ) {
|
||||
$state = 'activated';
|
||||
} elseif ( file_exists( WP_PLUGIN_DIR . '/themegrill-demo-importer/themegrill-demo-importer.php' ) ) {
|
||||
$state = 'installed';
|
||||
}
|
||||
|
||||
if ( 'activated' === $state ) {
|
||||
$response['redirect'] = admin_url( '/themes.php?page=demo-importer&browse=all&colormag-hide-notice=welcome' );
|
||||
} elseif ( 'installed' === $state ) {
|
||||
$response['redirect'] = admin_url( '/themes.php?page=demo-importer&browse=all&colormag-hide-notice=welcome' );
|
||||
if ( current_user_can( 'activate_plugin' ) ) {
|
||||
$result = activate_plugin( 'themegrill-demo-importer/themegrill-demo-importer.php' );
|
||||
|
||||
if ( is_wp_error( $result ) ) {
|
||||
$response['errorCode'] = $result->get_error_code();
|
||||
$response['errorMessage'] = $result->get_error_message();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
|
||||
$response['redirect'] = admin_url( '/themes.php?page=demo-importer&browse=all&colormag-hide-notice=welcome' );
|
||||
|
||||
/**
|
||||
* Install Plugin.
|
||||
*/
|
||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
||||
|
||||
$api = plugins_api( 'plugin_information', array(
|
||||
'slug' => sanitize_key( wp_unslash( 'themegrill-demo-importer' ) ),
|
||||
'fields' => array(
|
||||
'sections' => false,
|
||||
),
|
||||
) );
|
||||
|
||||
$skin = new WP_Ajax_Upgrader_Skin();
|
||||
$upgrader = new Plugin_Upgrader( $skin );
|
||||
$result = $upgrader->install( $api->download_link );
|
||||
if ( $result ) {
|
||||
$response['installed'] = 'succeed';
|
||||
} else {
|
||||
$response['installed'] = 'failed';
|
||||
}
|
||||
|
||||
// Activate plugin.
|
||||
if ( current_user_can( 'activate_plugin' ) ) {
|
||||
$result = activate_plugin( 'themegrill-demo-importer/themegrill-demo-importer.php' );
|
||||
|
||||
if ( is_wp_error( $result ) ) {
|
||||
$response['errorCode'] = $result->get_error_code();
|
||||
$response['errorMessage'] = $result->get_error_message();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wp_send_json( $response );
|
||||
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add admin menu.
|
||||
*/
|
||||
public function admin_menu() {
|
||||
$theme = wp_get_theme( get_template() );
|
||||
|
||||
$page = add_theme_page( esc_html__( 'About', 'colormag' ) . ' ' . $theme->display( 'Name' ), esc_html__( 'About', 'colormag' ) . ' ' . $theme->display( 'Name' ), 'activate_plugins', 'colormag-sitelibrary', array(
|
||||
$this,
|
||||
'sitelibrary_screen',
|
||||
) );
|
||||
add_action( 'admin_print_styles-' . $page, array( $this, 'enqueue_styles' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue styles.
|
||||
*/
|
||||
public function enqueue_styles() {
|
||||
global $colormag_version;
|
||||
|
||||
wp_enqueue_style( 'colormag-welcome', get_template_directory_uri() . '/css/admin/welcome.css', array(), $colormag_version );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add admin notice.
|
||||
*/
|
||||
public function admin_notice() {
|
||||
global $colormag_version, $pagenow;
|
||||
|
||||
wp_enqueue_style( 'colormag-message', get_template_directory_uri() . '/css/admin/message.css', array(), $colormag_version );
|
||||
|
||||
// Let's bail on theme activation.
|
||||
$notice_nag = get_option( 'colormag_admin_notice_welcome' );
|
||||
if ( ! $notice_nag ) {
|
||||
add_action( 'admin_notices', array( $this, 'welcome_notice' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide a notice if the GET variable is set.
|
||||
*/
|
||||
public static function hide_notices() {
|
||||
if ( isset( $_GET['colormag-hide-notice'] ) && isset( $_GET['_colormag_notice_nonce'] ) ) {
|
||||
if ( ! wp_verify_nonce( $_GET['_colormag_notice_nonce'], 'colormag_hide_notices_nonce' ) ) {
|
||||
wp_die( __( 'Action failed. Please refresh the page and retry.', 'colormag' ) );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
wp_die( __( 'Cheatin’ huh?', 'colormag' ) );
|
||||
}
|
||||
|
||||
$hide_notice = sanitize_text_field( $_GET['colormag-hide-notice'] );
|
||||
update_option( 'colormag_admin_notice_' . $hide_notice, 1 );
|
||||
|
||||
// Hide.
|
||||
if ( 'welcome' === $_GET['colormag-hide-notice'] ) {
|
||||
update_option( 'colormag_admin_notice_' . $hide_notice, 1 );
|
||||
} else { // Show.
|
||||
delete_option( 'colormag_admin_notice_' . $hide_notice );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show welcome notice.
|
||||
*/
|
||||
public function welcome_notice() {
|
||||
?>
|
||||
<div id="message" class="updated colormag-message">
|
||||
<a class="colormag-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'activated' ), add_query_arg( 'colormag-hide-notice', 'welcome' ) ), 'colormag_hide_notices_nonce', '_colormag_notice_nonce' ) ); ?>">
|
||||
<?php esc_html_e( 'Dismiss', 'colormag' ); ?>
|
||||
</a>
|
||||
|
||||
<div class="colormag-message-wrapper">
|
||||
<div class="colormag-logo">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/img/colormag-getting-started-logo.png" alt="<?php esc_html_e( 'ColorMag', 'colormag' ); ?>" /><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped, Squiz.PHP.EmbeddedPhp.SpacingBeforeClose ?>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<?php printf( esc_html__( 'Welcome! Thank you for choosing ColorMag! To fully take advantage of the best our theme can offer please make sure you visit our %swelcome page%s.', 'colormag' ), '<a href="' . esc_url( admin_url( 'themes.php?page=colormag-welcome' ) ) . '">', '</a>' ); ?>
|
||||
|
||||
<span class="plugin-install-notice"><?php esc_html_e( 'Clicking the button below will install and activate the ThemeGrill demo importer plugin.', 'colormag' ); ?></span>
|
||||
</p>
|
||||
|
||||
<div class="submit">
|
||||
<a class="btn-get-started button button-primary button-hero" href="#" data-name="" data-slug="" aria-label="<?php esc_html_e( 'Get started with ColorMag', 'colormag' ); ?>"><?php esc_html_e( 'Get started with ColorMag', 'colormag' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Intro text/links shown to all about pages.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function intro() {
|
||||
global $colormag_version;
|
||||
$theme = wp_get_theme( get_template() );
|
||||
?>
|
||||
<div class="header">
|
||||
<div class="info">
|
||||
<h1>
|
||||
<?php esc_html_e( 'About', 'colormag' ); ?>
|
||||
<?php echo $theme->display( 'Name' ); ?>
|
||||
<span class="version-container"><?php echo esc_html( $colormag_version ); ?></span>
|
||||
</h1>
|
||||
|
||||
<div class="tg-about-text about-text">
|
||||
<?php echo $theme->display( 'Description' ); ?>
|
||||
</div>
|
||||
|
||||
<a href="https://themegrill.com/" target="_blank" class="wp-badge tg-welcome-logo"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="colormag-actions">
|
||||
<a href="<?php echo esc_url( 'https://themegrill.com/themes/colormag/?utm_source=colormag-about&utm_medium=theme-info-link&utm_campaign=theme-info' ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'Theme Info', 'colormag' ); ?></a>
|
||||
|
||||
<a href="<?php echo esc_url( apply_filters( 'colormag_pro_theme_url', 'https://demo.themegrill.com/colormag/' ) ); ?>" class="button button-secondary docs" target="_blank"><?php esc_html_e( 'View Demo', 'colormag' ); ?></a>
|
||||
|
||||
<a href="<?php echo esc_url( apply_filters( 'colormag_pro_theme_url', 'https://themegrill.com/themes/colormag/?utm_source=colormag-about&utm_medium=view-pro-link&utm_campaign=view-pro#free-vs-pro' ) ); ?>" class="button button-primary docs" target="_blank"><?php esc_html_e( 'View PRO version', 'colormag' ); ?></a>
|
||||
|
||||
<a href="<?php echo esc_url( apply_filters( 'colormag_pro_theme_url', 'https://wordpress.org/support/theme/colormag/reviews/?filter=5' ) ); ?>" class="button button-secondary docs" target="_blank"><?php esc_html_e( 'Rate this theme', 'colormag' ); ?></a>
|
||||
</p>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a class="nav-tab <?php if ( empty( $_GET['tab'] ) && $_GET['page'] == 'colormag-sitelibrary' ) {
|
||||
echo 'nav-tab-active';
|
||||
} ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'colormag-sitelibrary' ), 'themes.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Site Library', 'colormag' ); ?>
|
||||
</a>
|
||||
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'welcome' ) {
|
||||
echo 'nav-tab-active';
|
||||
} ?>" href="<?php echo esc_url( admin_url( add_query_arg( array(
|
||||
'page' => 'colormag-sitelibrary',
|
||||
'tab' => 'welcome',
|
||||
), 'themes.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Getting Started', 'colormag' ); ?>
|
||||
</a>
|
||||
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'supported_plugins' ) {
|
||||
echo 'nav-tab-active';
|
||||
} ?>" href="<?php echo esc_url( admin_url( add_query_arg( array(
|
||||
'page' => 'colormag-sitelibrary',
|
||||
'tab' => 'supported_plugins',
|
||||
), 'themes.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Recommended Plugins', 'colormag' ); ?>
|
||||
</a>
|
||||
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'free_vs_pro' ) {
|
||||
echo 'nav-tab-active';
|
||||
} ?>" href="<?php echo esc_url( admin_url( add_query_arg( array(
|
||||
'page' => 'colormag-sitelibrary',
|
||||
'tab' => 'free_vs_pro',
|
||||
), 'themes.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Free Vs Pro', 'colormag' ); ?>
|
||||
</a>
|
||||
<a class="nav-tab <?php if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'changelog' ) {
|
||||
echo 'nav-tab-active';
|
||||
} ?>" href="<?php echo esc_url( admin_url( add_query_arg( array(
|
||||
'page' => 'colormag-sitelibrary',
|
||||
'tab' => 'changelog',
|
||||
), 'themes.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Changelog', 'colormag' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Site library screen page.
|
||||
*/
|
||||
public function sitelibrary_screen() {
|
||||
$current_tab = empty( $_GET['tab'] ) ? 'library' : sanitize_title( $_GET['tab'] );
|
||||
|
||||
// Look for a {$current_tab}_screen method.
|
||||
if ( is_callable( array( $this, $current_tab . '_screen' ) ) ) {
|
||||
return $this->{$current_tab . '_screen'}();
|
||||
}
|
||||
|
||||
// Fallback to about screen.
|
||||
return $this->sitelibrary_display_screen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render site library.
|
||||
*/
|
||||
public function sitelibrary_display_screen() {
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
<?php
|
||||
$this->intro();
|
||||
?>
|
||||
|
||||
<div class="plugin-install-notice">
|
||||
<?php esc_html_e( 'Clicking the "Import" button in any of the demos below will install and activate the ThemeGrill demo importer plugin.', 'colormag' ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Display site library.
|
||||
echo ColorMag_Site_Library::colormag_site_library_page_content();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Welcome screen page.
|
||||
*/
|
||||
public function welcome_screen() {
|
||||
$this->about_screen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the about screen.
|
||||
*/
|
||||
public function about_screen() {
|
||||
$theme = wp_get_theme( get_template() );
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<div class="under-the-hood two-col">
|
||||
<div class="col">
|
||||
<h3><?php esc_html_e( 'Import Demo', 'colormag' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Needs ThemeGrill Demo Importer plugin.', 'colormag' ) ?></p>
|
||||
|
||||
<div class="submit">
|
||||
<a class="btn-get-started button button-primary button-hero" href="#" data-name="" data-slug="" aria-label="<?php esc_html_e( 'Import', 'colormag' ); ?>"><?php esc_html_e( 'Import', 'colormag' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h3><?php esc_html_e( 'Theme Customizer', 'colormag' ); ?></h3>
|
||||
<p><?php esc_html_e( 'All Theme Options are available via Customize screen.', 'colormag' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo admin_url( 'customize.php' ); ?>" class="button button-secondary"><?php esc_html_e( 'Customize', 'colormag' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h3><?php esc_html_e( 'Documentation', 'colormag' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Please view our documentation page to setup the theme.', 'colormag' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( 'https://docs.themegrill.com/colormag/?utm_source=colormag-about&utm_medium=documentation-link&utm_campaign=documentation' ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'Documentation', 'colormag' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h3><?php esc_html_e( 'Got theme support question?', 'colormag' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Please put it in our dedicated support forum.', 'colormag' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( 'https://themegrill.com/support-forum/?utm_source=colormag-about&utm_medium=support-forum-link&utm_campaign=support-forum' ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'Support', 'colormag' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h3><?php esc_html_e( 'Need more features?', 'colormag' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Upgrade to PRO version for more exciting features.', 'colormag' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( 'https://themegrill.com/themes/colormag/?utm_source=colormag-about&utm_medium=view-pro-link&utm_campaign=view-pro#free-vs-pro' ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'View PRO version', 'colormag' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h3><?php esc_html_e( 'Got sales related question?', 'colormag' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Please send it via our sales contact page.', 'colormag' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( 'https://themegrill.com/contact/?utm_source=colormag-about&utm_medium=contact-page-link&utm_campaign=contact-page' ); ?>" class="button button-secondary" target="_blank"><?php esc_html_e( 'Contact Page', 'colormag' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h3>
|
||||
<?php
|
||||
esc_html_e( 'Translate', 'colormag' );
|
||||
echo ' ' . $theme->display( 'Name' );
|
||||
?>
|
||||
</h3>
|
||||
<p><?php esc_html_e( 'Click below to translate this theme into your own language.', 'colormag' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( 'https://translate.wordpress.org/projects/wp-themes/colormag' ); ?>" class="button button-secondary" target="_blank">
|
||||
<?php
|
||||
esc_html_e( 'Translate', 'colormag' );
|
||||
echo ' ' . $theme->display( 'Name' );
|
||||
?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="return-to-dashboard colormag">
|
||||
<?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>
|
||||
<a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>">
|
||||
<?php is_multisite() ? esc_html_e( 'Return to Updates', 'colormag' ) : esc_html_e( 'Return to Dashboard → Updates', 'colormag' ); ?>
|
||||
</a> |
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo esc_url( self_admin_url() ); ?>"><?php is_blog_admin() ? esc_html_e( 'Go to Dashboard → Home', 'colormag' ) : esc_html_e( 'Go to Dashboard', 'colormag' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the changelog screen.
|
||||
*/
|
||||
public function changelog_screen() {
|
||||
global $wp_filesystem;
|
||||
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<p class="about-description"><?php esc_html_e( 'View changelog below:', 'colormag' ); ?></p>
|
||||
|
||||
<?php
|
||||
$changelog_file = apply_filters( 'colormag_changelog_file', get_template_directory() . '/readme.txt' );
|
||||
|
||||
// Check if the changelog file exists and is readable.
|
||||
if ( $changelog_file && is_readable( $changelog_file ) ) {
|
||||
WP_Filesystem();
|
||||
$changelog = $wp_filesystem->get_contents( $changelog_file );
|
||||
$changelog_list = $this->parse_changelog( $changelog );
|
||||
|
||||
echo wp_kses_post( $changelog_list );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse changelog from readme file.
|
||||
*
|
||||
* @param string $content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function parse_changelog( $content ) {
|
||||
$matches = null;
|
||||
$regexp = '~==\s*Changelog\s*==(.*)($)~Uis';
|
||||
$changelog = '';
|
||||
|
||||
if ( preg_match( $regexp, $content, $matches ) ) {
|
||||
$changes = explode( '\r\n', trim( $matches[1] ) );
|
||||
|
||||
$changelog .= '<pre class="changelog">';
|
||||
|
||||
foreach ( $changes as $index => $line ) {
|
||||
$changelog .= wp_kses_post( preg_replace( '~(=\s*Version\s*(\d+(?:\.\d+)+)\s*=|$)~Uis', '<span class="title">${1}</span>', $line ) );
|
||||
}
|
||||
|
||||
$changelog .= '</pre>';
|
||||
}
|
||||
|
||||
return wp_kses_post( $changelog );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output the supported plugins screen.
|
||||
*/
|
||||
public function supported_plugins_screen() {
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<p class="about-description"><?php esc_html_e( 'This theme recommends following plugins:', 'colormag' ); ?></p>
|
||||
<ol>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/social-icons/' ); ?>" target="_blank"><?php esc_html_e( 'Social Icons', 'colormag' ); ?></a>
|
||||
<?php esc_html_e( ' by ThemeGrill', 'colormag' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/easy-social-sharing/' ); ?>" target="_blank"><?php esc_html_e( 'Easy Social Sharing', 'colormag' ); ?></a>
|
||||
<?php esc_html_e( ' by ThemeGrill', 'colormag' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/everest-forms/' ); ?>" target="_blank"><?php esc_html_e( 'Everest Forms – Easy Contact Form and Form Builder', 'colormag' ); ?></a>
|
||||
<?php esc_html_e( ' by WPEverest', 'colormag' ); ?></li>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/wp-pagenavi/' ); ?>" target="_blank"><?php esc_html_e( 'WP-PageNavi', 'colormag' ); ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/woocommerce/' ); ?>" target="_blank"><?php esc_html_e( 'WooCommerce', 'colormag' ); ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/polylang/' ); ?>" target="_blank"><?php esc_html_e( 'Polylang', 'colormag' ); ?></a>
|
||||
<?php esc_html_e( 'Fully Compatible in Pro Version', 'colormag' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo esc_url( 'https://wpml.org/' ); ?>" target="_blank"><?php esc_html_e( 'WPML', 'colormag' ); ?></a>
|
||||
<?php esc_html_e( 'Fully Compatible in Pro Version', 'colormag' ); ?>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the free vs pro screen.
|
||||
*/
|
||||
public function free_vs_pro_screen() {
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<?php $this->intro(); ?>
|
||||
|
||||
<p class="about-description"><?php esc_html_e( 'Upgrade to PRO version for more exciting features.', 'colormag' ); ?></p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="table-feature-title"><h3><?php esc_html_e( 'Features', 'colormag' ); ?></h3></th>
|
||||
<th><h3><?php esc_html_e( 'ColorMag', 'colormag' ); ?></h3></th>
|
||||
<th><h3><?php esc_html_e( 'ColorMag Pro', 'colormag' ); ?></h3></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Support', 'colormag' ); ?></h3></td>
|
||||
<td><?php esc_html_e( 'Forum', 'colormag' ); ?></td>
|
||||
<td><?php esc_html_e( 'Forum + Emails/Support Ticket', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Color Options', 'colormag' ); ?></h3></td>
|
||||
<td><?php esc_html_e( '1', 'colormag' ); ?></td>
|
||||
<td><?php esc_html_e( '22', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Primary color option', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Font Size Options', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Google Fonts Options', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><?php esc_html_e( '600+', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Custom Widgets', 'colormag' ); ?></h3></td>
|
||||
<td><?php esc_html_e( '7', 'colormag' ); ?></td>
|
||||
<td><?php esc_html_e( '16', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Social Icons', 'colormag' ); ?></h3></td>
|
||||
<td><?php esc_html_e( '6', 'colormag' ); ?></td>
|
||||
<td><?php esc_html_e( '18 + 6 Custom', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Social Sharing', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Custom Menu', 'colormag' ); ?></h3></td>
|
||||
<td><?php esc_html_e( '1', 'colormag' ); ?></td>
|
||||
<td><?php esc_html_e( '2', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Footer Sidebar', 'colormag' ); ?></h3></td>
|
||||
<td><?php esc_html_e( '4', 'colormag' ); ?></td>
|
||||
<td><?php esc_html_e( '7', 'colormag' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Site Layout Option', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Options in Breaking News', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Unique Post System', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Change Read More Text', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Related Posts', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Author Biography', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Author Biography with Social Icons', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Footer Copyright Editor', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: 125x125 Advertisement', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: 300x250 Advertisement', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: 728x90 Advertisement', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Category Slider', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Highlighted Posts', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Random Posts Widget', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Tabbed Widget', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Videos', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 1)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 2)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 3)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 4)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 5)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 6)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'TG: Featured Posts (Style 7)', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Category Color Options', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'WPML Compatible', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'Polylang Compatible', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-no"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h3><?php esc_html_e( 'WooCommerce Compatible', 'colormag' ); ?></h3></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="btn-wrapper">
|
||||
<a href="<?php echo esc_url( apply_filters( 'colormag_pro_theme_url', 'https://themegrill.com/themes/colormag/?utm_source=colormag-free-vs-pro-table&utm_medium=view-pro-link&utm_campaign=view-pro#free-vs-pro' ) ); ?>" class="button button-secondary docs" target="_blank"><?php esc_html_e( 'View Pro', 'colormag' ); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
return new ColorMag_Admin();
|
||||
152
colormag/inc/admin/class-colormag-site-library.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag_Site_Library class to fetch the
|
||||
* theme demo configs from GitHub repo.
|
||||
*
|
||||
* @package ColorMag
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class responsible for showcasing the theme demo
|
||||
* in ThemeGrill Demo page.
|
||||
*
|
||||
* Class ColorMag_Site_Library
|
||||
*/
|
||||
class ColorMag_Site_Library {
|
||||
|
||||
/**
|
||||
* Constructor function.
|
||||
*
|
||||
* ColorMag_Site_Library constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->colormag_site_library_demo_packages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Demo config packages
|
||||
*/
|
||||
public function colormag_site_library_demo_packages() {
|
||||
$this->colormag_site_library_get_demos();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the demo packages.
|
||||
*
|
||||
* @return array|mixed|null|object|string
|
||||
*/
|
||||
public static function colormag_site_library_get_demos() {
|
||||
$template = 'colormag';
|
||||
$packages = get_transient( 'colormag_site_library_theme_' . $template );
|
||||
|
||||
if ( false === $packages ) {
|
||||
$raw_packages = wp_safe_remote_get( "https://raw.githubusercontent.com/themegrill/themegrill-demo-pack/master/configs/{$template}.json" );
|
||||
|
||||
if ( ! is_wp_error( $raw_packages ) ) {
|
||||
$packages = json_decode( wp_remote_retrieve_body( $raw_packages ) );
|
||||
|
||||
if ( $packages ) {
|
||||
set_transient( 'colormag_site_library_theme_' . $template, $packages, WEEK_IN_SECONDS );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content value filtered to display
|
||||
* the demos of available themes via ThemeGrill Demo Pack
|
||||
* config file.
|
||||
*
|
||||
* @return string The filtered post content.
|
||||
*/
|
||||
public static function colormag_site_library_page_content() {
|
||||
$template = 'colormag';
|
||||
$output = '';
|
||||
$demo_packages = self::colormag_site_library_get_demos();
|
||||
|
||||
if ( isset( $demo_packages ) ) :
|
||||
|
||||
$output .= '<div id="wpbody" class="tg-demo-showcase">';
|
||||
$output .= '<div id="wpbody-content">';
|
||||
$output .= '<div class="wrap">';
|
||||
$output .= '<div class="wp-filter hide-if-no-js">';
|
||||
|
||||
// Renders the theme lists.
|
||||
$output .= '<h2 class="screen-reader-text hide-if-no-js">' . esc_html__( 'Themes list', 'colormag' ) . '</h2><!-- .screen-reader-text.hide-if-no-js -->';
|
||||
$output .= '<div class="theme-browser content-filterable">';
|
||||
$output .= '<div class="themes row wp-clearfix">';
|
||||
|
||||
foreach ( $demo_packages->demos as $demo_package_demo => $demo_package_data ) {
|
||||
$output .= '<div class="theme col-md-4 col-sm-6 col-lg-4 ' . $demo_package_demo . '">';
|
||||
|
||||
// Inner wrapper.
|
||||
$output .= '<div class="theme-inner">';
|
||||
// Displays the theme demo screenshot.
|
||||
$output .= '<div class="screenshot">';
|
||||
$output .= '<img src="' . esc_url( 'https://raw.githubusercontent.com/themegrill/themegrill-demo-pack/master/resources/' . $template . '/' . $demo_package_demo ) . '/screenshot.jpg" alt="' . esc_attr( $demo_package_demo ) . '">';
|
||||
$output .= '</div><!-- .screenshot -->';
|
||||
|
||||
// Displays the pro tag.
|
||||
if ( isset( $demo_package_data->isPro ) ) {
|
||||
$output .= '<span class="premium-demo-banner">';
|
||||
$output .= esc_html__( 'Pro', 'colormag' );
|
||||
$output .= '</span><!-- .premium-demo-banner -->';
|
||||
}
|
||||
|
||||
// Wrap details on div.
|
||||
$output .= '<div class="theme-details">';
|
||||
// Theme id container details.
|
||||
$output .= '<div class="theme-id-container">';
|
||||
|
||||
// Display the theme name.
|
||||
$output .= '<h2 class="theme-name" id="' . $demo_package_demo . '-name">';
|
||||
$output .= $demo_package_data->title;
|
||||
$output .= '</h2><!-- .theme-name -->';
|
||||
|
||||
// Display the theme action buttons.
|
||||
$output .= '<div class="theme-actions">';
|
||||
|
||||
// Import button.
|
||||
if ( ! isset( $demo_package_data->isPro ) ) {
|
||||
$output .= '<a class="btn-get-started button button-primary button-small preview install-demo-preview" href="#" data-name="themegrill-demo-importer" data-slug="themegrill-demo-importer" aria-label="' . esc_html__( 'Get started with ColorMag', 'colormag' ) . '">' . esc_html__( 'Import', 'colormag' ) . '</a>';
|
||||
}
|
||||
|
||||
// Displays the preview now button.
|
||||
$output .= '<a class="button button-small preview install-demo-preview" href="' . esc_url( $demo_package_data->preview ) . '" target="_blank">';
|
||||
$output .= esc_html__( 'Preview', 'colormag' );
|
||||
$output .= '</a>';
|
||||
|
||||
// Displays the buy now button.
|
||||
if ( isset( $demo_package_data->isPro ) ) {
|
||||
$output .= '<a class="button button-small button-primary purchase-now" href="' . $demo_packages->homepage . '" target="_blank">';
|
||||
$output .= esc_html__( 'Buy Now', 'colormag' );
|
||||
$output .= '</a><!-- .button.button-primary.purchase-now -->';
|
||||
}
|
||||
|
||||
$output .= '</div><!-- .theme-actions -->';
|
||||
|
||||
$output .= '</div><!-- .theme-id-container -->';
|
||||
$output .= '</div><!-- .theme-details -->';
|
||||
|
||||
$output .= '</div><!-- .theme-inner -->';
|
||||
|
||||
$output .= '</div><!-- .theme -->';
|
||||
}
|
||||
|
||||
$output .= '</div><!-- .themes.wp-clearfix -->';
|
||||
$output .= '</div><!-- .theme-browser.content-filterable -->';
|
||||
|
||||
$output .= '</div><!-- .wp-filter.hide-if-no-js -->';
|
||||
$output .= '</div><!-- .wrap -->';
|
||||
$output .= '</div><!-- #wpbody-content -->';
|
||||
$output .= '</div><!-- #wpbody -->';
|
||||
|
||||
endif;
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
new ColorMag_Site_Library();
|
||||
185
colormag/inc/admin/class-colormag-theme-review-notice.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Theme Review Notice Class.
|
||||
*
|
||||
* @author ThemeGrill
|
||||
* @package ColorMag
|
||||
* @since 1.3.9
|
||||
*/
|
||||
|
||||
// Exit if directly accessed.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to display the theme review notice for this theme after certain period.
|
||||
*
|
||||
* Class ColorMag_Theme_Review_Notice
|
||||
*/
|
||||
class ColorMag_Theme_Review_Notice {
|
||||
|
||||
/**
|
||||
* Constructor function to include the required functionality for the class.
|
||||
*
|
||||
* ColorMag_Theme_Review_Notice constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_action( 'after_setup_theme', array( $this, 'colormag_theme_rating_notice' ) );
|
||||
add_action( 'switch_theme', array( $this, 'colormag_theme_rating_notice_data_remove' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'colormag_theme_rating_notice_enqueue' ) );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the required option value as needed for theme review notice.
|
||||
*/
|
||||
public function colormag_theme_rating_notice() {
|
||||
|
||||
// Set the installed time in `colormag_theme_installed_time` option table.
|
||||
$option = get_option( 'colormag_theme_installed_time' );
|
||||
if ( ! $option ) {
|
||||
update_option( 'colormag_theme_installed_time', time() );
|
||||
}
|
||||
|
||||
add_action( 'admin_notices', array( $this, 'colormag_theme_review_notice' ), 0 );
|
||||
add_action( 'admin_init', array( $this, 'colormag_ignore_theme_review_notice' ), 0 );
|
||||
add_action( 'admin_init', array( $this, 'colormag_ignore_theme_review_notice_partially' ), 0 );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the theme review notice.
|
||||
*/
|
||||
public function colormag_theme_review_notice() {
|
||||
|
||||
global $current_user;
|
||||
$user_id = $current_user->ID;
|
||||
$current_user = wp_get_current_user();
|
||||
$ignored_notice = get_user_meta( $user_id, 'colormag_ignore_theme_review_notice', true );
|
||||
$ignored_notice_partially = get_user_meta( $user_id, 'nag_colormag_ignore_theme_review_notice_partially', true );
|
||||
|
||||
/**
|
||||
* Return from notice display if:
|
||||
*
|
||||
* 1. The theme installed is less than 15 day ago.
|
||||
* 2. If the user has ignored the message partially for 15 day.
|
||||
* 3. Dismiss always if clicked on 'I Already Did' button.
|
||||
*/
|
||||
if ( ( get_option( 'colormag_theme_installed_time' ) > strtotime( '-15 day' ) ) || ( $ignored_notice_partially > strtotime( '-15 day' ) ) || ( $ignored_notice ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="notice updated theme-review-notice" style="position:relative;">
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* Translators: %1$s current user display name. */
|
||||
esc_html__(
|
||||
'Howdy, %1$s! It seems that you have been using this theme for more than 15 days. We hope you are happy with everything that the theme has to offer. If you can spare a minute, please help us by leaving a 5-star review on WordPress.org. By spreading the love, we can continue to develop new amazing features in the future, for free!', 'colormag'
|
||||
),
|
||||
'<strong>' . esc_html( $current_user->display_name ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<div class="links">
|
||||
<a href="https://wordpress.org/support/theme/colormag/reviews/?filter=5#new-post" class="btn button-primary" target="_blank">
|
||||
<span class="dashicons dashicons-thumbs-up"></span>
|
||||
<span><?php esc_html_e( 'Sure', 'colormag' ); ?></span>
|
||||
</a>
|
||||
|
||||
<a href="?nag_colormag_ignore_theme_review_notice_partially=0" class="btn button-secondary">
|
||||
<span class="dashicons dashicons-calendar"></span>
|
||||
<span><?php esc_html_e( 'Maybe later', 'colormag' ); ?></span>
|
||||
</a>
|
||||
|
||||
<a href="?nag_colormag_ignore_theme_review_notice=0" class="btn button-secondary">
|
||||
<span class="dashicons dashicons-smiley"></span>
|
||||
<span><?php esc_html_e( 'I already did', 'colormag' ); ?></span>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo esc_url( 'https://themegrill.com/support-forum/forum/colormag-free/' ); ?>" class="btn button-secondary" target="_blank">
|
||||
<span class="dashicons dashicons-edit"></span>
|
||||
<span><?php esc_html_e( 'Got theme support question?', 'colormag' ); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a class="notice-dismiss" style="text-decoration:none;" href="?nag_colormag_ignore_theme_review_notice_partially=0"></a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to remove the theme review notice permanently as requested by the user.
|
||||
*/
|
||||
public function colormag_ignore_theme_review_notice() {
|
||||
|
||||
global $current_user;
|
||||
$user_id = $current_user->ID;
|
||||
|
||||
/* If user clicks to ignore the notice, add that to their user meta */
|
||||
if ( isset( $_GET['nag_colormag_ignore_theme_review_notice'] ) && '0' == $_GET['nag_colormag_ignore_theme_review_notice'] ) {
|
||||
add_user_meta( $user_id, 'colormag_ignore_theme_review_notice', 'true', true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to remove the theme review notice partially as requested by the user.
|
||||
*/
|
||||
public function colormag_ignore_theme_review_notice_partially() {
|
||||
|
||||
global $current_user;
|
||||
$user_id = $current_user->ID;
|
||||
|
||||
/* If user clicks to ignore the notice, add that to their user meta */
|
||||
if ( isset( $_GET['nag_colormag_ignore_theme_review_notice_partially'] ) && '0' == $_GET['nag_colormag_ignore_theme_review_notice_partially'] ) {
|
||||
update_user_meta( $user_id, 'nag_colormag_ignore_theme_review_notice_partially', time() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the data set after the theme has been switched to other theme.
|
||||
*/
|
||||
public function colormag_theme_rating_notice_data_remove() {
|
||||
|
||||
global $current_user;
|
||||
$user_id = $current_user->ID;
|
||||
$theme_installed_time = get_option( 'colormag_theme_installed_time' );
|
||||
$ignored_notice = get_user_meta( $user_id, 'colormag_ignore_theme_review_notice', true );
|
||||
$ignored_notice_partially = get_user_meta( $user_id, 'nag_colormag_ignore_theme_review_notice_partially', true );
|
||||
|
||||
// Delete options data.
|
||||
if ( $theme_installed_time ) {
|
||||
delete_option( 'colormag_theme_installed_time' );
|
||||
}
|
||||
|
||||
// Delete permanent notice remove data.
|
||||
if ( $ignored_notice ) {
|
||||
delete_user_meta( $user_id, 'colormag_ignore_theme_review_notice' );
|
||||
}
|
||||
|
||||
// Delete partial notice remove data.
|
||||
if ( $ignored_notice_partially ) {
|
||||
delete_user_meta( $user_id, 'nag_colormag_ignore_theme_review_notice_partially' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue the required CSS file for theme review notice on admin page.
|
||||
*/
|
||||
public function colormag_theme_rating_notice_enqueue() {
|
||||
|
||||
wp_enqueue_style( 'colormag-theme-review-notice', get_template_directory_uri() . '/css/admin/theme-review-notice.css' );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new ColorMag_Theme_Review_Notice();
|
||||
BIN
colormag/inc/admin/images/featured-image-place-holder.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
colormag/inc/admin/images/header-variation-1.png
Normal file
|
After Width: | Height: | Size: 908 B |
BIN
colormag/inc/admin/images/header-variation-2.png
Normal file
|
After Width: | Height: | Size: 883 B |
BIN
colormag/inc/admin/images/header-variation-3.png
Normal file
|
After Width: | Height: | Size: 840 B |
BIN
colormag/inc/admin/images/left-sidebar.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
colormag/inc/admin/images/no-sidebar-content-centered-layout.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
colormag/inc/admin/images/no-sidebar-full-width-layout.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
colormag/inc/admin/images/right-sidebar.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
62
colormag/inc/admin/js/plugin-handle.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Remove activate button and replace with activation in progress button.
|
||||
*
|
||||
* @package ColorMag
|
||||
*/
|
||||
|
||||
/**
|
||||
* Import button
|
||||
*/
|
||||
jQuery( document ).ready( function ( $ ) {
|
||||
|
||||
$( '.btn-get-started' ).click( function ( e ) {
|
||||
e.preventDefault();
|
||||
var extra_uri, redirect_uri, state, dismiss_nonce;
|
||||
|
||||
// Show About > import button while processing.
|
||||
if ( jQuery( this ).parents( '.theme-actions' ).length ) {
|
||||
jQuery( this ).parents( '.theme-actions' ).css( 'opacity', '1' );
|
||||
}
|
||||
|
||||
// Show updating gif icon.
|
||||
jQuery( this ).addClass( 'updating-message' );
|
||||
|
||||
// Change button text.
|
||||
jQuery( this ).text( colormag_redirect_demo_page.btn_text );
|
||||
|
||||
// Assign `TG demo importer` plugin state for processing from PHP.
|
||||
if ( $( this ).hasClass( 'tdi-activated' ) ) { // Installed and activated.
|
||||
state = 'activated';
|
||||
} else if ( $( this ).hasClass( 'tdi-installed' ) ) { // Installed but not activated.
|
||||
state = 'installed';
|
||||
} else { // Not installed.
|
||||
state = '';
|
||||
}
|
||||
|
||||
var data = {
|
||||
action : 'import_button',
|
||||
security : colormag_redirect_demo_page.nonce,
|
||||
state : state
|
||||
};
|
||||
|
||||
$.ajax( {
|
||||
type : "POST",
|
||||
url : ajaxurl, // URL to "wp-admin/admin-ajax.php"
|
||||
data : data,
|
||||
success : function ( response ) {
|
||||
extra_uri = '';
|
||||
if ( jQuery( '.colormag-message-close' ).length ) {
|
||||
dismiss_nonce = jQuery( '.colormag-message-close' ).attr( 'href' ).split( '_colormag_notice_nonce=' )[1];
|
||||
extra_uri = '&_colormag_notice_nonce=' + dismiss_nonce;
|
||||
}
|
||||
|
||||
redirect_uri = response.redirect + extra_uri;
|
||||
window.location.href = redirect_uri;
|
||||
},
|
||||
error : function ( xhr, ajaxOptions, thrownError ) {
|
||||
console.log( thrownError );
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
} );
|
||||
109
colormag/inc/admin/meta-boxes.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* This fucntion is responsible for rendering metaboxes in single post area
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.0
|
||||
*/
|
||||
|
||||
add_action( 'add_meta_boxes', 'colormag_add_custom_box' );
|
||||
/**
|
||||
* Add Meta Boxes.
|
||||
*/
|
||||
function colormag_add_custom_box() {
|
||||
// Adding layout meta box for page
|
||||
add_meta_box( 'page-layout', __( 'Select Layout', 'colormag' ), 'colormag_page_layout', 'page', 'side', 'default' );
|
||||
// Adding layout meta box for
|
||||
add_meta_box( 'page-layout', __( 'Select Layout', 'colormag' ), 'colormag_page_layout', 'post', 'side', 'default' );
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
global $page_layout;
|
||||
$page_layout = array(
|
||||
'default-layout' => array(
|
||||
'id' => 'colormag_page_layout',
|
||||
'value' => 'default_layout',
|
||||
'label' => __( 'Default Layout', 'colormag' )
|
||||
),
|
||||
'right-sidebar' => array(
|
||||
'id' => 'colormag_page_layout',
|
||||
'value' => 'right_sidebar',
|
||||
'label' => __( 'Right Sidebar', 'colormag' )
|
||||
),
|
||||
'left-sidebar' => array(
|
||||
'id' => 'colormag_page_layout',
|
||||
'value' => 'left_sidebar',
|
||||
'label' => __( 'Left Sidebar', 'colormag' )
|
||||
),
|
||||
'no-sidebar-full-width' => array(
|
||||
'id' => 'colormag_page_layout',
|
||||
'value' => 'no_sidebar_full_width',
|
||||
'label' => __( 'No Sidebar Full Width', 'colormag' )
|
||||
),
|
||||
'no-sidebar-content-centered' => array(
|
||||
'id' => 'colormag_page_layout',
|
||||
'value' => 'no_sidebar_content_centered',
|
||||
'label' => __( 'No Sidebar Content Centered', 'colormag' )
|
||||
)
|
||||
);
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
/**
|
||||
* Displays metabox to for select layout option
|
||||
*/
|
||||
function colormag_page_layout() {
|
||||
global $page_layout, $post;
|
||||
|
||||
// Use nonce for verification
|
||||
wp_nonce_field( basename( __FILE__ ), 'custom_meta_box_nonce' );
|
||||
|
||||
foreach ($page_layout as $field) {
|
||||
$layout_meta = get_post_meta( $post->ID, $field['id'], true );
|
||||
if( empty( $layout_meta ) ) { $layout_meta = 'default_layout'; }
|
||||
?>
|
||||
<input class="post-format" type="radio" name="<?php echo $field['id']; ?>" value="<?php echo $field['value']; ?>" <?php checked( $field['value'], $layout_meta ); ?>/>
|
||||
<label class="post-format-icon"><?php echo $field['label']; ?></label><br/>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
add_action('pre_post_update', 'colormag_save_custom_meta');
|
||||
/**
|
||||
* save the custom metabox data
|
||||
* @hooked to pre_post_update hook
|
||||
*/
|
||||
function colormag_save_custom_meta( $post_id ) {
|
||||
global $page_layout, $post;
|
||||
|
||||
// Verify the nonce before proceeding.
|
||||
if ( !isset( $_POST[ 'custom_meta_box_nonce' ] ) || !wp_verify_nonce( $_POST[ 'custom_meta_box_nonce' ], basename( __FILE__ ) ) )
|
||||
return;
|
||||
|
||||
// Stop WP from clearing custom fields on autosave
|
||||
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE)
|
||||
return;
|
||||
|
||||
if ('page' == $_POST['post_type']) {
|
||||
if (!current_user_can( 'edit_page', $post_id ) )
|
||||
return $post_id;
|
||||
}
|
||||
elseif (!current_user_can( 'edit_post', $post_id ) ) {
|
||||
return $post_id;
|
||||
}
|
||||
|
||||
foreach ($page_layout as $field) {
|
||||
//Execute this saving function
|
||||
$old = get_post_meta( $post_id, $field['id'], true);
|
||||
$new = $_POST[$field['id']];
|
||||
if ($new && $new != $old) {
|
||||
update_post_meta($post_id, $field['id'], $new);
|
||||
} elseif ('' == $new && $old) {
|
||||
delete_post_meta($post_id, $field['id'], $old);
|
||||
}
|
||||
} // end foreach
|
||||
}
|
||||
48
colormag/inc/custom-header.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Implements a custom header for ColorMag.
|
||||
* See http://codex.wordpress.org/Custom_Headers
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup the WordPress core custom header feature.
|
||||
*/
|
||||
function colormag_custom_header_setup() {
|
||||
add_theme_support( 'custom-header', apply_filters( 'colormag_custom_header_args', array(
|
||||
'default-image' => '',
|
||||
'header-text' => '',
|
||||
'default-text-color' => '',
|
||||
'width' => 1400,
|
||||
'height' => 400,
|
||||
'flex-width' => true,
|
||||
'flex-height' => true,
|
||||
'wp-head-callback' => '',
|
||||
'admin-head-callback' => '',
|
||||
'video' => true,
|
||||
'admin-preview-callback' => 'colormag_admin_header_image',
|
||||
) ) );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'colormag_custom_header_setup' );
|
||||
|
||||
if ( ! function_exists( 'colormag_admin_header_image' ) ) :
|
||||
/**
|
||||
* Custom header image markup displayed on the Appearance > Header admin panel.
|
||||
*/
|
||||
function colormag_admin_header_image() {
|
||||
?>
|
||||
<div id="headimg">
|
||||
<?php if ( function_exists( 'the_custom_header_markup' ) ) {
|
||||
the_custom_header_markup();
|
||||
} else {
|
||||
if ( get_header_image() ) : ?>
|
||||
<img src="<?php header_image(); ?>" alt="<?php bloginfo( 'name' ); ?>">
|
||||
<?php endif;
|
||||
} ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
endif; // colormag_admin_header_image
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Extend WP_Customize_Control for custom CSS control.
|
||||
*
|
||||
* Class COLORMAG_Custom_CSS_Control
|
||||
*
|
||||
* @since 1.3.6
|
||||
*/
|
||||
// Custom CSS setting
|
||||
class COLORMAG_Custom_CSS_Control extends WP_Customize_Control {
|
||||
|
||||
public $type = 'custom_css';
|
||||
|
||||
public function render_content() {
|
||||
?>
|
||||
<label>
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<textarea rows="5" style="width:100%;" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Extend WP_Customize_Control for radio image section.
|
||||
*
|
||||
* Class COLORMAG_Image_Radio_Control
|
||||
*
|
||||
* @since 1.3.6
|
||||
*/
|
||||
class COLORMAG_Image_Radio_Control extends WP_Customize_Control {
|
||||
|
||||
public function render_content() {
|
||||
|
||||
if ( empty( $this->choices ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$name = '_customize-radio-' . $this->id;
|
||||
?>
|
||||
<style>
|
||||
#colormag-img-container .colormag-radio-img-img {
|
||||
border: 3px solid #DEDEDE;
|
||||
margin: 0 5px 5px 0;
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
#colormag-img-container .colormag-radio-img-selected {
|
||||
border: 3px solid #AAA;
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
input[type=checkbox]:before {
|
||||
content: '';
|
||||
margin: -3px 0 0 -4px;
|
||||
}
|
||||
</style>
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<ul class="controls" id='colormag-img-container'>
|
||||
<?php
|
||||
foreach ( $this->choices as $value => $label ) :
|
||||
$class = ( $this->value() == $value ) ? 'colormag-radio-img-selected colormag-radio-img-img' : 'colormag-radio-img-img';
|
||||
?>
|
||||
<li style="display: inline;">
|
||||
<label style="margin-left: 0">
|
||||
<input <?php $this->link(); ?>style='display:none' type="radio" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" <?php
|
||||
$this->link();
|
||||
checked( $this->value(), $value );
|
||||
?> />
|
||||
<img src='<?php echo esc_html( $label ); ?>' class='<?php echo $class; ?>' />
|
||||
</label>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery( document ).ready( function ( $ ) {
|
||||
$( '.controls#colormag-img-container li img' ).click( function () {
|
||||
$( '.controls#colormag-img-container li' ).each( function () {
|
||||
$( this ).find( 'img' ).removeClass( 'colormag-radio-img-selected' );
|
||||
} );
|
||||
$( this ).addClass( 'colormag-radio-img-selected' );
|
||||
} );
|
||||
} );
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Class to include upsell link campaign for theme.
|
||||
*
|
||||
* Class COLORMAG_Upsell_Section
|
||||
*/
|
||||
class COLORMAG_Upsell_Section extends WP_Customize_Section {
|
||||
public $type = 'colormag-upsell-section';
|
||||
public $url = '';
|
||||
public $id = '';
|
||||
|
||||
/**
|
||||
* Gather the parameters passed to client JavaScript via JSON.
|
||||
*
|
||||
* @return array The array to be exported to the client as JSON.
|
||||
*/
|
||||
public function json() {
|
||||
$json = parent::json();
|
||||
$json['url'] = esc_url( $this->url );
|
||||
$json['id'] = $this->id;
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
/**
|
||||
* An Underscore (JS) template for rendering this section.
|
||||
*/
|
||||
protected function render_template() {
|
||||
?>
|
||||
<li id="accordion-section-{{ data.id }}" class="colormag-upsell-accordion-section control-section-{{ data.type }} cannot-expand accordion-section">
|
||||
<h3 class="accordion-section-title"><a href="{{{ data.url }}}" target="_blank">{{ data.title }}</a></h3>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
1086
colormag/inc/customizer.php
Normal file
201
colormag/inc/demo-config.php
Normal file
@@ -0,0 +1,201 @@
|
||||
<?php
|
||||
/**
|
||||
* Functions for configuring demo importer.
|
||||
*
|
||||
* @package ThemeGrill_Demo_Importer/Functions
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Setup demo importer config.
|
||||
*
|
||||
* @deprecated 1.5.0
|
||||
*
|
||||
* @param array $demo_config Demo config.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function colormag_demo_importer_packages( $packages ) {
|
||||
$new_packages = array(
|
||||
'colormag-free' => array(
|
||||
'name' => __( 'ColorMag', 'colormag' ),
|
||||
'preview' => 'http://demo.themegrill.com/colormag/',
|
||||
),
|
||||
'colormag-beauty-blog' => array(
|
||||
'name' => __( 'ColorMag Beauty Blog', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-beauty-blog/',
|
||||
),
|
||||
'colormag-business-magazine' => array(
|
||||
'name' => __( 'ColorMag Business Magazine', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-business-magazine/',
|
||||
),
|
||||
'colormag-dark' => array(
|
||||
'name' => __( 'ColorMag Dark', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-dark/',
|
||||
),
|
||||
'colormag-pro' => array(
|
||||
'name' => __( 'ColorMag Pro', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
'colormag-pro-fashion' => array(
|
||||
'name' => __( 'ColorMag Pro Fashion', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro-fashion/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
'colormag-pro-technology' => array(
|
||||
'name' => __( 'ColorMag Pro Technology', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro-technology/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
'colormag-pro-sports' => array(
|
||||
'name' => __( 'ColorMag Pro Sports', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro-sports/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
'colormag-pro-recipes' => array(
|
||||
'name' => __( 'ColorMag Food Recipe', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro-recipes/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
'colormag-pro-health-blog' => array(
|
||||
'name' => __( 'ColorMag Health Blog', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro-health-blog/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
'colormag-pro-music' => array(
|
||||
'name' => __( 'ColorMag Pro Music', 'colormag' ),
|
||||
'preview' => 'https://demo.themegrill.com/colormag-pro-music/',
|
||||
'pro_link' => 'https://themegrill.com/themes/colormag/',
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $new_packages, $packages );
|
||||
}
|
||||
|
||||
add_filter( 'themegrill_demo_importer_packages', 'colormag_demo_importer_packages' );
|
||||
|
||||
/**
|
||||
* Set categories color settings in theme customizer.
|
||||
*
|
||||
* Note: Used rarely, if theme_mod keys are based on term ID.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $demo_data
|
||||
* @param string $demo_id
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function colormag_set_cat_colors( $data, $demo_data, $demo_id ) {
|
||||
$cat_colors = array();
|
||||
$cat_prevent = array();
|
||||
$wp_categories = array();
|
||||
|
||||
// Format the data based on demo ID.
|
||||
switch ( $demo_id ) {
|
||||
case 'colormag-free':
|
||||
$wp_categories = array(
|
||||
1 => 'Sports',
|
||||
2 => 'Politics',
|
||||
3 => 'Business',
|
||||
4 => 'Technology',
|
||||
5 => 'WordPress',
|
||||
8 => 'General',
|
||||
9 => 'Fashion',
|
||||
10 => 'Food',
|
||||
11 => 'Entertainment',
|
||||
13 => 'FEATURED',
|
||||
14 => 'TOP STORIES',
|
||||
15 => 'TOP VIDEOS',
|
||||
16 => 'Health',
|
||||
18 => 'Latest',
|
||||
19 => 'Drinks',
|
||||
20 => 'Gadgets',
|
||||
21 => 'Female',
|
||||
22 => 'Style',
|
||||
23 => 'News',
|
||||
);
|
||||
break;
|
||||
case 'colormag-business-magazine':
|
||||
$wp_categories = array(
|
||||
4 => 'Investments',
|
||||
5 => 'Corporate',
|
||||
6 => 'Employment',
|
||||
8 => 'Money',
|
||||
9 => 'Market',
|
||||
14 => 'Global Trade',
|
||||
15 => 'Companies',
|
||||
16 => 'Entrepreneurship',
|
||||
);
|
||||
break;
|
||||
case 'colormag-beauty-blog':
|
||||
$wp_categories = array(
|
||||
2 => 'Food & Drinks',
|
||||
4 => 'Product',
|
||||
5 => 'Hair',
|
||||
6 => 'Fashion',
|
||||
7 => 'Beauty Tips',
|
||||
8 => 'Health',
|
||||
9 => 'Eye Make up',
|
||||
10 => 'News',
|
||||
);
|
||||
break;
|
||||
case 'colormag-dark':
|
||||
$wp_categories = array(
|
||||
2 => 'Politics',
|
||||
3 => 'Sports',
|
||||
4 => 'Travel',
|
||||
6 => 'World',
|
||||
7 => 'Technology',
|
||||
8 => 'Entertainment',
|
||||
9 => 'Fashion',
|
||||
10 => 'Food & Health',
|
||||
11 => 'News',
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
// Fetch categories color settings.
|
||||
foreach ( $wp_categories as $term_id => $term_name ) {
|
||||
if ( ! empty( $data['mods'][ 'colormag_category_color_' . $term_id ] ) ) {
|
||||
$cat_colors[ 'colormag_category_color_' . $term_id ] = $data['mods'][ 'colormag_category_color_' . $term_id ];
|
||||
}
|
||||
}
|
||||
|
||||
// Set categories color settings properly.
|
||||
foreach ( $wp_categories as $term_id => $term_name ) {
|
||||
if ( ! empty( $data['mods'][ 'colormag_category_color_' . $term_id ] ) ) {
|
||||
$term = get_term_by( 'name', $term_name, 'category' );
|
||||
$color = $cat_colors[ 'colormag_category_color_' . $term_id ];
|
||||
|
||||
if ( is_object( $term ) && $term->term_id ) {
|
||||
$cat_prevent[] = $term->term_id;
|
||||
$data['mods'][ 'colormag_category_color_' . $term->term_id ] = $color;
|
||||
|
||||
// Prevent deleting stored color settings.
|
||||
if ( ! in_array( $term_id, $cat_prevent ) ) {
|
||||
unset( $data['mods'][ 'colormag_category_color_' . $term_id ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
add_filter( 'themegrill_customizer_demo_import_settings', 'colormag_set_cat_colors', 20, 3 );
|
||||
|
||||
/**
|
||||
* Delete the `Hello world!` post after successful demo import
|
||||
*/
|
||||
function colormag_delete_post_import() {
|
||||
$page = get_page_by_title( 'Hello world!', OBJECT, 'post' );
|
||||
|
||||
if ( is_object( $page ) && $page->ID ) {
|
||||
wp_delete_post( $page->ID, true );
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'themegrill_ajax_demo_imported', 'colormag_delete_post_import' );
|
||||
12
colormag/inc/elementor/assets/SCSS/elementor.scss
Normal file
@@ -0,0 +1,12 @@
|
||||
@import 'variables/colors';
|
||||
@import 'variables/grid';
|
||||
@import 'layout/grid';
|
||||
@import 'modules/clearings';
|
||||
@import 'modules/ticker';
|
||||
@import 'modules/common';
|
||||
@import 'modules/block-posts';
|
||||
@import 'modules/grid-posts';
|
||||
@import 'responsive/large';
|
||||
@import 'responsive/medium';
|
||||
@import 'responsive/small';
|
||||
@import 'layout/col-control';
|
||||
42
colormag/inc/elementor/assets/SCSS/layout/_col-control.scss
Normal file
@@ -0,0 +1,42 @@
|
||||
@media only screen and (min-width : 768px) {
|
||||
.elementor {
|
||||
|
||||
//full width
|
||||
.elementor-col-100,
|
||||
.elementor-column[data-col="100"] {
|
||||
.tg-module-wrapper {
|
||||
&.tg-module-block {
|
||||
&.tg-module-block--style-2,
|
||||
&.tg-module-block--style-3,
|
||||
&.tg-module-block--style-6,
|
||||
&.tg-module-block--style-8,
|
||||
&.tg-module-block--style-9 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//sidebar
|
||||
.elementor-col-25,
|
||||
.elementor-column[data-col="25"],
|
||||
.elementor-col-33,
|
||||
.elementor-column[data-col="33"] {
|
||||
.tg-module-wrapper {
|
||||
&.tg-module-block {
|
||||
&.tg-module-block--style-2,
|
||||
&.tg-module-block--style-3,
|
||||
&.tg-module-block--style-6,
|
||||
&.tg-module-block--style-8,
|
||||
&.tg-module-block--style-9 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
68
colormag/inc/elementor/assets/SCSS/layout/_grid.scss
Normal file
@@ -0,0 +1,68 @@
|
||||
/*--------------------------------------------------------------
|
||||
# Grid
|
||||
--------------------------------------------------------------*/
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.elementor-column-gap-default .elementor-row {
|
||||
width: calc(100% + 20px);
|
||||
margin-left: -10px;
|
||||
margin-right: -10px;
|
||||
}
|
||||
.elementor-column-gap-narrow .elementor-row {
|
||||
width: calc(100% + 10px);
|
||||
margin-left: -5px;
|
||||
margin-right: -5px;
|
||||
}
|
||||
.elementor-column-gap-extended .elementor-row {
|
||||
width: calc(100% + 30px);
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
.elementor-column-gap-wide .elementor-row {
|
||||
width: calc(100% + 40px);
|
||||
margin-left: -20px;
|
||||
margin-right: -20px;
|
||||
}
|
||||
.elementor-column-gap-wider .elementor-row {
|
||||
width: calc(100% + 60px);
|
||||
margin-left: -30px;
|
||||
margin-right: -30px;
|
||||
}
|
||||
|
||||
.elementor-page {
|
||||
|
||||
.entry-header {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-container {
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.tg-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
|
||||
.tg-col-control {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
&.thinner {
|
||||
margin-left: -2px;
|
||||
margin-right: -2px;
|
||||
|
||||
.tg-col-control {
|
||||
padding-right: 2px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
128
colormag/inc/elementor/assets/SCSS/modules/_block-posts.scss
Normal file
@@ -0,0 +1,128 @@
|
||||
.elementor {
|
||||
.tg-module-wrapper {
|
||||
|
||||
// common
|
||||
.tg_module_block {
|
||||
.tg-module-thumb {
|
||||
position: relative;
|
||||
margin-bottom: 13px;
|
||||
|
||||
.tg-post-categories {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-post-category {
|
||||
display: inline-block;
|
||||
background-color: #FFE066;
|
||||
}
|
||||
.tg-module-meta {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&.tg_module_block--small {
|
||||
.tg-module-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
// Small list style
|
||||
&.tg_module_block--list-small {
|
||||
position: relative;
|
||||
margin-bottom: 15px;
|
||||
|
||||
.tg-module-thumb {
|
||||
width: 100px;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.tg-module-info {
|
||||
min-height: 73px;
|
||||
|
||||
.entry-title {
|
||||
font-size: 14px;
|
||||
}
|
||||
.entry-content {
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-module-meta {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.no-thumbnail {
|
||||
.tg-module-info {
|
||||
margin-left: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-col-control {
|
||||
|
||||
.tg-module-thumb {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.tg_module_block--inner-shadow {
|
||||
position: relative;
|
||||
|
||||
.tg-module-thumb {
|
||||
&::before,
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient( to top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.01) 1%, rgba(0,0,0,0.1) 100%);
|
||||
}
|
||||
|
||||
&::after {
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 100%);
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.tg-module-block {
|
||||
&.tg-module-block--style-1,
|
||||
&.tg-module-block--style-2,
|
||||
&.tg-module-block--style-6,
|
||||
&.tg-module-block--style-9 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-6;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-block--style-2,
|
||||
&.tg-module-block--style-4 {
|
||||
.tg-col-control {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-block--style-4 {
|
||||
.tg-module-thumb {
|
||||
flex-basis: $column-4;
|
||||
}
|
||||
|
||||
.tg-module-info {
|
||||
flex-basis: $column-8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
colormag/inc/elementor/assets/SCSS/modules/_clearings.scss
Normal file
@@ -0,0 +1,14 @@
|
||||
.clearfix::before,
|
||||
.clearfix::after,
|
||||
.container::before,
|
||||
.container::after,
|
||||
.container-fluid::before,
|
||||
.container-fluid::after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.clearfix::after,
|
||||
.container::after,
|
||||
.container-fluid::after {
|
||||
clear: both;
|
||||
}
|
||||
108
colormag/inc/elementor/assets/SCSS/modules/_common.scss
Normal file
@@ -0,0 +1,108 @@
|
||||
.elementor {
|
||||
|
||||
.elementor-image {
|
||||
.wp-caption {
|
||||
border: none;
|
||||
|
||||
img {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tg-module-wrapper {
|
||||
color: $color_gray_five;
|
||||
font-size: 14px;
|
||||
margin-bottom: 42px;
|
||||
|
||||
.module-title {
|
||||
border-bottom: 1px solid $primary;
|
||||
padding-bottom: 0;
|
||||
font-size: 14px;
|
||||
margin-bottom: 30px;
|
||||
|
||||
span {
|
||||
background-color: $primary;
|
||||
color: $white;
|
||||
padding:7px 12px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
transition: 0.5s color ease-in-out;
|
||||
}
|
||||
|
||||
.tg-post-category {
|
||||
background-color: $primary;
|
||||
padding: 5px 10px;
|
||||
color: $white;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tg-module-thumb {
|
||||
text-align: left;
|
||||
|
||||
img {
|
||||
display: block;
|
||||
margin-bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-module-title {
|
||||
font-size: 21px;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 5px;
|
||||
font-weight: 600;
|
||||
color: $color_gray_one;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
a {
|
||||
color: $primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tg-module-meta {
|
||||
|
||||
.tg-post-date {
|
||||
.updated:not(.published) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-post-auther-name,
|
||||
.tg-post-date,
|
||||
.tg-module-comments {
|
||||
font-size: 12px;
|
||||
margin-right: 10px;
|
||||
display: inline-block;
|
||||
|
||||
a {
|
||||
color: $color_meta;
|
||||
|
||||
&:hover {
|
||||
color: $primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tg-post-auther-name {
|
||||
a {
|
||||
color: $color_gray_two;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-module-comments {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
138
colormag/inc/elementor/assets/SCSS/modules/_grid-posts.scss
Normal file
@@ -0,0 +1,138 @@
|
||||
.elementor {
|
||||
.tg-module-wrapper {
|
||||
|
||||
&.tg-module-grid {
|
||||
|
||||
// default styles
|
||||
.tg_module_grid {
|
||||
position: relative;
|
||||
|
||||
.tg-thumb-link {
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient( to top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.01) 1%, rgba(0,0,0,0.1) 100%);
|
||||
}
|
||||
|
||||
&::after {
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 100%);
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.tg-module-info {
|
||||
position: absolute;
|
||||
bottom: 15px;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
|
||||
.tg-post-categories {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
.tg-module-title {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
.tg-module-meta {
|
||||
span,
|
||||
a {
|
||||
color: $white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.tg_module_grid--small {
|
||||
.tg-module-info {
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
left: 10px;
|
||||
|
||||
.tg-module-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.tg_module_grid--small-medium {
|
||||
.tg-module-info {
|
||||
.tg-module-title {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.tg_module_grid--medium {
|
||||
.tg-module-info {
|
||||
.tg-module-title {
|
||||
font-size: 21px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.tg_module_grid--half {
|
||||
flex-basis: $column-6;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
&.tg_module_grid--one-fourth {
|
||||
flex-basis: $column-3;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
&.tg_module_grid--one-third {
|
||||
flex-basis: $column-4;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
&.tg_module_grid--full {
|
||||
flex-basis: $column-12;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-2,
|
||||
&.tg-module-grid--style-3,
|
||||
&.tg-module-grid--style-6 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-6;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-2 {
|
||||
.tg_module_grid--full {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-3 {
|
||||
.tg-col-control {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-4 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-4;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-5 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
61
colormag/inc/elementor/assets/SCSS/modules/_icomoon.scss
Normal file
@@ -0,0 +1,61 @@
|
||||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src: url('../fonts/icomoon.eot?jqs2fp');
|
||||
src: url('../fonts/icomoon.eot?jqs2fp#iefix') format('embedded-opentype'),
|
||||
url('../fonts/icomoon.ttf?jqs2fp') format('truetype'),
|
||||
url('../fonts/icomoon.woff?jqs2fp') format('woff'),
|
||||
url('../fonts/icomoon.svg?jqs2fp#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
[class^="icon-"], [class*=" icon-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'icomoon' !important;
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-Icons-01:before {
|
||||
content: "\e900";
|
||||
}
|
||||
.icon-Icons-02:before {
|
||||
content: "\e901";
|
||||
}
|
||||
.icon-Icons-03:before {
|
||||
content: "\e902";
|
||||
}
|
||||
.icon-Icons-04:before {
|
||||
content: "\e903";
|
||||
color: #000;
|
||||
}
|
||||
.icon-Icons-05:before {
|
||||
content: "\e904";
|
||||
color: #000;
|
||||
}
|
||||
.icon-Icons-06:before {
|
||||
content: "\e905";
|
||||
color: #000;
|
||||
}
|
||||
.icon-Icons-07:before {
|
||||
content: "\e906";
|
||||
}
|
||||
.icon-Icons-08:before {
|
||||
content: "\e907";
|
||||
}
|
||||
.icon-Icons-09:before {
|
||||
content: "\e908";
|
||||
color: #000;
|
||||
}
|
||||
.icon-Icons-10:before {
|
||||
content: "\e909";
|
||||
color: #000;
|
||||
}
|
||||
79
colormag/inc/elementor/assets/SCSS/responsive/_small.scss
Normal file
@@ -0,0 +1,79 @@
|
||||
@media only screen and (max-width : 768px) {
|
||||
.elementor {
|
||||
.tg-module-wrapper {
|
||||
|
||||
// common
|
||||
&.tg-module-block {
|
||||
&.tg-module-block--style-1,
|
||||
&.tg-module-block--style-2,
|
||||
&.tg-module-block--style-6,
|
||||
&.tg-module-block--style-9 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid {
|
||||
&.tg-module-grid--style-1,
|
||||
&.tg-module-grid--style-2,
|
||||
&.tg-module-grid--style-3,
|
||||
&.tg-module-grid--style-4,
|
||||
&.tg-module-grid--style-5 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-1,
|
||||
&.tg-module-grid--style-2 {
|
||||
.tg_module_grid--small {
|
||||
flex-basis: $column-6;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-2 {
|
||||
.tg_module_grid--full {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-5 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-6;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-3,
|
||||
&.tg-module-grid--style-4,
|
||||
&.tg-module-grid--style-5 {
|
||||
.tg-col-control {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width : 480px) {
|
||||
.elementor {
|
||||
.tg-module-wrapper {
|
||||
&.tg-module-grid {
|
||||
&.tg-module-grid--style-1,
|
||||
&.tg-module-grid--style-2 {
|
||||
.tg_module_grid--half {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
|
||||
&.tg-module-grid--style-5 {
|
||||
.tg-col-control {
|
||||
flex-basis: $column-12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
colormag/inc/elementor/assets/SCSS/variables/_colors.scss
Normal file
@@ -0,0 +1,18 @@
|
||||
/*===== Light colors ======*/
|
||||
$white:#fff;
|
||||
$color_gray_eleven: darken($white, 2.5% ); // #f9f9f9
|
||||
$color_gray_ten: darken($white, 2.6% ); // #f8f8f8
|
||||
$color_gray_nine: darken($white, 5% ); //#f2f2f2
|
||||
$color_gray_eight: darken($white, 8.4% ); // #eaeaea
|
||||
$color_gray_seven: darken($white, 20% ); // #cccccc
|
||||
$color_meta: #969696;
|
||||
|
||||
$black: #000000;
|
||||
$color_gray_one: lighten($black, 13.6%); // #232323
|
||||
$color_gray_two: lighten($black, 20%); // #333333
|
||||
$color_gray_three: lighten($black, 26.5%); // #444444
|
||||
$color_gray_four: lighten($black, 33.5%); // #555555
|
||||
$color_gray_five: lighten($black, 46.5%); // #777777
|
||||
$color_gray_six: lighten($black, 53.5%); // #888888
|
||||
|
||||
$primary:#289dcc;
|
||||
13
colormag/inc/elementor/assets/SCSS/variables/_grid.scss
Normal file
@@ -0,0 +1,13 @@
|
||||
// Define 12 column grid width
|
||||
$column-12: 100%;
|
||||
$collumn-11: 91.66666667%;
|
||||
$column-10: 83.33333333%;
|
||||
$column-9: 75%;
|
||||
$column-8: 66.66666667%;
|
||||
$column-7: 58.33333333%;
|
||||
$column-6: 50%;
|
||||
$column-5: 41.66666667%;
|
||||
$column-4: 33.33333333%;
|
||||
$column-3: 25%;
|
||||
$column-2: 16.66666667%;
|
||||
$column-1: 8.33333333%;
|
||||
80
colormag/inc/elementor/assets/css/colormag-econs.css
Normal file
@@ -0,0 +1,80 @@
|
||||
@font-face {
|
||||
font-family: 'colormag-econs';
|
||||
src: url('../fonts/colormag-econs.eot?qrxuz2');
|
||||
src: url('../fonts/colormag-econs.eot?qrxuz2#iefix') format('embedded-opentype'),
|
||||
url('../fonts/colormag-econs.ttf?qrxuz2') format('truetype'),
|
||||
url('../fonts/colormag-econs.woff?qrxuz2') format('woff'),
|
||||
url('../fonts/colormag-econs.svg?qrxuz2#colormag-econs') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
[class^="colormag-econs-"], [class*=" colormag-econs-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'colormag-econs' !important;
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.colormag-econs-block-1:before {
|
||||
content: "\e900";
|
||||
}
|
||||
.colormag-econs-block-2:before {
|
||||
content: "\e901";
|
||||
}
|
||||
.colormag-econs-block-3:before {
|
||||
content: "\e902";
|
||||
}
|
||||
.colormag-econs-block-4:before {
|
||||
content: "\e903";
|
||||
}
|
||||
.colormag-econs-block-5:before {
|
||||
content: "\e904";
|
||||
}
|
||||
.colormag-econs-block-6:before {
|
||||
content: "\e905";
|
||||
}
|
||||
.colormag-econs-block-7:before {
|
||||
content: "\e906";
|
||||
}
|
||||
.colormag-econs-block-8:before {
|
||||
content: "\e907";
|
||||
}
|
||||
.colormag-econs-block-9:before {
|
||||
content: "\e908";
|
||||
}
|
||||
.colormag-econs-grid-1:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
.colormag-econs-grid-2:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
.colormag-econs-grid-3:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
.colormag-econs-grid-4:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
.colormag-econs-grid-5:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
.colormag-econs-grid-6:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
.colormag-econs-grid-7:before {
|
||||
content: "\e909";
|
||||
}
|
||||
.colormag-econs-grid-8:before {
|
||||
content: "\e910";
|
||||
}
|
||||
.colormag-econs-grid-9:before {
|
||||
content: "\e911";
|
||||
}
|
||||
475
colormag/inc/elementor/assets/css/elementor.css
Normal file
@@ -0,0 +1,475 @@
|
||||
/*===== Light colors ======*/
|
||||
/*--------------------------------------------------------------
|
||||
# Grid
|
||||
--------------------------------------------------------------*/
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.elementor-column-gap-default .elementor-row {
|
||||
width: calc(100% + 20px);
|
||||
margin-left: -10px;
|
||||
margin-right: -10px;
|
||||
}
|
||||
|
||||
.elementor-column-gap-narrow .elementor-row {
|
||||
width: calc(100% + 10px);
|
||||
margin-left: -5px;
|
||||
margin-right: -5px;
|
||||
}
|
||||
|
||||
.elementor-column-gap-extended .elementor-row {
|
||||
width: calc(100% + 30px);
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
|
||||
.elementor-column-gap-wide .elementor-row {
|
||||
width: calc(100% + 40px);
|
||||
margin-left: -20px;
|
||||
margin-right: -20px;
|
||||
}
|
||||
|
||||
.elementor-column-gap-wider .elementor-row {
|
||||
width: calc(100% + 60px);
|
||||
margin-left: -30px;
|
||||
margin-right: -30px;
|
||||
}
|
||||
|
||||
.elementor-page .entry-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tg-container {
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.tg-row {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
|
||||
.tg-row .tg-col-control {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.tg-row.thinner {
|
||||
margin-left: -2px;
|
||||
margin-right: -2px;
|
||||
}
|
||||
|
||||
.tg-row.thinner .tg-col-control {
|
||||
padding-right: 2px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.clearfix::before,
|
||||
.clearfix::after,
|
||||
.container::before,
|
||||
.container::after,
|
||||
.container-fluid::before,
|
||||
.container-fluid::after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.clearfix::after,
|
||||
.container::after,
|
||||
.container-fluid::after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.elementor .elementor-image .wp-caption {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.elementor .elementor-image .wp-caption img {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper {
|
||||
color: #777777;
|
||||
font-size: 14px;
|
||||
margin-bottom: 42px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .module-title {
|
||||
border-bottom: 1px solid #289dcc;
|
||||
padding-bottom: 0;
|
||||
font-size: 14px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .module-title span {
|
||||
background-color: #289dcc;
|
||||
color: #fff;
|
||||
padding: 7px 12px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper a {
|
||||
-webkit-transition: 0.5s color ease-in-out;
|
||||
transition: 0.5s color ease-in-out;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-post-category {
|
||||
background-color: #289dcc;
|
||||
padding: 5px 10px;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-thumb {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-thumb img {
|
||||
display: block;
|
||||
margin-bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-title {
|
||||
font-size: 21px;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 5px;
|
||||
font-weight: 600;
|
||||
color: #232323;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-title a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-title:hover a {
|
||||
color: #289dcc;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-date .updated:not(.published) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-auther-name,
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-date,
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-module-comments {
|
||||
font-size: 12px;
|
||||
margin-right: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-auther-name a,
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-date a,
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-module-comments a {
|
||||
color: #969696;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-auther-name a:hover,
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-date a:hover,
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-module-comments a:hover {
|
||||
color: #289dcc;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-post-auther-name a {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg-module-meta .tg-module-comments {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block .tg-module-thumb {
|
||||
position: relative;
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block .tg-module-thumb .tg-post-categories {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block .tg-post-category {
|
||||
display: inline-block;
|
||||
background-color: #FFE066;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block .tg-module-meta {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--small .tg-module-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small {
|
||||
position: relative;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small .tg-module-thumb {
|
||||
width: 100px;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small .tg-module-info {
|
||||
min-height: 73px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small .tg-module-info .entry-title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small .tg-module-info .entry-content p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small .tg-module-info .tg-module-meta {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small.no-thumbnail .tg-module-info {
|
||||
margin-left: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--list-small.tg-col-control .tg-module-thumb {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--inner-shadow {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--inner-shadow .tg-module-thumb::before, .elementor .tg-module-wrapper .tg_module_block.tg_module_block--inner-shadow .tg-module-thumb::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0)), color-stop(1%, rgba(0, 0, 0, 0.01)), to(rgba(0, 0, 0, 0.1)));
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.01) 1%, rgba(0, 0, 0, 0.1) 100%);
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper .tg_module_block.tg_module_block--inner-shadow .tg-module-thumb::after {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.4)));
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-1 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control {
|
||||
-ms-flex-preferred-size: 50%;
|
||||
flex-basis: 50%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-4 .tg-col-control {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-4 .tg-module-thumb {
|
||||
-ms-flex-preferred-size: 33.33333%;
|
||||
flex-basis: 33.33333%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-4 .tg-module-info {
|
||||
-ms-flex-preferred-size: 66.66667%;
|
||||
flex-basis: 66.66667%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-thumb-link {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-thumb-link::before, .elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-thumb-link::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0)), color-stop(1%, rgba(0, 0, 0, 0.01)), to(rgba(0, 0, 0, 0.1)));
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.01) 1%, rgba(0, 0, 0, 0.1) 100%);
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-thumb-link::after {
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.4)));
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info {
|
||||
position: absolute;
|
||||
bottom: 15px;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info .tg-post-categories {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info .tg-module-title {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info .tg-module-meta span,
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info .tg-module-meta a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--small .tg-module-info {
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--small .tg-module-info .tg-module-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--small-medium .tg-module-info .tg-module-title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--medium .tg-module-info .tg-module-title {
|
||||
font-size: 21px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--half {
|
||||
-ms-flex-preferred-size: 50%;
|
||||
flex-basis: 50%;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--one-fourth {
|
||||
-ms-flex-preferred-size: 25%;
|
||||
flex-basis: 25%;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--one-third {
|
||||
-ms-flex-preferred-size: 33.33333%;
|
||||
flex-basis: 33.33333%;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid.tg_module_grid--full {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-2 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-3 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-6 .tg-col-control {
|
||||
-ms-flex-preferred-size: 50%;
|
||||
flex-basis: 50%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-2 .tg_module_grid--full {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-3 .tg-col-control {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-4 .tg-col-control {
|
||||
-ms-flex-preferred-size: 33.33333%;
|
||||
flex-basis: 33.33333%;
|
||||
}
|
||||
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-5 .tg-col-control {
|
||||
-ms-flex-preferred-size: 25%;
|
||||
flex-basis: 25%;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
.elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-1 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control, .elementor .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-1 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-2 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-3 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-4 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-5 .tg-col-control {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-1 .tg_module_grid--small, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-2 .tg_module_grid--small {
|
||||
-ms-flex-preferred-size: 50%;
|
||||
flex-basis: 50%;
|
||||
}
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-2 .tg_module_grid--full {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-5 .tg-col-control {
|
||||
-ms-flex-preferred-size: 50%;
|
||||
flex-basis: 50%;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-3 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-4 .tg-col-control, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-5 .tg-col-control {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 480px) {
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-1 .tg_module_grid--half, .elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-2 .tg_module_grid--half {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
.elementor .tg-module-wrapper.tg-module-grid.tg-module-grid--style-5 .tg-col-control {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.elementor .elementor-col-100 .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control, .elementor .elementor-col-100 .tg-module-wrapper.tg-module-block.tg-module-block--style-3 .tg-col-control, .elementor .elementor-col-100 .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control, .elementor .elementor-col-100 .tg-module-wrapper.tg-module-block.tg-module-block--style-8 .tg-col-control, .elementor .elementor-col-100 .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="100"] .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="100"] .tg-module-wrapper.tg-module-block.tg-module-block--style-3 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="100"] .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="100"] .tg-module-wrapper.tg-module-block.tg-module-block--style-8 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="100"] .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control {
|
||||
-ms-flex-preferred-size: 33.33333%;
|
||||
flex-basis: 33.33333%;
|
||||
}
|
||||
.elementor .elementor-col-25 .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control, .elementor .elementor-col-25 .tg-module-wrapper.tg-module-block.tg-module-block--style-3 .tg-col-control, .elementor .elementor-col-25 .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control, .elementor .elementor-col-25 .tg-module-wrapper.tg-module-block.tg-module-block--style-8 .tg-col-control, .elementor .elementor-col-25 .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="25"] .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="25"] .tg-module-wrapper.tg-module-block.tg-module-block--style-3 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="25"] .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="25"] .tg-module-wrapper.tg-module-block.tg-module-block--style-8 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="25"] .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control,
|
||||
.elementor .elementor-col-33 .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control,
|
||||
.elementor .elementor-col-33 .tg-module-wrapper.tg-module-block.tg-module-block--style-3 .tg-col-control,
|
||||
.elementor .elementor-col-33 .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control,
|
||||
.elementor .elementor-col-33 .tg-module-wrapper.tg-module-block.tg-module-block--style-8 .tg-col-control,
|
||||
.elementor .elementor-col-33 .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="33"] .tg-module-wrapper.tg-module-block.tg-module-block--style-2 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="33"] .tg-module-wrapper.tg-module-block.tg-module-block--style-3 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="33"] .tg-module-wrapper.tg-module-block.tg-module-block--style-6 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="33"] .tg-module-wrapper.tg-module-block.tg-module-block--style-8 .tg-col-control,
|
||||
.elementor .elementor-column[data-col="33"] .tg-module-wrapper.tg-module-block.tg-module-block--style-9 .tg-col-control {
|
||||
-ms-flex-preferred-size: 100%;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
BIN
colormag/inc/elementor/assets/fonts/colormag-econs.eot
Normal file
28
colormag/inc/elementor/assets/fonts/colormag-econs.svg
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="icomoon" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="block-1" d="M499.64 944.26v-684h-489.24v684h489.24zM503.64 950.26h-497.16v-696h497.080v695.96zM509.48 245.28h-508.92v713.96h508.92zM16.34 269.28h477.36v666h-477.36zM6.48 171.020h501.3v-19.1h-501.3v19.1zM513.72 142.9h-513.16v37.1h513.16zM12.42 160.9h489.42v1.1h-489.42zM6.48 66.16h430.1v-19.1h-430.1v19.1zM442.52 38h-441.96v37.2h442zM12.52 56h418.14v1.060h-418.24zM6.48-30.1h484.92v-19.1h-484.92v19.1zM497.34-58.24h-496.78v37.16h496.78zM12.42-40.24h473.060v1.040h-473.060zM694.48 564.68v-234.12h-124.3v234.12h124.3zM698.48 573.28h-132.26v-251.28h132.22v251.28zM704.38 312.94h-144v269.36h144zM576.12 339.6h112.44v216h-112.44zM760.8 575.96h257.28v-8.6h-257.28v8.6zM754.86 584.98h269.14v-26.64h-269.14v26.64zM760.8 458.9h187.74v-8.6h-187.74v8.6zM754.86 467.92h199.6v-26.64h-199.6v26.64zM760.8 333.26h250.32v-8.6h-250.32v8.6zM754.86 342.28h262.18v-26.64h-262.18v26.64zM694.48 187.74v-234.12h-124.3v234.12h124.3zM698.48 196.32h-132.26v-251.3h132.22v251.3zM704.38-64h-144v269.36h144zM576.12-37.36h112.44v216h-112.44zM760.8 199h257.28v-8.6h-257.28v8.6zM754.86 208.040h269.14v-26.64h-269.14v26.64zM760.8 81.96h187.74v-8.6h-187.74v8.6zM754.86 90.98h199.6v-26.64h-199.6v26.64zM760.8-43.7h250.32v-8.6h-250.32v8.6zM754.86-34.66h262.18v-26.64h-262.18v26.64zM694.48 937.82v-234.12h-124.3v234.12h124.3zM698.48 946.42h-132.26v-251.3h132.22v251.3zM704.38 686h-144v269.44h144zM576.12 712.66h112.44v216.14h-112.44zM760.8 949.1h257.28v-8.6h-257.28v8.6zM754.86 958.12h269.14v-26.64h-269.14v26.64zM760.8 832.040h187.74v-8.6h-187.74v8.6zM754.86 841.060h199.6v-26.64h-199.6v26.64zM760.8 706.4h250.32v-8.6h-250.32v8.6zM754.86 715.42h262.18v-26.64h-262.18v26.64z" />
|
||||
<glyph unicode="" glyph-name="block-2" d="M479 945.58v-659.82h-468.26v659.82h468.26zM482.76 951.32h-475.78v-671.32h475.78v671.32zM488.7 271.34h-487.66v688.66h487.66zM16.7 294.44h456.36v642.46h-456.38zM6.98 170.28h474.36v-15.42h-474.36v15.42zM487.28 147.86h-486.24v29.44h486.24zM12.94 161.86h462.46v1.4h-462.46zM6.98 65.68h432.28v-15.42h-432.28v15.42zM445.2 43.24h-444.16v29.44h444.16zM12.94 57.24h420.38v1.38h-420.38zM6.98-38.94h469.020v-15.42h-469.020v15.42zM482-61.38h-480.96v29.38h480.96zM12.98-47.38h457.020v1.38h-457.060zM1016.3 945.58v-659.82h-468.3v659.82h468.3zM1020 951.32h-475.7v-671.32h475.7v671.32zM1026 271.34h-487.66v688.66h487.66zM554 294.44h456.36v642.46h-456.36zM543.88 170.28h474.36v-15.42h-474.36v15.42zM1024.18 147.86h-486.18v29.44h486.18zM549.82 161.86h462.46v1.4h-462.46zM543.88 65.68h432.28v-15.42h-432.28v15.42zM982.1 43.24h-444.1v29.44h444.1zM549.82 57.24h420.38v1.38h-420.38zM543.88-38.94h469.020v-15.42h-469.020v15.42zM1018.84-61.38h-480.84v29.38h480.84zM549.82-47.38h457.14v1.38h-457.14z" />
|
||||
<glyph unicode="" glyph-name="block-3" d="M469.26 898.72v-646.5h-458.98v646.5h458.98zM472.94 904.34h-466.34v-657.74h466.34v657.74zM478.76 238h-477.98v674.92h478zM16.1 260.8h447.34v629.32h-447.34zM6.6 134.6h464.96v-14.94h-464.96v14.94zM477.38 112.8h-476.6v28.68h476.6zM12.42 126.52h453.32v1.22h-453.32zM6.6 24.24h423.7v-14.94h-423.7v14.94zM436.14 2.42h-435.36v28.68h435.36zM12.42 16.16h412v1.22h-412zM1014.74 898.72v-646.5h-458.98v646.5h458.98zM1018.42 904.34h-466.42v-657.74h466.42v657.74zM1024.24 238h-478v674.92h478zM561.58 260.8h447.34v629.32h-447.34zM552.080 134.6h464.96v-14.94h-464.96v14.94zM1022.86 112.8h-476.6v28.68h476.6zM558 126.52h453.22v1.22h-453.22zM552.080 24.24h423.72v-14.94h-423.72v14.94zM981.6 2.42h-435.34v28.68h435.34zM558 16.16h412v1.22h-412z" />
|
||||
<glyph unicode="" glyph-name="block-4" d="M289.66 909.060v-370.56h-274.92v370.56h274.92zM298.4 922.64h-292.4v-397.74h292.4v397.74zM304.4 515.6h-304.4v416.4h304.4zM20.74 547.78h262.9v352h-262.9zM370.46 917.44h647.54v-16.68h-647.54v16.68zM364.44 926.72h659.56v-35.28h-659.56v35.28zM370.46 795.82h469.8v-16.68h-469.8v16.68zM364.44 805.1h481.8v-35.28h-481.8v35.28zM370.46 674.2h626.4v-16.68h-626.4v16.68zM364.44 683.5h638.4v-35.28h-638.4v35.28zM370.46 552.58h565.080v-16.68h-565.080v16.68zM364.44 561.88h577.080v-35.28h-577.080v35.28zM289.66 383.72v-370.56h-274.92v370.56h274.92zM298.4 397.32h-292.4v-397.76h292.4v397.76zM304.4-9.74h-304.4v416.34h304.4zM20.74 22.46h262.9v352h-262.9zM370.46 392.1h647.54v-16.68h-647.54v16.68zM364.44 401.4h659.56v-35.28h-659.56v35.28zM370.46 270.48h469.8v-16.68h-469.8v16.68zM364.44 279.78h481.8v-35.28h-481.8v35.28zM370.46 148.86h626.4v-16.68h-626.4v16.68zM364.44 158.16h638.4v-35.28h-638.4v35.28zM370.46 27.24h565.080v-16.68h-565.080v16.68zM364.44 36.54h577.080v-35.28h-577.080v35.28z" />
|
||||
<glyph unicode="" glyph-name="block-5" d="M1032 190h-96v16h80v746h-1008v-746h118v-16h-134v778h1040v-778zM140 288h778v-16h-778v16zM140 166h778v-16h-778v16zM140 54h778v-16h-778v16z" />
|
||||
<glyph unicode="" glyph-name="block-6" d="M137.24 858.44v-181.66h-126.16v181.66h126.16zM141.24 865.12h-134.16v-195h134.16v195zM147.24 663.12h-146.16v209h146.16zM17.080 683.78h114.16v167.66h-114.16zM208.34 863.020h261.28v-6.66h-261.28v6.66zM202.34 870.040h273.28v-20.68h-273.28v20.68zM208.34 776.36h190.66v-6.66h-190.66v6.66zM202.34 783.36h202.66v-20.68h-202.66v20.68zM208.34 678.86h254.22v-6.66h-254.22v6.66zM202.34 685.88h266.22v-20.68h-266.22v20.68zM137.24 541.88v-181.66h-126.16v181.66h126.16zM141.24 548.56h-134.16v-195h134.16v195zM147.24 346.56h-146.16v209h146.16zM17.080 367.24h114.16v167.64h-114.16zM208.34 550.64h261.28v-6.66h-261.28v6.66zM202.34 557.64h273.28v-20.68h-273.28v20.68zM208.34 459.8h190.66v-6.66h-190.66v6.66zM202.34 466.82h202.66v-20.68h-202.66v20.68zM208.34 362.32h254.22v-6.66h-254.22v6.66zM202.34 369.32h266.22v-20.68h-266.22v20.68zM137.24 225.32v-181.66h-126.16v181.66h126.16zM141.24 232h-134.16v-195h134.16v195zM147.24 30h-146.16v209h146.16zM17.080 50.68h114.16v167.64h-114.16zM208.34 234.080h261.28v-6.66h-261.28v6.66zM202.34 241.080h273.28v-20.68h-273.28v20.68zM208.34 143.24h190.66v-6.66h-190.66v6.66zM202.34 150.26h202.66v-20.68h-202.66v20.68zM208.34 45.76h254.22v-6.66h-254.22v6.66zM202.34 52.76h266.22v-20.68h-266.22v20.68zM685.62 858.44v-181.66h-126.16v181.66h126.16zM689.62 865.12h-134.16v-195h134.16v195zM695.62 663.12h-146.16v209h146.16zM565.46 683.78h114.16v167.66h-114.16zM756.72 863.020h261.28v-6.66h-261.28v6.66zM750.72 870.040h273.28v-20.68h-273.28v20.68zM756.72 776.36h190.66v-6.66h-190.66v6.66zM750.72 783.36h202.66v-20.68h-202.66v20.68zM756.72 678.86h254.22v-6.66h-254.22v6.66zM750.72 685.88h266.22v-20.68h-266.22v20.68zM685.62 541.88v-181.66h-126.16v181.66h126.16zM689.62 548.56h-134.16v-195h134.16v195zM695.62 346.56h-146.16v209h146.16zM565.46 367.24h114.16v167.64h-114.16zM756.72 550.64h261.28v-6.66h-261.28v6.66zM750.72 557.64h273.28v-20.68h-273.28v20.68zM756.72 459.8h190.66v-6.66h-190.66v6.66zM750.72 466.82h202.66v-20.68h-202.66v20.68zM756.72 362.32h254.22v-6.66h-254.22v6.66zM750.72 369.32h266.22v-20.68h-266.22v20.68zM685.62 225.32v-181.66h-126.16v181.66h126.16zM689.62 232h-134.16v-195h134.16v195zM695.62 30h-146.16v209h146.16zM565.46 50.68h114.16v167.64h-114.16zM756.72 234.080h261.28v-6.66h-261.28v6.66zM750.72 241.080h273.28v-20.68h-273.28v20.68zM756.72 143.24h190.66v-6.66h-190.66v6.66zM750.72 150.26h202.66v-20.68h-202.66v20.68zM756.72 45.76h254.22v-6.66h-254.22v6.66zM750.72 52.76h266.22v-20.68h-266.22v20.68z" />
|
||||
<glyph unicode="" glyph-name="block-7" d="M469.46 948.4v-473.18h-459.78v473.18h459.78zM473.14 952.52h-467.14v-481.42h467.14v481.42zM479.14 463.62h-479.14v496.38h479.14zM15.68 482.68h447.78v458.26h-447.78zM57.52 722.82h72.72v-37.46h-72.72v37.46zM138 676.76h-88.22v54.64h88.22zM65.28 694h57.24v20.22h-57.24zM55.4 629.58h336.2v-16.72h-336.2v16.72zM49.78 638.16h347.42v-33.9h-347.42v33.9zM55.4 546.72h364.78v-16.72h-364.78v16.72zM49.78 555.3h376v-33.9h-376v33.9zM137.86 374v-162h-127.44v162h127.44zM141.86 380h-135.5v-174h135.64v174zM148.28 198.96h-148.28v188.12h148.28zM16.78 219.12h114.7v147.8h-114.7zM209.68 378.1h263.96v-5.94h-263.96v5.94zM203.32 385.22h276.68v-20.16h-276.68v20.16zM209.68 300.82h192.62v-5.94h-192.62v5.94zM203.32 307.92h205.34v-20.16h-205.34v20.16zM209.68 213.88h256.82v-5.94h-256.82v5.94zM203.32 220.98h269.56v-20.16h-269.56v20.16zM137.86 111.060v-162h-127.44v162h127.44zM141.86 117.060h-135.5v-173.9h135.64v173.84zM148.28-64h-148.28v188h148.28zM16.78-43.84h114.7v147.84h-114.7zM209.68 118.86h263.96v-5.94h-263.96v5.94zM203.32 125.96h276.68v-20.16h-276.68v20.16zM209.68 37.86h192.62v-5.94h-192.62v5.94zM203.32 44.96h205.34v-20.16h-205.34v20.16zM209.68-49.1h256.82v-5.94h-256.82v5.94zM203.32-41.98h269.56v-20.16h-269.56v20.16zM1014.32 948.4v-473.18h-459.78v473.18h459.78zM1018 952.52h-467.14v-481.42h467.14v481.42zM1024 463.62h-479.14v496.38h479.14zM560.54 482.68h447.78v458.26h-447.78zM591 722.82h73.2v-37.46h-73.2v37.46zM672 676.76h-88.78v54.64h88.78zM598.8 694h57.6v20.22h-57.6zM588.74 629.58h330.82v-16.72h-330.82v16.72zM583.22 638.16h341.88v-33.9h-341.88v33.9zM588.74 546.72h358.96v-16.72h-358.96v16.72zM583.22 555.3h370v-33.9h-370v33.9zM684.34 374v-162h-126.5v162h126.5zM688.34 380h-134.54v-174h134.56v174zM694.68 198.96h-147.2v188.12h147.2zM564.16 219.12h113.84v147.8h-113.84zM755.64 378.1h262.040v-5.94h-262.040v5.94zM749.32 385.22h274.68v-20.16h-274.68v20.16zM755.64 300.82h191.22v-5.94h-191.22v5.94zM749.32 307.92h203.86v-20.16h-203.86v20.16zM755.64 213.88h254.96v-5.94h-254.96v5.94zM749.32 220.98h267.6v-20.16h-267.6v20.16zM684.34 111.060v-162h-126.5v162h126.5zM688.34 117.060h-134.54v-173.9h134.56v173.84zM694.68-64h-147.2v188h147.2zM564.16-43.84h113.84v147.84h-113.84zM755.64 118.86h262.040v-5.94h-262.040v5.94zM749.32 125.96h274.68v-20.16h-274.68v20.16zM755.64 37.86h191.22v-5.94h-191.22v5.94zM749.32 44.96h203.86v-20.16h-203.86v20.16zM755.64-49.1h254.96v-5.94h-254.96v5.94zM749.32-41.98h267.6v-20.16h-267.6v20.16z" />
|
||||
<glyph unicode="" glyph-name="block-8" d="M308 943.88v-688.86h-299.82v688.86h299.82zM310.4 949.88h-304.62v-700.86h304.58v700.86zM316.26 238.9h-316.38v721.1h316.38zM14 265.14h288v668.62h-288zM5.78 115.96h303.68v-19.92h-303.68v19.92zM-0.12 126.080h315.48v-40.18h-315.48v40.18zM5.78-33.94h276.74v-19.92h-276.74v19.92zM-0.12-23.82h288.54v-40.18h-288.54v40.18zM661.82 943.88v-688.86h-299.82v688.86h299.82zM664.22 949.88h-304.58v-700.86h304.58v700.86zM670.12 238.9h-316.38v721.1h316.38zM368 265.14h288v668.62h-288zM359.64 115.96h303.68v-19.92h-303.68v19.92zM353.74 126.080h315.48v-40.18h-315.48v40.18zM359.64-33.94h276.74v-19.92h-276.74v19.92zM353.74-23.82h288.54v-40.18h-288.54v40.18zM1015.7 943.88v-688.86h-299.7v688.86h299.7zM1018.1 949.88h-304.58v-700.86h304.58v700.86zM1024 238.9h-316.38v721.1h316.38zM721.82 265.14h288v668.62h-288zM713.52 115.96h303.68v-19.92h-303.68v19.92zM707.62 126.080h315.48v-40.18h-315.48v40.18zM713.52-33.94h276.74v-19.92h-276.74v19.92zM707.62-23.82h288.54v-40.18h-288.54v40.18z" />
|
||||
<glyph unicode="" glyph-name="block-9" d="M8 951.26h454.6v-29.98h-454.6v29.98zM468.6 914.54h-466.6v43.46h466.6zM14 928h442.6v16.52h-442.6zM8 869.12h414.28v-14.2h-414.28v14.2zM428.28 848.18h-426.28v27.68h426.28zM14 861.64h402.28v0.74h-402.28zM8 797.52h151.68v-14.2h-151.68v14.2zM165.68 776.58h-163.68v27.68h163.68zM14 790h139.68v0.72h-139.68zM565.4 951.26h454.6v-29.98h-454.6v29.98zM1026 914.54h-466.6v43.46h466.6zM571.4 928h442.6v16.52h-442.6zM565.4 869.12h414.28v-14.2h-414.28v14.2zM985.68 848.18h-426.28v27.68h426.28zM571.4 861.64h402.28v0.74h-402.28zM565.4 797.52h151.68v-14.2h-151.68v14.2zM723.060 776.58h-163.66v27.68h163.66zM571.4 790h139.66v0.72h-139.66zM8 670.4h454.6v-29.98h-454.6v29.98zM468.6 633.68h-466.6v43.46h466.6zM14 647.14h442.6v16.52h-442.6zM8 588.26h414.28v-14.2h-414.28v14.2zM428.28 567.32h-426.28v27.68h426.28zM14 580.78h402.28v0.74h-402.28zM8 516.66h151.68v-14.2h-151.68v14.2zM165.68 495.72h-163.68v27.68h163.68zM14 509.2h139.68v0.8h-139.68zM565.4 670.4h454.6v-29.98h-454.6v29.98zM1026 633.68h-466.6v43.46h466.6zM571.4 647.14h442.6v16.52h-442.6zM565.4 588.26h414.28v-14.2h-414.28v14.2zM985.68 567.32h-426.28v27.68h426.28zM571.4 580.78h402.28v0.74h-402.28zM565.4 516.66h151.68v-14.2h-151.68v14.2zM723.060 495.72h-163.66v27.68h163.66zM571.4 509.2h139.66v0.8h-139.66zM8 389.54h454.6v-29.98h-454.6v29.98zM468.6 352.82h-466.6v43.46h466.6zM14 366.28h442.6v16.52h-442.6zM8 307.4h414.28v-14.2h-414.28v14.2zM428.28 286.46h-426.28v27.68h426.28zM14 300h402.28v0.74h-402.28zM8 235.8h151.68v-14.2h-151.68v14.2zM165.68 214.86h-163.68v27.68h163.68zM14 228.34h139.68v0.72h-139.68zM565.4 389.54h454.6v-29.98h-454.6v29.98zM1026 352.82h-466.6v43.46h466.6zM571.4 366.28h442.6v16.52h-442.6zM565.4 307.4h414.28v-14.2h-414.28v14.2zM985.68 286.46h-426.28v27.68h426.28zM571.4 300h402.28v0.74h-402.28zM565.4 235.8h151.68v-14.2h-151.68v14.2zM723.060 214.86h-163.66v27.68h163.66zM571.4 228.34h139.66v0.72h-139.66zM8 108.68h454.6v-29.98h-454.6v29.98zM468.6 72h-466.6v43.42h466.6zM14 85.42h442.6v16.58h-442.6zM8 26.54h414.28v-14.2h-414.28v14.2zM428.28 5.58h-426.28v27.68h426.28zM14 19.060h402.28v0.74h-402.28zM8-45.060h151.68v-14.2h-151.68v14.2zM165.68-66h-163.68v27.68h163.68zM14-52.52h139.68v0.72h-139.68zM565.4 108.68h454.6v-29.98h-454.6v29.98zM1026 72h-466.6v43.42h466.6zM571.4 85.46h442.6v16.54h-442.6zM565.4 26.54h414.28v-14.2h-414.28v14.2zM985.68 5.58h-426.28v27.68h426.28zM571.4 19.060h402.28v0.74h-402.28zM565.4-45.060h151.68v-14.2h-151.68v14.2zM723.060-66h-163.66v27.68h163.66zM571.4-52.52h139.66v0.72h-139.66z" />
|
||||
<glyph unicode="" glyph-name="grid-1" d="M1010 943.66v-991.32h-996v991.32h996zM1018 952.28h-1012v-1008.56h1012v1008.56zM1024-64h-1024v1024h1024zM20-40h984v976h-984zM89.5 473.72h211.18v-88.44h-211.18v88.44zM312 377.56h-233.8v103.88h233.8zM100.82 393h188.56v73h-188.56zM84.18 302.84h786.9v-24.68h-786.9v24.68zM877.1 270.44h-798.9v40.12h798.9zM90.2 285.88h774.9v9.24h-774.9zM84.18 184.36h853.82v-24.68h-853.82v24.68zM944 152h-865.8v40h865.8zM90.2 167.4h841.8v9.24h-841.8zM84.18 65.88h409.3v-24.68h-409.3v24.68zM499.5 33.48h-421.3v40.12h421.3zM90.2 48.92h397.3v9.26h-397.3z" />
|
||||
<glyph unicode="" glyph-name="grid-2" d="M495.74 852v-805.16h-485.38v805.16h485.38zM499.64 859h-493.16v-819.16h493.16v819.26zM505.64 32h-505.16v834.94h505.16zM16.36 54.68h473.4v789.58h-473.4zM56.56 468.82h59.36v-44.92h-59.36v44.92zM122 416h-71.42v60.64h71.42zM62.64 431.68h47.36v29.3h-47.44zM56.56 298.020h357.38v-20.060h-357.38v20.060zM420 270.12h-369.42v35.74h369.42zM62.56 285.8h345.44v4.38h-345.44zM56.56 139.66h387.76v-20.060h-387.76v20.060zM450.32 111.76h-399.74v35.72h399.74zM62.56 127.44h375.78v4.38h-375.78zM759.5 855.76v-382.86h-229.5v382.86h229.5zM761.34 859.1h-233.12v-389.52h233.12v389.52zM767.34 461.74h-245.12v405.2h245.12zM536 480.74h217.52v367.26h-217.52zM560.56 665.94h29.78v-28.5h-29.78v28.5zM596.34 629.6h-41.76v44.18h41.76zM566.56 645.28h17.8v12.72h-17.8zM560.56 556.2h165.98v-11.52h-165.98v11.52zM554.58 564.040h177.96v-27.18h-177.96v27.18zM759.5 424.94v-381.78h-229.5v381.78h229.5zM761.34 428.26h-233.12v-388.42h233.12v388.42zM767.34 32h-245.12v404h245.12zM536 51h217.52v366h-217.52zM560.56 235.64h29.78v-28.42h-29.78v28.42zM596.34 199.38h-41.76v44.1h41.76zM566.56 215.060h17.8v12.76h-17.8zM560.56 126.22h165.98v-11.48h-165.98v11.48zM554.58 134.060h177.96v-27.16h-177.96v27.16zM1016.18 424.94v-381.78h-228.72v381.78h228.72zM1018 428.26h-232.36v-388.42h232.36v388.42zM1024 32h-244.36v404h244.36zM793.46 51h216.72v366h-216.72zM817.88 235.64h29.68v-28.42h-29.68v28.42zM853.56 199.38h-41.68v44.1h41.68zM823.88 215.060h17.68v12.76h-17.68zM817.88 126.22h163.2v-11.48h-163.2v11.48zM811.88 134.060h175.18v-27.16h-175.18v27.16zM1016.18 855.76v-382.86h-228.72v382.86h228.72zM1018 859.1h-232.36v-389.52h232.36v389.52zM1024 461.74h-244.36v405.2h244.36zM793.46 480.74h216.72v367.26h-216.72zM817.88 665.94h29.68v-28.5h-29.68v28.5zM853.56 629.6h-41.68v44.18h41.68zM823.88 645.28h17.68v12.72h-17.68zM817.88 556.2h163.2v-11.52h-163.2v11.52zM811.88 564.040h175.18v-27.18h-175.18v27.18z" />
|
||||
<glyph unicode="" glyph-name="grid-3" d="M492.4 850v-803.3h-482.54v803.3h482.54zM496.26 856.98h-490.26v-817.26h490.26v817.32zM502.26 32h-502.26v832.74h502.26zM15.86 54.4h470.54v788h-470.54zM43.88 361.7h59v-44.8h-59v44.8zM108.88 309.18h-70.88v60.22h70.88zM49.88 324.6h47.020v29.4h-47.020zM43.88 250.18h376.4v-20h-376.4v20zM426.28 222.46h-388.28v35.42h388.28zM49.88 237.88h364.42v4.58h-364.42zM43.88 151.060h408.4v-20h-408.4v20zM458.28 123.34h-420.28v35.44h420.28zM49.88 138.76h396.42v4.6h-396.42zM1014.12 853.78v-374.3h-484.24v374.3h484.24zM1018 857.040h-492v-380.82h492v380.82zM1024 468.52h-504v396.22h504zM535.86 487.2h472.26v358.8h-472.26zM562.88 662.74h30.4v-27.86h-30.4v27.86zM599.28 627.16h-42.4v43.28h42.4zM568.86 642.58h18.42v12.44h-18.42zM562.88 556.94h419.94v-11.26h-419.94v11.26zM556.88 564.66h431.92v-26.68h-431.92v26.68zM754.44 418.78v-374.3h-226.64v374.3h226.64zM756.26 422.040h-230.26v-380.82h230.26v380.78zM762.26 33.52h-242.26v396.22h242.26zM533.8 52.2h214.64v358.88h-214.64zM558.16 227.72h27.76v-27.86h-27.76v27.86zM592 192.16h-39.84v43.28h39.84zM564.26 207.58h15.74v12.42h-15.76zM558.16 121.94h173.84v-11.26h-173.84v11.26zM552.16 129.66h185.84v-26.68h-185.84v26.68zM1016.18 418.78v-374.3h-226.64v374.3h226.64zM1018 422h-230.26v-380.78h230.26v380.78zM1024 33.52h-242.26v396.22h242.26zM795.54 52.2h214.66v358.88h-214.66zM817.040 227.72h27.76v-27.86h-27.76v27.86zM850.78 192.16h-39.74v43.28h39.74zM823.040 207.58h15.76v12.42h-15.76zM817.040 121.94h173.84v-11.26h-173.84v11.26zM811.040 129.66h185.84v-26.68h-185.84v26.68z" />
|
||||
<glyph unicode="" glyph-name="grid-4" d="M491.62 850.96v-804.38h-481.76v804.38h481.76zM495.5 858h-489.5v-818.42h489.5v818.42zM501.48 32h-501.48v833.52h501.48zM15.86 54.16h469.78v789.22h-469.78zM79.96 361.96h99.7v-44.86h-99.7v44.86zM189.82 309.52h-120v60h120zM90.1 324.68h79.42v29.72h-79.42zM75.38 250.32h321.54v-20.040h-321.54v20.040zM402.48 222.7h-332.66v35.18h332.66zM80.94 237.86h310.42v4.88h-310.42zM75.38 151.080h348.88v-20.040h-348.88v20.040zM429.82 123.46h-360v35.2h360zM80.94 138.62h337.76v4.88h-337.76zM1014.14 850.96v-804.38h-481.76v804.38h481.76zM1018 858h-489.5v-818.42h489.5v818.42zM1024 32h-501.48v833.52h501.48zM538.36 54.16h469.78v789.22h-469.78zM603.3 361.96h99.72v-44.86h-99.72v44.86zM713.16 309.52h-120v60h120zM613.46 324.68h79.42v29.72h-79.42zM598.76 250.32h321.46v-20.040h-321.46v20.040zM925.84 222.7h-332.68v35.18h332.68zM604.36 237.86h310.28v4.88h-310.28zM598.76 151.080h348.8v-20.040h-348.8v20.040zM953.16 123.46h-360v35.2h360zM604.36 138.62h337.64v4.88h-337.64z" />
|
||||
<glyph unicode="" glyph-name="grid-5" d="M325.58 851.54v-805.080h-317.040v805.080h317.040zM328.12 858.54h-322.12v-819.080h322.12v819.080zM334.12 32h-334.12v834h334.12zM14.54 54h305.040v790h-305.040zM36.26 362.14h59.22v-44.9h-59.22v44.9zM101.48 309.78h-71.2v59.8h71.2zM42.26 324.68h47.24v30h-47.24zM36.26 250.38h215.34v-20.040h-215.34v20.040zM257.6 222.88h-227.32v34.96h227.32zM42.26 237.78h203.34v5.14h-203.34zM36.26 151.060h233.64v-20.040h-233.64v20.040zM276 123.54h-245.72v34.96h245.72zM42.26 138.46h221.74v5.14h-221.74zM669.58 851.54v-805.080h-314.2v805.080h314.2zM672.1 858.54h-319.24v-819.080h319.24v819.080zM678.1 32h-331.24v834h331.24zM361.36 54h302.24v790h-302.24zM396.32 362.14h58.7v-44.9h-58.7v44.9zM461 309.78h-70.68v59.8h70.68zM402.32 324.68h46.7v30h-46.7zM396.32 250.38h213.42v-20.040h-213.42v20.040zM615.72 222.88h-225.4v34.96h225.4zM402.32 237.78h201.42v5.14h-201.42zM396.32 151.060h231.56v-20.040h-231.56v20.040zM633.86 123.54h-243.54v34.96h243.54zM402.32 138.46h219.56v5.14h-219.56zM1015.48 851.54v-805.080h-315.16v805.080h315.16zM1018 858.54h-320.2v-819.080h320.2v819.080zM1024 32h-332.2v834h332.2zM706.32 54h303.16v790h-303.16zM741.38 362.14h58.88v-44.9h-58.88v44.9zM806.26 309.78h-70.86v59.8h70.86zM747.38 324.68h46.88v30h-46.88zM741.38 250.38h214.060v-20.040h-214.060v20.040zM961.44 222.88h-226v34.96h226zM747.44 237.78h202v5.14h-202zM741.38 151.060h232.26v-20.040h-232.26v20.040zM979.64 123.54h-244.24v34.96h244.24zM747.38 138.46h220.26v5.14h-220.26z" />
|
||||
<glyph unicode="" glyph-name="grid-6" d="M240.56 851.46v-804.92h-232.7v804.92h232.7zM242.42 858.46h-236.42v-818.92h236.42v818.92zM248.4 32h-248.4v834h248.4zM13.84 54h220.72v790h-220.72zM43.36 362.14h42.72v-44.9h-42.72v44.9zM92 309.72h-54.62v60h54.62zM49.28 324.78h30.72v29.84h-30.66zM43.36 250.42h155.36v-20.040h-155.36v20.040zM204.7 222.84h-167.32v35.16h167.32zM49.34 237.9h143.38v4.98h-143.38zM43.36 151.1h168.56v-20.040h-168.56v20.040zM218 123.52h-180.62v35.12h180.62zM49.34 138.6h156.66v4.98h-156.66zM498.6 851.46v-804.92h-232.6v804.92h232.6zM500.46 858.46h-236.46v-818.92h236.46v818.92zM506.46 32h-248.46v834h248.46zM271.88 54h220.74v790h-220.74zM301.4 362.14h42.72v-44.9h-42.72v44.9zM350.1 309.72h-54.68v60h54.68zM307.38 324.78h30.74v29.84h-30.74zM301.4 250.42h155.36v-20.040h-155.36v20.040zM462.74 222.84h-167.32v35.16h167.32zM307.38 237.9h143.38v4.98h-143.38zM301.4 151.1h168.56v-20.040h-168.56v20.040zM476 123.52h-180.58v35.12h180.58zM307.44 138.6h156.56v4.98h-156.6zM756.64 851.46v-804.92h-232.64v804.92h232.64zM758.52 858.46h-236.52v-818.92h236.52v818.92zM764.5 32h-248.4v834h248.4zM530 54h220.66v790h-220.66zM559.44 362.14h42.72v-44.9h-42.72v44.9zM608.14 309.72h-54.68v60h54.68zM565.44 324.78h30.74v29.84h-30.74zM559.44 250.42h155.36v-20.040h-155.36v20.040zM720.78 222.84h-167.32v35.16h167.32zM565.44 237.9h143.38v4.98h-143.38zM559.44 151.1h168.56v-20.040h-168.56v20.040zM734 123.52h-180.54v35.12h180.54zM565.44 138.6h156.56v4.98h-156.56zM1014.7 851.46v-804.92h-232.7v804.92h232.7zM1016.56 858.46h-236.44v-818.92h236.44v818.92zM1022.54 32h-248.4v834h248.4zM788 54h220.7v790h-220.7zM818.1 362.14h43.42v-44.9h-43.42v44.9zM867.5 309.72h-55.38v60h55.38zM824.1 324.78h31.44v29.84h-31.44zM818.1 250.42h157.9v-20.040h-157.9v20.040zM982 222.84h-169.88v35.16h169.88zM824.12 237.9h146v4.98h-146zM818.1 151.1h171.32v-20.040h-171.32v20.040zM995.42 123.52h-183.3v35.12h183.3zM824.1 138.6h159.34v4.98h-159.34z" />
|
||||
<glyph unicode="" glyph-name="grid-7" d="M491.82 871.58v-835.16h-479.58v835.16h479.58zM495.66 878.84h-487.26v-849.68h487.26v849.68zM501.64 22h-499.22v864h499.22zM18.22 43.58h467.62v820.84h-467.62zM66 421.74h58.64v-45.96h-58.64v45.96zM130.62 368.6h-70.62v60.3h70.6zM72 382.92h46.66v31.66h-46.66zM66 279.020h344.2v-20.52h-344.2v20.52zM416.18 251.34h-356.18v34.84h356.18zM72 265.66h332.22v6.2h-332.22zM66 149.040h373.46v-20.52h-373.46v20.52zM445.44 121.36h-385.44v34.84h385.44zM72 135.68h361.48v6.2h-361.48zM1014.1 875.4v-396.58h-488.46v396.58h488.46zM1018.1 878.84h-496.38v-403.46h496.28v403.46zM1024 468.22h-508.26v417.78h508.26zM531.62 486h476.5v382.22h-476.5zM567.060 674.64h43.82v-29.52h-43.82v29.52zM616.86 638h-55.76v43.8h55.76zM573.060 652.32h31.84v15.2h-31.84zM567.060 563.22h410.58v-11.92h-410.58v11.92zM561.1 570.38h422.54v-26.24h-422.54v26.24zM1014.1 429.18v-396.58h-488.46v396.58h488.46zM1018.1 432.62h-496.38v-403.46h496.28v403.46zM1024 22h-508.26v417.78h508.26zM531.62 39.78h476.5v382.22h-476.5zM567.060 228.42h43.82v-29.52h-43.82v29.52zM616.86 191.74h-55.76v43.84h55.76zM573.060 206h31.84v15.2h-31.84zM567.060 117h410.58v-11.92h-410.58v11.92zM561.1 124.16h422.54v-26.24h-422.54v26.24z" />
|
||||
<glyph unicode="" glyph-name="grid-8" d="M1010 875.18v-548.26h-996v548.26h996zM1018 880h-1012v-557.84h1012v557.84zM1024 316h-1024v570h1024zM20 332.98h984v536.14h-984zM80.14 612.4h112.040v-57.42h-112.040v57.42zM198.18 548.92h-124v69.54h124zM86.18 561.040h100v45.3h-100zM80.14 509.38h795.78v-13.66h-795.78v13.66zM882 489.68h-807.84v25.76h807.84zM86.14 501.8h783.86v1.54h-783.86zM80.14 443.86h863.42v-13.66h-863.42v13.66zM949.58 424.16h-875.42v25.84h875.42zM86.14 436.26h851.44v1.54h-851.44zM80.14 378.34h413.92v-13.66h-413.92v13.66zM500 358.62h-425.84v25.78h425.84zM86 370.74h402v1.54h-402zM240.82 296.44v-266h-232.96v266h232.96zM242.68 298.74h-236.68v-270.74h236.68v270.74zM248.68 22h-248.68v282.8h248.68zM13.86 36.42h220.96v254h-220.96zM48.3 155.040h42.76v-24.84h-42.76v24.84zM97.040 124.14h-54.74v36.94h54.74zM54.28 136.24h30.78v12.74h-30.78zM48.3 93.22h158v-11.080h-158v11.080zM42.3 99.28h170v-23.2h-170v23.2zM499.26 296.44v-266h-232.96v266h232.96zM501.12 298.74h-236.68v-270.74h236.68v270.74zM507.12 22h-248.68v282.8h248.68zM272.3 36.42h220.96v254h-220.96zM306.74 155.040h42.76v-24.84h-42.76v24.84zM355.48 124.14h-54.74v36.94h54.74zM312.72 136.24h30.78v12.74h-30.78zM306.74 93.22h163.3v-11.080h-163.3v11.080zM300.74 99.28h175.3v-23.2h-175.3v23.2zM757.7 296.44v-266h-232.96v266h232.96zM759.56 298.74h-236.68v-270.74h236.68v270.74zM765.56 22h-248.68v282.8h248.68zM530.74 36.42h220.96v254h-220.96zM565.18 155.040h42.76v-24.84h-42.76v24.84zM614 124.14h-54.82v36.94h54.82zM571.26 136.24h30.74v12.74h-30.82zM565.18 93.22h156.62v-11.080h-156.62v11.080zM559.18 99.28h168.6v-23.2h-168.6v23.2zM1016.14 296.44v-266h-232.96v266h232.96zM1018 298.74h-236.68v-270.74h236.68v270.74zM1024 22h-248.68v282.8h248.68zM789.18 36.42h220.96v254h-220.96zM824.24 155.040h43.46v-24.84h-43.46v24.84zM873.68 124.14h-55.44v36.94h55.44zM830.22 136.24h31.48v12.74h-31.48zM824.24 93.22h161.3v-11.080h-161.3v11.080zM818.24 99.28h173.3v-23.2h-173.3v23.2z" />
|
||||
<glyph unicode="" glyph-name="grid-9" d="M240 359.38v-328.54h-232.14v328.54h232.14zM241.86 362.24h-235.86v-334.24h235.88v334.24zM247.88 22h-247.88v346.22h247.88zM13.88 36.82h220.12v316.58h-220.16zM40.24 160.64h42.62v-26.94h-42.62v26.94zM88.84 127.72h-54.6v38.9h54.6zM46.24 139.72h30.62v14.98h-30.62zM40.24 93.58h164.060v-12.020h-164.060v12.020zM210.3 75.58h-176v24h176zM46.3 87.58h152zM498.72 359.38v-328.54h-232.16v328.54h232.16zM500.58 362.24h-235.88v-334.24h235.88v334.24zM506.58 22h-247.86v346.22h247.86zM272.58 36.82h220.14v316.58h-220.16zM298.94 160.64h42.62v-26.94h-42.62v26.94zM347.56 127.72h-54.6v38.9h54.6zM304.94 139.72h30.62v14.98h-30.62zM298.94 93.58h161.1v-12.020h-161.1v12.020zM466 75.58h-173.040v24h173.040zM304.9 87.58h149.12zM757.44 359.38v-328.54h-232.16v328.54h232.16zM759.3 362.24h-235.88v-334.24h235.88v334.24zM765.3 22h-247.88v346.22h247.88zM531.3 36.82h220.14v316.58h-220.16zM557.66 160.64h42.62v-26.94h-42.62v26.94zM606.26 127.72h-54.6v38.9h54.6zM563.66 139.72h30.62v14.98h-30.62zM557.66 93.58h162.14v-12.020h-162.14v12.020zM725.8 75.58h-174.14v24h174.14zM563.66 87.58h150.14zM1016.14 359.38v-328.54h-232.14v328.54h232.14zM1018 362.24h-235.88v-334.24h235.88v334.24zM1024 22h-247.88v346.22h247.88zM790 36.82h220.16v316.58h-220.16zM816.98 160.64h43.32v-26.94h-43.32v26.94zM866.28 127.72h-55.3v38.9h55.3zM822.98 139.72h31.32v14.98h-31.32zM816.98 93.58h158.56v-12.020h-158.56v12.020zM981.54 75.58h-170.56v24h170.56zM822.98 87.58h146.58zM1015.5 875.82v-483.040h-312.66v483.040h312.66zM1018 880h-317.68v-491.42h317.68v491.42zM1024 382.6h-329.68v503.4h329.68zM708.82 398.74h300.68v471.1h-300.68zM751.56 582.18h58.4v-26.94h-58.4v26.94zM816 549.26h-70.42v38.9h70.42zM757.6 561.26h46.4v14.94h-46.44zM751.56 515.12h212.36v-12.020h-212.36v12.020zM970 497.12h-224.42v24h224.42zM757.64 509.12h200.38zM751.56 455.52h230.42v-12.020h-230.42v12.020zM988 437.52h-242.42v24h242.42zM757.58 449.52h-0.020zM669.74 875.82v-483.040h-314.54v483.040h314.54zM672.26 880.020h-319.58v-491.44h319.58v491.42zM678.26 382.6h-331.56v503.4h331.56zM361.2 398.74h302.56v471.1h-302.56zM394.7 582.18h58.76v-26.94h-58.76v26.94zM459.46 549.26h-70.74v38.9h70.74zM400.7 561.26h46.76v14.94h-46.76zM394.7 515.12h210.34v-12.020h-210.34v12.020zM611.040 497.12h-222.32v24h222.32zM400.7 509.12h198.34zM394.7 455.52h228.22v-12.020h-228.22v12.020zM628.92 437.52h-240.2v24h240.2zM400.7 449.52v0zM323.060 875.82v-483.040h-314.54v483.040h314.54zM325.58 880.020h-319.58v-491.44h319.58v491.42zM331.58 382.6h-331.58v503.4h331.58zM14.52 398.74h302.54v471.1h-302.54zM48.020 590.5h58.76v-26.94h-58.76v26.94zM112.76 557.58h-70.76v38.9h70.76zM54 569.58h46.78v14.98h-46.78zM48.020 523.44h210.34v-12.020h-210.34v12.020zM264.34 505.44h-222.34v24h222.34zM54 517.4h198.36zM48.020 463.84h228.22v-12.020h-228.22v12.020zM282.22 445.84h-240.22v24h240.2zM54 457.8v0z" />
|
||||
</font></defs></svg>
|
||||
|
After Width: | Height: | Size: 27 KiB |
BIN
colormag/inc/elementor/assets/fonts/colormag-econs.ttf
Normal file
BIN
colormag/inc/elementor/assets/fonts/colormag-econs.woff
Normal file
12
colormag/inc/elementor/assets/img/next.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="7067.293 884.793 17.121 31.414">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: none;
|
||||
stroke: #fff;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path id="next" class="cls-1" d="M7068,885l15,15-15,15" transform="translate(0 0.5)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 363 B |
12
colormag/inc/elementor/assets/img/prev.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="6016.586 884.793 17.121 31.414">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: none;
|
||||
stroke: #fff;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path id="prev" class="cls-1" d="M7068,885l15,15-15,15" transform="translate(13101 1800.5) rotate(180)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 382 B |
3
colormag/inc/elementor/assets/js/colormag-elementor.js
Normal file
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* ColorMag Custom Elementor JS settings
|
||||
*/
|
||||
179
colormag/inc/elementor/elementor-functions.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom functions to be used within Elementor plugin
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return the values of all the categories of the posts
|
||||
* present in the site
|
||||
*
|
||||
* @return array of category ids and its respective names
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_categories() {
|
||||
$output = array();
|
||||
$categories = get_categories();
|
||||
|
||||
foreach ( $categories as $category ) {
|
||||
$output[ $category->term_id ] = $category->name;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Colormag_Elementor required setups
|
||||
* Particularly used for registering post thumbnail size and others
|
||||
*
|
||||
* Hooked in after_setup_theme
|
||||
*
|
||||
* @since ColorMag 2.2.3
|
||||
*/
|
||||
function colormag_elementor_setup() {
|
||||
|
||||
// Cropping the images to different sizes to be used in the theme for Elementor
|
||||
// For the block widgets
|
||||
add_image_size( 'colormag-elementor-block-extra-large-thumbnail', 1155, 480, true );
|
||||
|
||||
// Cropping the images to different sizes to be used in the theme for Elementor
|
||||
// For the grid widgets
|
||||
add_image_size( 'colormag-elementor-grid-large-thumbnail', 600, 417, true );
|
||||
add_image_size( 'colormag-elementor-grid-small-thumbnail', 285, 450, true );
|
||||
add_image_size( 'colormag-elementor-grid-medium-large-thumbnail', 575, 198, true );
|
||||
}
|
||||
|
||||
add_action( 'after_setup_theme', 'colormag_elementor_setup' );
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_widgets_meta' ) ) :
|
||||
|
||||
/**
|
||||
* Display the posts meta for use within Elementor widgets
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_widgets_meta() {
|
||||
?>
|
||||
|
||||
<div class="tg-module-meta">
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
?>
|
||||
|
||||
<span class="tg-post-date entry-date">
|
||||
<?php echo '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'; ?>
|
||||
</span>
|
||||
|
||||
<span class="tg-post-auther-name author vcard">
|
||||
<?php echo '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a>'; ?>
|
||||
</span>
|
||||
|
||||
<?php if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="tg-module-comments">
|
||||
<?php comments_popup_link( '0', '1', '%' ); ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_styles' ) ) {
|
||||
|
||||
/**
|
||||
* Loads styles on elementor editor
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_styles() {
|
||||
wp_enqueue_style( 'colormag-econs', get_template_directory_uri() . '/inc/elementor/assets/css/colormag-econs.css', false, '1.0' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
add_action( 'elementor/editor/after_enqueue_styles', 'colormag_elementor_styles' );
|
||||
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_colored_category' ) ) :
|
||||
|
||||
/**
|
||||
* Display/Returns the category names for Elementor widgets
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_colored_category( $display = 1 ) {
|
||||
global $post;
|
||||
$categories = get_the_category();
|
||||
$separator = ' ';
|
||||
$output = '';
|
||||
|
||||
if ( $categories ) {
|
||||
$output .= '<div class="tg-post-categories">';
|
||||
foreach ( $categories as $category ) {
|
||||
$color_code = colormag_category_color( get_cat_id( $category->cat_name ) );
|
||||
if ( ! empty( $color_code ) ) {
|
||||
$output .= '<a href="' . get_category_link( $category->term_id ) . '" style="background:' . colormag_category_color( get_cat_id( $category->cat_name ) ) . '" class="tg-post-category" rel="category tag">' . $category->cat_name . '</a>' . $separator;
|
||||
} else {
|
||||
$output .= '<a href="' . get_category_link( $category->term_id ) . '" class="tg-post-category" rel="category tag">' . $category->cat_name . '</a>' . $separator;
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $display == 0 ) {
|
||||
$output = trim( $output, $separator );
|
||||
}
|
||||
if ( $display == 1 ) {
|
||||
echo trim( $output, $separator );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $display == 0 ) {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_custom_css' ) ) :
|
||||
|
||||
/**
|
||||
* Custom CSS code to be rendered for the Elementor plugin
|
||||
*
|
||||
* Hooks in the wp_head hook with priority of 100
|
||||
*
|
||||
* @since ColorMag 2.2.3
|
||||
*/
|
||||
function colormag_elementor_custom_css() {
|
||||
$colormag_internal_elementor_css = '';
|
||||
$primary_color = esc_html( get_theme_mod( 'colormag_primary_color', '#289dcc' ) );
|
||||
|
||||
if ( $primary_color != '#289dcc' ) {
|
||||
$colormag_internal_elementor_css .= '.elementor .tg-module-wrapper .module-title{border-bottom:1px solid ' . $primary_color . '}.elementor .tg-module-wrapper .module-title span,.elementor .tg-module-wrapper .tg-post-category{background-color:' . $primary_color . '}.elementor .tg-module-wrapper .tg-module-meta .tg-module-comments a:hover,.elementor .tg-module-wrapper .tg-module-meta .tg-post-auther-name a:hover,.elementor .tg-module-wrapper .tg-module-meta .tg-post-date a:hover,.elementor .tg-module-wrapper .tg-module-title:hover a,.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info .tg-module-meta a:hover{color:' . $primary_color . '}';
|
||||
}
|
||||
|
||||
if ( ! empty( $colormag_internal_elementor_css ) ) {
|
||||
echo '<!-- ' . get_bloginfo( 'name' ) . ' Elementor Internal Styles -->';
|
||||
?>
|
||||
<style type="text/css"><?php echo esc_html( $colormag_internal_elementor_css ); ?></style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
add_action( 'wp_head', 'colormag_elementor_custom_css', 100 );
|
||||
204
colormag/inc/elementor/elementor.php
Normal file
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
/**
|
||||
* Implements the compatibility for the Elementor plugin in ColorMag theme.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_active_page_check' ) ) :
|
||||
|
||||
/**
|
||||
* Check whether Elementor plugin is activated and is active on current page or not
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_active_page_check() {
|
||||
global $post;
|
||||
|
||||
if ( defined( 'ELEMENTOR_VERSION' ) && get_post_meta( $post->ID, '_elementor_edit_mode', true ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_widget_render_filter' ) ) :
|
||||
|
||||
/**
|
||||
* Render the default WordPress widget settings, ie, divs
|
||||
*
|
||||
* @param $args the widget id
|
||||
*
|
||||
* @return array register sidebar divs
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_widget_render_filter( $args ) {
|
||||
|
||||
return
|
||||
array(
|
||||
'before_widget' => '<section class="widget ' . colormag_widget_class_names( $args[ 'widget_id' ] ) . ' clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
);
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
add_filter( 'elementor/widgets/wordpress/widget_args', 'colormag_elementor_widget_render_filter' ); // WPCS: spelling ok.
|
||||
|
||||
if ( ! function_exists( 'colormag_widget_class_names' ) ) :
|
||||
|
||||
/**
|
||||
* Render the widget classes for Elementor plugin compatibility
|
||||
*
|
||||
* @param $widgets_id the widgets of the id
|
||||
*
|
||||
* @return mixed the widget classes of the id passed
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_widget_class_names( $widgets_id ) {
|
||||
|
||||
$widgets_id = str_replace( 'wp-widget-', '', $widgets_id );
|
||||
|
||||
$classes = colormag_widgets_classes();
|
||||
|
||||
$return_value = isset( $classes[ $widgets_id ] ) ? $classes[ $widgets_id ] : 'widget_featured_posts';
|
||||
|
||||
return $return_value;
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_widgets_classes' ) ) :
|
||||
|
||||
/**
|
||||
* Return all the arrays of widgets classes and classnames of same respectively
|
||||
*
|
||||
* @return array the array of widget classnames and its respective classes
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_widgets_classes() {
|
||||
|
||||
return
|
||||
array(
|
||||
'colormag_featured_posts_slider_widget' => 'widget_featured_slider widget_featured_meta',
|
||||
'colormag_highlighted_posts_widget' => 'widget_highlighted_posts widget_featured_meta',
|
||||
'colormag_featured_posts_widget' => 'widget_featured_posts widget_featured_meta',
|
||||
'colormag_featured_posts_vertical_widget' => 'widget_featured_posts widget_featured_posts_vertical widget_featured_meta',
|
||||
'colormag_728x90_advertisement_widget' => 'widget_300x250_advertisement',
|
||||
'colormag_300x250_advertisement_widget' => 'widget_728x90_advertisement',
|
||||
'colormag_125x125_advertisement_widget' => 'widget_125x125_advertisement',
|
||||
);
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Load the ColorMag Elementor widgets file and registers it
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_elementor_widgets_registered' ) ) :
|
||||
|
||||
/**
|
||||
* Load and register the required Elementor widgets file
|
||||
*
|
||||
* @param $widgets_manager
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_widgets_registered( $widgets_manager ) {
|
||||
|
||||
// Require the files
|
||||
// 1. Block Widgets
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-block-1.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-block-2.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-block-4.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-block-6.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-block-9.php';
|
||||
|
||||
// 2. Grid Widgets
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-grid-2.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-grid-3.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-grid-4.php';
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-widgets-grid-5.php';
|
||||
|
||||
// 3. Global Widgets
|
||||
require COLORMAG_ELEMENTOR_WIDGETS_DIR . '/colormag-elementor-global-widgets-title.php';
|
||||
|
||||
// Register the widgets
|
||||
// 1. Block Widgets
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Block_1() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Block_2() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Block_4() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Block_6() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Block_9() );
|
||||
|
||||
// 2. Grid Widgets
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Grid_2() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Grid_3() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Grid_4() );
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Widgets_Grid_5() );
|
||||
|
||||
// 3. Global Widgets
|
||||
$widgets_manager->register_widget_type( new \Elementor\ColorMag_Elementor_Global_Widgets_Title() );
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
add_action( 'elementor/widgets/widgets_registered', 'colormag_elementor_widgets_registered' );
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_category' ) ) :
|
||||
|
||||
/**
|
||||
* Add the Elementor category for use in ColorMag widgets as seperator
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_category() {
|
||||
|
||||
// Register widget block category for Elementor section
|
||||
\Elementor\Plugin::instance()->elements_manager->add_category( 'colormag-widget-blocks', array(
|
||||
'title' => esc_html__( 'ColorMag Widget Blocks', 'colormag' ),
|
||||
), 1 );
|
||||
|
||||
// Register widget grid category for Elementor section
|
||||
\Elementor\Plugin::instance()->elements_manager->add_category( 'colormag-widget-grid', array(
|
||||
'title' => esc_html__( 'ColorMag Widget Grid', 'colormag' ),
|
||||
), 1 );
|
||||
|
||||
// Register widget global category for Elementor section
|
||||
\Elementor\Plugin::instance()->elements_manager->add_category( 'colormag-widget-global', array(
|
||||
'title' => esc_html__( 'ColorMag Global Widgets', 'colormag' ),
|
||||
), 1 );
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
add_action( 'elementor/init', 'colormag_elementor_category' );
|
||||
|
||||
if ( ! function_exists( 'colormag_elementor_enqueue_style' ) ) :
|
||||
|
||||
/**
|
||||
* Enqueue the styles for use within Elementor only
|
||||
*
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
function colormag_elementor_enqueue_style() {
|
||||
|
||||
// Enqueue the main Elementor CSS file for use with Elementor
|
||||
wp_enqueue_style( 'colormag-elementor', COLORMAG_ELEMENTOR_URL . '/assets/css/elementor.css' );
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
add_action( 'elementor/frontend/after_enqueue_styles', 'colormag_elementor_enqueue_style' );
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Global Widget Title.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Global_Widgets_Title extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Global_Widgets_Title widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Global-Widgets-Title';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Global_Widgets_Title widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Title Widget', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Global_Widgets_Title widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'eicon-type-tool';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Global_Widgets_Title widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-global' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Global_Widgets_Title widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_global_widgets_title_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_global_widgets_title_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Global_Widgets_Title widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-wrapper">
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div><!-- tg-module-title-wrap -->
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Block 1.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Block_1 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_1 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Block-1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_1 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Block Style 1', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_1 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-block-1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Block_1 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-blocks' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Block_1 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_1_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_1_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_1_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 5,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_1_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Block_1 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-block tg-module-block--style-1 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div><!-- tg-module-title-wrap -->
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
|
||||
<?php
|
||||
$featured_image_size = ( $count == 1 ) ? 'colormag-featured-image' : 'colormag-featured-post-small';
|
||||
?>
|
||||
<?php if ( $count == 1 ) : // on first post. ?>
|
||||
<div class="tg-col-control">
|
||||
<div class="tg_module_block">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( $featured_image_size ); ?>
|
||||
</a>
|
||||
<?php colormag_elementor_colored_category(); ?>
|
||||
</figure>
|
||||
<?php
|
||||
else :
|
||||
if ( $count == 1 ) :
|
||||
colormag_elementor_colored_category();
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta ?>
|
||||
<div class="tg-expert entry-content">
|
||||
<?php the_excerpt(); // Displays the post excerpts
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $count == 2 ) : ?>
|
||||
<div class="tg-col-control">
|
||||
<?php endif; ?>
|
||||
<?php if ( $count >= 2 ) : // add grid style after first post. ?>
|
||||
<div class="tg_module_block tg_module_block--list-small">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( $featured_image_size ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<div class="tg-module-info">
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
$count ++;
|
||||
endwhile;
|
||||
?>
|
||||
<?php if ( $count > 2 ) : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Block 2.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Block_2 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_2 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Block-2';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_2 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Block Style 2', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_2 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-block-2';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Block_2 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-blocks' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Block_2 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_2_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_2_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_2_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 2,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_2_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Block_2 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-block tg-module-wrapper tg-module-block--style-2">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row">
|
||||
<?php
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
<div class="tg-col-control">
|
||||
<div class="tg_module_block">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( 'colormag-highlighted-post' ); ?>
|
||||
</a>
|
||||
|
||||
<?php colormag_elementor_colored_category(); ?>
|
||||
</figure>
|
||||
<?php
|
||||
else :
|
||||
colormag_elementor_colored_category();
|
||||
endif;
|
||||
?>
|
||||
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta
|
||||
?>
|
||||
|
||||
<div class="tg-expert entry-content">
|
||||
<?php the_excerpt(); // Displays the post excerpts
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endwhile;
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Block 4.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Block_4 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_4 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Block-4';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_4 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Block Style 4', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_4 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-block-4';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Block_4 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-blocks' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Block_4 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_4_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_4_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_4_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 5,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_4_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Block_4 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-block tg-module-block--style-4 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
<?php
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
<div class="tg_module_block tg-row">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb tg-col-control">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( 'colormag-highlighted-post' ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-module-info tg-col-control">
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta
|
||||
?>
|
||||
|
||||
<div class="tg-excerpt entry-content">
|
||||
<?php the_excerpt(); // Displays the post excerpts
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endwhile;
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Block 6.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Block_6 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_6 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Block-6';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_6 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Block Style 6', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_6 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-block-6';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Block_6 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-blocks' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Block_6 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_6_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_6_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_6_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 6,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_6_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Block_6 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-block tg-module-block--style-6 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
<div class="tg-row">
|
||||
<?php
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
<div class="tg_module_block tg_module_block--list-small tg-col-control">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( 'colormag-featured-post-small' ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-module-info">
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta.
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endwhile;
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Block 9.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Block_9 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_9 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Block-9';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_9 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Block Style 9', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Block_9 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-block-9';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Block_9 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-blocks' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Block_9 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_9_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_9_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_9_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 6,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_block_9_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Block_9 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-block tg-module-block--style-9 no-module-thub tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row">
|
||||
<?php
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
<div class="tg_module_block tg_module_block--list-small no-thumbnail tg-col-control">
|
||||
<div class="tg-module-info">
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endwhile;
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Grid 2.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Grid_2 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_2 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Grid-2';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_2 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Grid Style 2', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_2 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-grid-2';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Grid_2 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-grid' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Grid_2 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_2_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_2_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_2_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 4,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_2_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Grid_2 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-grid tg-module-grid--style-2 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row thinner">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
|
||||
<?php
|
||||
$thumbnail_image_size = 'colormag-highlighted-post';
|
||||
$main_div_loop_wrapper_class = 'tg_module_grid tg_module_grid--small tg_module_grid--half tg-col-control';
|
||||
|
||||
if ( $count == 1 ) {
|
||||
|
||||
$thumbnail_image_size = 'colormag-elementor-grid-large-thumbnail';
|
||||
$main_div_loop_wrapper_class = 'tg_module_grid tg_module_grid--full';
|
||||
|
||||
} else if ( $count == 2 ) {
|
||||
|
||||
$thumbnail_image_size = 'colormag-elementor-grid-medium-large-thumbnail';
|
||||
$main_div_loop_wrapper_class = 'tg_module_grid tg_module_grid--small tg_module_grid--full tg-col-control';
|
||||
|
||||
}
|
||||
|
||||
if ( ( $count == 1 ) || ( $count == 2 ) ) :
|
||||
echo '<div class="tg-col-control">';
|
||||
endif;
|
||||
if ( $count == 2 ) :
|
||||
echo '<div class="tg-row thinner">';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr( $main_div_loop_wrapper_class ); ?>">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( $thumbnail_image_size ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-module-info">
|
||||
<?php colormag_elementor_colored_category(); ?>
|
||||
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( $count == 1 ) :
|
||||
echo '</div>';
|
||||
endif;
|
||||
|
||||
$count ++;
|
||||
endwhile;
|
||||
|
||||
if ( $count > 2 ) {
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Grid 3.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Grid_3 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_3 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Grid-3';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_3 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Grid Style 3', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_3 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-grid-3';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Grid_3 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-grid' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Grid_3 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_3_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_3_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_3_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 2,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_3_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Grid_3 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-grid tg-module-grid--style-3 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row thinner">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
|
||||
<?php
|
||||
$custom_class = ( ( $count % 2 ) == 1 ) ? 'tg_module_grid' : 'tg_module_grid';
|
||||
?>
|
||||
|
||||
<div class="tg-col-control">
|
||||
<div class="<?php echo esc_attr( $custom_class ); ?>">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( 'colormag-elementor-grid-large-thumbnail' ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-module-info">
|
||||
<?php colormag_elementor_colored_category(); ?>
|
||||
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$count ++;
|
||||
endwhile;
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Grid 4.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Grid_4 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_4 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Grid-4';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_4 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Grid Style 4', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_4 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-grid-4';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Grid_4 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-grid' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Grid_4 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_4_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_4_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_4_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 3,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_4_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Grid_4 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-grid tg-module-grid--style-4 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row thinner">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
|
||||
<div class="tg-col-control">
|
||||
<div class="tg_module_grid tg_module_grid--medium">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( 'colormag-highlighted-post' ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-module-info">
|
||||
<?php colormag_elementor_colored_category(); ?>
|
||||
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$count ++;
|
||||
endwhile;
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag Elementor Widget Grid 5.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.2.3
|
||||
*/
|
||||
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return; // Exit if it is accessed directly
|
||||
}
|
||||
|
||||
class ColorMag_Elementor_Widgets_Grid_5 extends Widget_Base {
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_5 widget name.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'ColorMag-Posts-Grid-5';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_5 widget title.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget title.
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Grid Style 5', 'colormag' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ColorMag_Elementor_Widgets_Grid_5 widget icon.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return string Widget icon.
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'colormag-econs-grid-5';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories the ColorMag_Elementor_Widgets_Grid_5 widget belongs to.
|
||||
*
|
||||
* Used to determine where to display the widget in the editor.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget categories.
|
||||
*/
|
||||
public function get_categories() {
|
||||
return array( 'colormag-widget-grid' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ColorMag_Elementor_Widgets_Grid_5 widget controls.
|
||||
*
|
||||
* Adds different input fields to allow the user to change and customize the widget settings.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function _register_controls() {
|
||||
|
||||
// Widget title section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_5_title_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Block Title', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title',
|
||||
array(
|
||||
'label' => esc_html__( 'Title:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Add your custom block title', 'colormag' ),
|
||||
'label_block' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget design section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_5_design_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Widget Title', 'colormag' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#289dcc',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title' => 'border-bottom-color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'widget_title_text_color',
|
||||
array(
|
||||
'label' => esc_html__( 'Text Color:', 'colormag' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'scheme' => array(
|
||||
'type' => Scheme_Color::get_type(),
|
||||
'value' => Scheme_Color::COLOR_1,
|
||||
),
|
||||
'selectors' => array(
|
||||
'{{WRAPPER}} .tg-module-wrapper .module-title span' => 'color: {{VALUE}}',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget posts section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_5_posts_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Posts', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Number of posts to display:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => 4,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'offset_posts_number',
|
||||
array(
|
||||
'label' => esc_html__( 'Offset Posts:', 'colormag' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Widget filter section
|
||||
$this->start_controls_section(
|
||||
'section_colormag_featured_posts_grid_5_filter_manage',
|
||||
array(
|
||||
'label' => esc_html__( 'Filter', 'colormag' ),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'display_type',
|
||||
array(
|
||||
'label' => esc_html__( 'Display the posts from:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'latest',
|
||||
'options' => array(
|
||||
'latest' => esc_html__( 'Latest Posts', 'colormag' ),
|
||||
'categories' => esc_html__( 'Categories', 'colormag' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'categories_selected',
|
||||
array(
|
||||
'label' => esc_html__( 'Select categories:', 'colormag' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => colormag_elementor_categories(),
|
||||
'condition' => array(
|
||||
'display_type' => 'categories',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render ColorMag_Elementor_Widgets_Grid_5 widget output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render() {
|
||||
|
||||
$posts_number = $this->get_settings( 'posts_number' );
|
||||
$display_type = $this->get_settings( 'display_type' );
|
||||
$offset_posts_number = $this->get_settings( 'offset_posts_number' );
|
||||
$categories_selected = $this->get_settings( 'categories_selected' );
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $posts_number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from the category selected
|
||||
if ( 'categories' == $display_type ) {
|
||||
$args[ 'category__in' ] = $categories_selected;
|
||||
}
|
||||
|
||||
// Offset the posts
|
||||
if ( ! empty( $offset_posts_number ) ) {
|
||||
$args[ 'offset' ] = $offset_posts_number;
|
||||
}
|
||||
|
||||
// Start the WP_Query Object/Class
|
||||
$get_featured_posts = new \WP_Query( $args );
|
||||
?>
|
||||
|
||||
<div class="tg-module-grid tg-module-grid--style-5 tg-module-wrapper">
|
||||
<?php
|
||||
$widget_title = $this->get_settings( 'widget_title' );
|
||||
if ( ! empty( $widget_title ) ) : ?>
|
||||
<div class="tg-module-title-wrap">
|
||||
<h4 class="module-title">
|
||||
<span><?php echo $this->get_settings( 'widget_title' ); ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-row thinner">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $get_featured_posts->have_posts() ) :
|
||||
$get_featured_posts->the_post(); ?>
|
||||
|
||||
<div class="tg-col-control">
|
||||
<div class="tg_module_grid tg_module_grid--small-medium ">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) : ?>
|
||||
<figure class="tg-module-thumb">
|
||||
<a href="<?php the_permalink(); ?>" class="tg-thumb-link">
|
||||
<?php the_post_thumbnail( 'colormag-elementor-grid-small-thumbnail' ); ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endif;
|
||||
?>
|
||||
|
||||
<div class="tg-module-info">
|
||||
<?php colormag_elementor_colored_category(); ?>
|
||||
|
||||
<h3 class="tg-module-title entry-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php colormag_elementor_widgets_meta(); // Displays the entry meta
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$count ++;
|
||||
endwhile;
|
||||
|
||||
// Reset the postdata
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
924
colormag/inc/functions.php
Normal file
@@ -0,0 +1,924 @@
|
||||
<?php
|
||||
/**
|
||||
* ColorMag functions and definitions
|
||||
*
|
||||
* This file contains all the functions and it's defination that particularly can't be
|
||||
* in other files.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.0
|
||||
*/
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'colormag_scripts_styles_method' );
|
||||
/**
|
||||
* Register jquery scripts
|
||||
*/
|
||||
function colormag_scripts_styles_method() {
|
||||
/**
|
||||
* Using google font
|
||||
*/
|
||||
wp_enqueue_style( 'colormag_google_fonts', '//fonts.googleapis.com/css?family=Open+Sans:400,600' );
|
||||
|
||||
/**
|
||||
* Loads our main stylesheet.
|
||||
*/
|
||||
wp_enqueue_style( 'colormag_style', get_stylesheet_uri() );
|
||||
|
||||
/**
|
||||
* Load the dark color skin via theme options
|
||||
*/
|
||||
if ( get_theme_mod( 'colormag_color_skin_setting', 'white' ) == 'dark' ) {
|
||||
wp_enqueue_style( 'colormag_dark_style', get_template_directory_uri() . '/dark.css' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds JavaScript to pages with the comment form to support
|
||||
* sites with threaded comments (when in use).
|
||||
*/
|
||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue bxSlider js file for slider.
|
||||
*/
|
||||
wp_enqueue_script( 'colormag-bxslider', COLORMAG_JS_URL . '/jquery.bxslider.min.js', array( 'jquery' ), '4.2.10', true );
|
||||
|
||||
wp_enqueue_script( 'colormag-navigation', COLORMAG_JS_URL . '/navigation.js', array( 'jquery' ), false, true );
|
||||
|
||||
wp_enqueue_style( 'colormag-fontawesome', get_template_directory_uri() . '/fontawesome/css/font-awesome.css', array(), '4.2.1' );
|
||||
|
||||
if ( get_theme_mod( 'colormag_breaking_news', 0 ) == 1 ) {
|
||||
wp_enqueue_script( 'colormag-news-ticker', COLORMAG_JS_URL . '/news-ticker/jquery.newsTicker.min.js', array( 'jquery' ), '1.0.0', true );
|
||||
}
|
||||
|
||||
if ( get_theme_mod( 'colormag_primary_sticky_menu', 0 ) == 1 ) {
|
||||
wp_enqueue_script( 'colormag-sticky-menu', COLORMAG_JS_URL . '/sticky/jquery.sticky.js', array( 'jquery' ), '20150309', true );
|
||||
}
|
||||
|
||||
if ( get_theme_mod( 'colormag_featured_image_popup', 0 ) == 1 ) {
|
||||
wp_enqueue_script( 'colormag-featured-image-popup', COLORMAG_JS_URL . '/magnific-popup/jquery.magnific-popup.min.js', array( 'jquery' ), '20150310', true );
|
||||
|
||||
wp_enqueue_style( 'colormag-featured-image-popup-css', COLORMAG_JS_URL . '/magnific-popup/magnific-popup.css', array(), '20150310' );
|
||||
}
|
||||
|
||||
wp_enqueue_script( 'colormag-fitvids', COLORMAG_JS_URL . '/fitvids/jquery.fitvids.js', array( 'jquery' ), '20150311', true );
|
||||
|
||||
wp_enqueue_script( 'html5', COLORMAG_JS_URL . '/html5shiv.min.js' );
|
||||
wp_script_add_data( 'html5', 'conditional', 'lte IE 8' );
|
||||
|
||||
// Skip link focus fix JS enqueue.
|
||||
wp_enqueue_script( 'colormag-skip-link-focus-fix', COLORMAG_JS_URL . '/skip-link-focus-fix.js', array(), false, true );
|
||||
|
||||
wp_enqueue_script( 'colormag-custom', COLORMAG_JS_URL . '/colormag-custom.js', array( 'jquery' ), false, true );
|
||||
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', 'colormag_image_uploader' );
|
||||
function colormag_image_uploader() {
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'colormag-widget-image-upload', COLORMAG_JS_URL . '/image-uploader.js', false, '20150309', true );
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
add_filter( 'excerpt_length', 'colormag_excerpt_length' );
|
||||
/**
|
||||
* Sets the post excerpt length to 40 words.
|
||||
*
|
||||
* function tied to the excerpt_length filter hook.
|
||||
*
|
||||
* @uses filter excerpt_length
|
||||
*/
|
||||
function colormag_excerpt_length( $length ) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
add_filter( 'excerpt_more', 'colormag_continue_reading' );
|
||||
/**
|
||||
* Returns a "Continue Reading" link for excerpts
|
||||
*/
|
||||
function colormag_continue_reading() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
/**
|
||||
* Removing the default style of wordpress gallery
|
||||
*/
|
||||
add_filter( 'use_default_gallery_style', '__return_false' );
|
||||
|
||||
/**
|
||||
* Filtering the size to be full from thumbnail to be used in WordPress gallery as a default size
|
||||
*/
|
||||
function colormag_gallery_atts( $out, $pairs, $atts ) {
|
||||
$atts = shortcode_atts( array(
|
||||
'size' => 'colormag-featured-image',
|
||||
), $atts );
|
||||
|
||||
$out['size'] = $atts['size'];
|
||||
|
||||
return $out;
|
||||
|
||||
}
|
||||
|
||||
add_filter( 'shortcode_atts_gallery', 'colormag_gallery_atts', 10, 3 );
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
add_filter( 'body_class', 'colormag_body_class' );
|
||||
/**
|
||||
* Filter the body_class
|
||||
*
|
||||
* Throwing different body class for the different layouts in the body tag
|
||||
*/
|
||||
function colormag_body_class( $classes ) {
|
||||
global $post;
|
||||
|
||||
if ( $post ) {
|
||||
$layout_meta = get_post_meta( $post->ID, 'colormag_page_layout', true );
|
||||
}
|
||||
|
||||
if ( is_home() ) {
|
||||
$queried_id = get_option( 'page_for_posts' );
|
||||
$layout_meta = get_post_meta( $queried_id, 'colormag_page_layout', true );
|
||||
}
|
||||
if ( empty( $layout_meta ) || is_archive() || is_search() ) {
|
||||
$layout_meta = 'default_layout';
|
||||
}
|
||||
$colormag_default_layout = get_theme_mod( 'colormag_default_layout', 'right_sidebar' );
|
||||
|
||||
$colormag_default_page_layout = get_theme_mod( 'colormag_default_page_layout', 'right_sidebar' );
|
||||
$colormag_default_post_layout = get_theme_mod( 'colormag_default_single_posts_layout', 'right_sidebar' );
|
||||
|
||||
if ( $layout_meta == 'default_layout' ) {
|
||||
if ( is_page() ) {
|
||||
if ( $colormag_default_page_layout == 'right_sidebar' ) {
|
||||
$classes[] = '';
|
||||
} elseif ( $colormag_default_page_layout == 'left_sidebar' ) {
|
||||
$classes[] = 'left-sidebar';
|
||||
} elseif ( $colormag_default_page_layout == 'no_sidebar_full_width' ) {
|
||||
$classes[] = 'no-sidebar-full-width';
|
||||
} elseif ( $colormag_default_page_layout == 'no_sidebar_content_centered' ) {
|
||||
$classes[] = 'no-sidebar';
|
||||
}
|
||||
} elseif ( is_single() ) {
|
||||
if ( $colormag_default_post_layout == 'right_sidebar' ) {
|
||||
$classes[] = '';
|
||||
} elseif ( $colormag_default_post_layout == 'left_sidebar' ) {
|
||||
$classes[] = 'left-sidebar';
|
||||
} elseif ( $colormag_default_post_layout == 'no_sidebar_full_width' ) {
|
||||
$classes[] = 'no-sidebar-full-width';
|
||||
} elseif ( $colormag_default_post_layout == 'no_sidebar_content_centered' ) {
|
||||
$classes[] = 'no-sidebar';
|
||||
}
|
||||
} elseif ( $colormag_default_layout == 'right_sidebar' ) {
|
||||
$classes[] = '';
|
||||
} elseif ( $colormag_default_layout == 'left_sidebar' ) {
|
||||
$classes[] = 'left-sidebar';
|
||||
} elseif ( $colormag_default_layout == 'no_sidebar_full_width' ) {
|
||||
$classes[] = 'no-sidebar-full-width';
|
||||
} elseif ( $colormag_default_layout == 'no_sidebar_content_centered' ) {
|
||||
$classes[] = 'no-sidebar';
|
||||
}
|
||||
} elseif ( $layout_meta == 'right_sidebar' ) {
|
||||
$classes[] = '';
|
||||
} elseif ( $layout_meta == 'left_sidebar' ) {
|
||||
$classes[] = 'left-sidebar';
|
||||
} elseif ( $layout_meta == 'no_sidebar_full_width' ) {
|
||||
$classes[] = 'no-sidebar-full-width';
|
||||
} elseif ( $layout_meta == 'no_sidebar_content_centered' ) {
|
||||
$classes[] = 'no-sidebar';
|
||||
}
|
||||
|
||||
if ( get_theme_mod( 'colormag_site_layout', 'wide_layout' ) == 'wide_layout' ) {
|
||||
$classes[] = 'wide';
|
||||
} elseif ( get_theme_mod( 'colormag_site_layout', 'wide_layout' ) == 'boxed_layout' ) {
|
||||
$classes[] = '';
|
||||
}
|
||||
|
||||
if ( get_theme_mod( 'colormag_responsive_menu', 0 ) == 1 ) {
|
||||
$classes[] = 'better-responsive-menu';
|
||||
}
|
||||
|
||||
// Add body class for body skin type
|
||||
if ( get_theme_mod( 'colormag_color_skin_setting', 'white' ) == 'dark' ) {
|
||||
$classes[] = 'dark-skin';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
if ( ! function_exists( 'colormag_sidebar_select' ) ) :
|
||||
/**
|
||||
* Function to select the sidebar
|
||||
*/
|
||||
function colormag_sidebar_select() {
|
||||
global $post;
|
||||
|
||||
if ( $post ) {
|
||||
$layout_meta = get_post_meta( $post->ID, 'colormag_page_layout', true );
|
||||
}
|
||||
|
||||
if ( is_home() ) {
|
||||
$queried_id = get_option( 'page_for_posts' );
|
||||
$layout_meta = get_post_meta( $queried_id, 'colormag_page_layout', true );
|
||||
}
|
||||
|
||||
if ( empty( $layout_meta ) || is_archive() || is_search() ) {
|
||||
$layout_meta = 'default_layout';
|
||||
}
|
||||
$colormag_default_layout = get_theme_mod( 'colormag_default_layout', 'right_sidebar' );
|
||||
|
||||
$colormag_default_page_layout = get_theme_mod( 'colormag_default_page_layout', 'right_sidebar' );
|
||||
$colormag_default_post_layout = get_theme_mod( 'colormag_default_single_posts_layout', 'right_sidebar' );
|
||||
|
||||
if ( $layout_meta == 'default_layout' ) {
|
||||
if ( is_page() ) {
|
||||
if ( $colormag_default_page_layout == 'right_sidebar' ) {
|
||||
get_sidebar();
|
||||
} elseif ( $colormag_default_page_layout == 'left_sidebar' ) {
|
||||
get_sidebar( 'left' );
|
||||
}
|
||||
}
|
||||
if ( is_single() ) {
|
||||
if ( $colormag_default_post_layout == 'right_sidebar' ) {
|
||||
get_sidebar();
|
||||
} elseif ( $colormag_default_post_layout == 'left_sidebar' ) {
|
||||
get_sidebar( 'left' );
|
||||
}
|
||||
} elseif ( $colormag_default_layout == 'right_sidebar' ) {
|
||||
get_sidebar();
|
||||
} elseif ( $colormag_default_layout == 'left_sidebar' ) {
|
||||
get_sidebar( 'left' );
|
||||
}
|
||||
} elseif ( $layout_meta == 'right_sidebar' ) {
|
||||
get_sidebar();
|
||||
} elseif ( $layout_meta == 'left_sidebar' ) {
|
||||
get_sidebar( 'left' );
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
if ( ! function_exists( 'colormag_entry_meta' ) ) :
|
||||
/**
|
||||
* Shows meta information of post.
|
||||
*/
|
||||
function colormag_entry_meta() {
|
||||
if ( 'post' == get_post_type() ) :
|
||||
echo '<div class="below-entry-meta">';
|
||||
?>
|
||||
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ),
|
||||
esc_url( get_permalink() ),
|
||||
esc_attr( get_the_time() ),
|
||||
$time_string
|
||||
); ?>
|
||||
|
||||
<span class="byline">
|
||||
<span class="author vcard">
|
||||
<i class="fa fa-user"></i>
|
||||
<a class="url fn n"
|
||||
href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"
|
||||
title="<?php echo get_the_author(); ?>"><?php echo esc_html( get_the_author() ); ?>
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<?php
|
||||
if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="comments"><?php comments_popup_link( __( '<i class="fa fa-comment"></i> 0 Comments', 'colormag' ), __( '<i class="fa fa-comment"></i> 1 Comment', 'colormag' ), __( '<i class="fa fa-comments"></i> % Comments', 'colormag' ) ); ?></span>
|
||||
<?php }
|
||||
$tags_list = get_the_tag_list( '<span class="tag-links"><i class="fa fa-tags"></i>', __( ', ', 'colormag' ), '</span>' );
|
||||
if ( $tags_list ) {
|
||||
echo $tags_list;
|
||||
}
|
||||
|
||||
edit_post_link( __( 'Edit', 'colormag' ), '<span class="edit-link"><i class="fa fa-edit"></i>', '</span>' );
|
||||
|
||||
echo '</div>';
|
||||
endif;
|
||||
}
|
||||
endif;
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
/**
|
||||
* Generate darker color
|
||||
* Source: http://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php
|
||||
*/
|
||||
function colormag_darkcolor( $hex, $steps ) {
|
||||
// Steps should be between -255 and 255. Negative = darker, positive = lighter
|
||||
$steps = max( - 255, min( 255, $steps ) );
|
||||
|
||||
// Normalize into a six character long hex string
|
||||
$hex = str_replace( '#', '', $hex );
|
||||
if ( strlen( $hex ) == 3 ) {
|
||||
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
|
||||
}
|
||||
|
||||
// Split into three parts: R, G and B
|
||||
$color_parts = str_split( $hex, 2 );
|
||||
$return = '#';
|
||||
|
||||
foreach ( $color_parts as $color ) {
|
||||
$color = hexdec( $color ); // Convert to decimal
|
||||
$color = max( 0, min( 255, $color + $steps ) ); // Adjust color
|
||||
$return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
add_action( 'wp_head', 'colormag_custom_css', 100 );
|
||||
/**
|
||||
* Hooks the Custom Internal CSS to head section
|
||||
*/
|
||||
function colormag_custom_css() {
|
||||
$colormag_internal_css = '';
|
||||
$primary_color = get_theme_mod( 'colormag_primary_color', '#289dcc' );
|
||||
$primary_dark = colormag_darkcolor( $primary_color, - 30 );
|
||||
if ( $primary_color != '#289dcc' ) {
|
||||
$colormag_internal_css .= ' .colormag-button,blockquote,button,input[type=reset],input[type=button],input[type=submit],
|
||||
#masthead.colormag-header-clean #site-navigation.main-small-navigation .menu-toggle{background-color:' . $primary_color . '}
|
||||
#site-title a,.next a:hover,.previous a:hover,.social-links i.fa:hover,a,
|
||||
#masthead.colormag-header-clean .social-links li:hover i.fa,
|
||||
#masthead.colormag-header-classic .social-links li:hover i.fa,
|
||||
#masthead.colormag-header-clean .breaking-news .newsticker a:hover,
|
||||
#masthead.colormag-header-classic .breaking-news .newsticker a:hover,
|
||||
#masthead.colormag-header-classic #site-navigation .fa.search-top:hover,
|
||||
#masthead.colormag-header-classic #site-navigation.main-navigation .random-post a:hover .fa-random,
|
||||
.dark-skin #masthead.colormag-header-classic #site-navigation.main-navigation .home-icon:hover .fa,
|
||||
#masthead .main-small-navigation li:hover > .sub-toggle i,
|
||||
.better-responsive-menu #masthead .main-small-navigation .sub-toggle.active .fa {color:' . $primary_color . '}
|
||||
.fa.search-top:hover,
|
||||
#masthead.colormag-header-classic #site-navigation.main-small-navigation .menu-toggle,
|
||||
.main-navigation ul li.focus > a,
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.focus > a {background-color:' . $primary_color . '}
|
||||
#site-navigation{border-top:4px solid ' . $primary_color . '}
|
||||
.home-icon.front_page_on,.main-navigation a:hover,.main-navigation ul li ul li a:hover,
|
||||
.main-navigation ul li ul li:hover>a,
|
||||
.main-navigation ul li.current-menu-ancestor>a,
|
||||
.main-navigation ul li.current-menu-item ul li a:hover,
|
||||
.main-navigation ul li.current-menu-item>a,
|
||||
.main-navigation ul li.current_page_ancestor>a,
|
||||
.main-navigation ul li.current_page_item>a,
|
||||
.main-navigation ul li:hover>a,
|
||||
.main-small-navigation li a:hover,
|
||||
.site-header .menu-toggle:hover,
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li:hover > a,
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-ancestor > a,
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-item > a,
|
||||
#masthead .main-small-navigation li:hover > a,
|
||||
#masthead .main-small-navigation li.current-page-ancestor > a,
|
||||
#masthead .main-small-navigation li.current-menu-ancestor > a,
|
||||
#masthead .main-small-navigation li.current-page-item > a,
|
||||
#masthead .main-small-navigation li.current-menu-item > a{background-color:' . $primary_color . '}
|
||||
#masthead.colormag-header-classic .main-navigation .home-icon a:hover .fa { color:' . $primary_color . '}
|
||||
.main-small-navigation .current-menu-item>a,.main-small-navigation .current_page_item>a {background:' . $primary_color . '}
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li:hover,
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-ancestor,
|
||||
#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-item,
|
||||
#masthead.colormag-header-classic #site-navigation .menu-toggle,
|
||||
#masthead.colormag-header-classic #site-navigation .menu-toggle:hover,
|
||||
#masthead.colormag-header-classic .main-navigation ul > li:hover > a,
|
||||
#masthead.colormag-header-classic .main-navigation ul > li.current-menu-item > a,
|
||||
#masthead.colormag-header-classic .main-navigation ul > li.current-menu-ancestor > a,
|
||||
#masthead.colormag-header-classic .main-navigation ul li.focus > a{ border-color:' . $primary_color . '}
|
||||
.promo-button-area a:hover{border:2px solid ' . $primary_color . ';background-color:' . $primary_color . '}
|
||||
#content .wp-pagenavi .current,
|
||||
#content .wp-pagenavi a:hover,.format-link .entry-content a,.pagination span{ background-color:' . $primary_color . '}
|
||||
.pagination a span:hover{color:' . $primary_color . ';border-color:' . $primary_color . '}
|
||||
#content .comments-area a.comment-edit-link:hover,#content .comments-area a.comment-permalink:hover,
|
||||
#content .comments-area article header cite a:hover,.comments-area .comment-author-link a:hover{color:' . $primary_color . '}
|
||||
.comments-area .comment-author-link span{background-color:' . $primary_color . '}
|
||||
.comment .comment-reply-link:hover,.nav-next a,.nav-previous a{color:' . $primary_color . '}
|
||||
#secondary .widget-title{border-bottom:2px solid ' . $primary_color . '}
|
||||
#secondary .widget-title span{background-color:' . $primary_color . '}
|
||||
.footer-widgets-area .widget-title{border-bottom:2px solid ' . $primary_color . '}
|
||||
.footer-widgets-area .widget-title span,
|
||||
.colormag-footer--classic .footer-widgets-area .widget-title span::before{background-color:' . $primary_color . '}
|
||||
.footer-widgets-area a:hover{color:' . $primary_color . '}
|
||||
.advertisement_above_footer .widget-title{ border-bottom:2px solid ' . $primary_color . '}
|
||||
.advertisement_above_footer .widget-title span{background-color:' . $primary_color . '}
|
||||
a#scroll-up i{color:' . $primary_color . '}
|
||||
.page-header .page-title{border-bottom:2px solid ' . $primary_color . '}
|
||||
#content .post .article-content .above-entry-meta .cat-links a,
|
||||
.page-header .page-title span{ background-color:' . $primary_color . '}
|
||||
#content .post .article-content .entry-title a:hover,
|
||||
.entry-meta .byline i,.entry-meta .cat-links i,.entry-meta a,
|
||||
.post .entry-title a:hover,.search .entry-title a:hover{color:' . $primary_color . '}
|
||||
.entry-meta .post-format i{background-color:' . $primary_color . '}
|
||||
.entry-meta .comments-link a:hover,.entry-meta .edit-link a:hover,.entry-meta .posted-on a:hover,
|
||||
.entry-meta .tag-links a:hover,.single #content .tags a:hover{color:' . $primary_color . '}.more-link,
|
||||
.no-post-thumbnail{background-color:' . $primary_color . '}
|
||||
.post-box .entry-meta .cat-links a:hover,.post-box .entry-meta .posted-on a:hover,
|
||||
.post.post-box .entry-title a:hover{color:' . $primary_color . '}
|
||||
.widget_featured_slider .slide-content .above-entry-meta .cat-links a{background-color:' . $primary_color . '}
|
||||
.widget_featured_slider .slide-content .below-entry-meta .byline a:hover,
|
||||
.widget_featured_slider .slide-content .below-entry-meta .comments a:hover,
|
||||
.widget_featured_slider .slide-content .below-entry-meta .posted-on a:hover,
|
||||
.widget_featured_slider .slide-content .entry-title a:hover{color:' . $primary_color . '}
|
||||
.widget_highlighted_posts .article-content .above-entry-meta .cat-links a {background-color:' . $primary_color . '}
|
||||
.byline a:hover,.comments a:hover,.edit-link a:hover,.posted-on a:hover,.tag-links a:hover,
|
||||
.widget_highlighted_posts .article-content .below-entry-meta .byline a:hover,
|
||||
.widget_highlighted_posts .article-content .below-entry-meta .comments a:hover,
|
||||
.widget_highlighted_posts .article-content .below-entry-meta .posted-on a:hover,
|
||||
.widget_highlighted_posts .article-content .entry-title a:hover{color:' . $primary_color . '}
|
||||
.widget_featured_posts .article-content .above-entry-meta .cat-links a{background-color:' . $primary_color . '}
|
||||
.widget_featured_posts .article-content .entry-title a:hover{color:' . $primary_color . '}
|
||||
.widget_featured_posts .widget-title{border-bottom:2px solid ' . $primary_color . '}
|
||||
.widget_featured_posts .widget-title span{background-color:' . $primary_color . '}
|
||||
.related-posts-main-title .fa,.single-related-posts .article-content .entry-title a:hover{color:' . $primary_color . '} .widget_slider_area .widget-title,.widget_beside_slider .widget-title { border-bottom:2px solid ' . $primary_color . '} .widget_slider_area .widget-title span,.widget_beside_slider .widget-title span { background-color:' . $primary_color . '}
|
||||
@media (max-width: 768px) {.better-responsive-menu .sub-toggle{background-color:' . $primary_dark . '}}';
|
||||
}
|
||||
|
||||
if ( ! empty( $colormag_internal_css ) ) {
|
||||
echo '<!-- ' . get_bloginfo( 'name' ) . ' Internal Styles -->';
|
||||
?>
|
||||
<style type="text/css"><?php echo $colormag_internal_css; ?></style>
|
||||
<?php
|
||||
}
|
||||
|
||||
$colormag_custom_css = get_theme_mod( 'colormag_custom_css' );
|
||||
if ( $colormag_custom_css && ! function_exists( 'wp_update_custom_css_post' ) ) {
|
||||
echo '<!-- ' . get_bloginfo( 'name' ) . ' Custom Styles -->';
|
||||
?>
|
||||
<style type="text/css"><?php echo $colormag_custom_css; ?></style><?php
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
add_filter( 'the_content_more_link', 'colormag_remove_more_jump_link' );
|
||||
/**
|
||||
* Removing the more link jumping to middle of content
|
||||
*/
|
||||
function colormag_remove_more_jump_link( $link ) {
|
||||
$offset = strpos( $link, '#more-' );
|
||||
if ( $offset ) {
|
||||
$end = strpos( $link, '"', $offset );
|
||||
}
|
||||
if ( $end ) {
|
||||
$link = substr_replace( $link, '', $offset, $end - $offset );
|
||||
}
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
if ( ! function_exists( 'colormag_content_nav' ) ) :
|
||||
/**
|
||||
* Display navigation to next/previous pages when applicable
|
||||
*/
|
||||
function colormag_content_nav( $nav_id ) {
|
||||
global $wp_query, $post;
|
||||
|
||||
// Don't print empty markup on single pages if there's nowhere to navigate.
|
||||
if ( is_single() ) {
|
||||
$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
|
||||
$next = get_adjacent_post( false, '', false );
|
||||
|
||||
if ( ! $next && ! $previous ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't print empty markup in archives if there's only one page.
|
||||
if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation';
|
||||
|
||||
?>
|
||||
<nav role="navigation" id="<?php echo esc_attr( $nav_id ); ?>" class="<?php echo $nav_class; ?>">
|
||||
<h3 class="screen-reader-text"><?php _e( 'Post navigation', 'colormag' ); ?></h3>
|
||||
|
||||
<?php if ( is_single() ) : // navigation links for single posts ?>
|
||||
|
||||
<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'colormag' ) . '</span> %title' ); ?>
|
||||
<?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'colormag' ) . '</span>' ); ?>
|
||||
|
||||
<?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
|
||||
|
||||
<?php if ( get_next_posts_link() ) : ?>
|
||||
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'colormag' ) ); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( get_previous_posts_link() ) : ?>
|
||||
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'colormag' ) ); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</nav><!-- #<?php echo esc_html( $nav_id ); ?> -->
|
||||
<?php
|
||||
}
|
||||
endif; // colormag_content_nav
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
add_action( 'colormag_footer_copyright', 'colormag_footer_copyright', 10 );
|
||||
/**
|
||||
* function to show the footer info, copyright information
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_footer_copyright' ) ) :
|
||||
function colormag_footer_copyright() {
|
||||
$site_link = '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" ><span>' . get_bloginfo( 'name', 'display' ) . '</span></a>';
|
||||
|
||||
$wp_link = '<a href="https://wordpress.org" target="_blank" title="' . esc_attr__( 'WordPress', 'colormag' ) . '"><span>' . __( 'WordPress', 'colormag' ) . '</span></a>';
|
||||
|
||||
$tg_link = '<a href="https://themegrill.com/themes/colormag" target="_blank" title="' . esc_attr__( 'ThemeGrill', 'colormag' ) . '" rel="author"><span>' . __( 'ThemeGrill', 'colormag' ) . '</span></a>';
|
||||
|
||||
$default_footer_value = sprintf( __( 'Copyright © %1$s %2$s. All rights reserved.', 'colormag' ), date( 'Y' ), $site_link ) . '<br>' . sprintf( __( 'Theme: %1$s by %2$s.', 'colormag' ), 'ColorMag', $tg_link ) . ' ' . sprintf( __( 'Powered by %s.', 'colormag' ), $wp_link );
|
||||
|
||||
$colormag_footer_copyright = '<div class="copyright">' . $default_footer_value . '</div>';
|
||||
echo $colormag_footer_copyright;
|
||||
}
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Category Color Options
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_category_color' ) ) :
|
||||
function colormag_category_color( $wp_category_id ) {
|
||||
$args = array(
|
||||
'orderby' => 'id',
|
||||
'hide_empty' => 0,
|
||||
);
|
||||
$category = get_categories( $args );
|
||||
foreach ( $category as $category_list ) {
|
||||
$color = get_theme_mod( 'colormag_category_color_' . $wp_category_id );
|
||||
|
||||
return $color;
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Breaking News/Latest Posts ticker section in the header
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_breaking_news' ) ) :
|
||||
function colormag_breaking_news() {
|
||||
$post_status = 'publish';
|
||||
if ( get_option( 'fresh_site' ) == 1 ) {
|
||||
$post_status = array( 'auto-draft', 'publish' );
|
||||
}
|
||||
|
||||
$get_featured_posts = new WP_Query( array(
|
||||
'posts_per_page' => 5,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'post_status' => $post_status,
|
||||
) );
|
||||
?>
|
||||
<div class="breaking-news">
|
||||
<strong class="breaking-news-latest"><?php _e( 'Latest:', 'colormag' ); ?></strong>
|
||||
<ul class="newsticker">
|
||||
<?php while ( $get_featured_posts->have_posts() ):$get_featured_posts->the_post(); ?>
|
||||
<li>
|
||||
<a href="<?php the_permalink(); ?>"
|
||||
title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
// Reset Post Data
|
||||
wp_reset_query();
|
||||
}
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Display the date in the header
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_date_display' ) ) :
|
||||
function colormag_date_display() {
|
||||
if ( get_theme_mod( 'colormag_date_display', 0 ) == 0 ) {
|
||||
return;
|
||||
} ?>
|
||||
|
||||
<div class="date-in-header">
|
||||
<?php
|
||||
if ( get_theme_mod( 'colormag_date_display_type', 'theme_default' ) == 'theme_default' ) {
|
||||
echo date_i18n( 'l, F j, Y' );
|
||||
} elseif ( get_theme_mod( 'colormag_date_display_type', 'theme_default' ) == 'wordpress_date_setting' ) {
|
||||
echo date_i18n( get_option( 'date_format' ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Random Post in header
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_random_post' ) ) :
|
||||
function colormag_random_post() {
|
||||
// Bail out if random post in menu is not activated
|
||||
if ( get_theme_mod( 'colormag_random_post_in_menu', 0 ) == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$get_random_post = new WP_Query( array(
|
||||
'posts_per_page' => 1,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'orderby' => 'rand',
|
||||
) );
|
||||
?>
|
||||
<div class="random-post">
|
||||
<?php while ( $get_random_post->have_posts() ):$get_random_post->the_post(); ?>
|
||||
<a href="<?php the_permalink(); ?>" title="<?php _e( 'View a random post', 'colormag' ); ?>"><i
|
||||
class="fa fa-random"></i></a>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php
|
||||
// Reset Post Data
|
||||
wp_reset_query();
|
||||
}
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Display the related posts
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_related_posts_function' ) ) {
|
||||
|
||||
function colormag_related_posts_function() {
|
||||
wp_reset_postdata();
|
||||
global $post;
|
||||
|
||||
// Define shared post arguments
|
||||
$args = array(
|
||||
'no_found_rows' => true,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'ignore_sticky_posts' => 1,
|
||||
'orderby' => 'rand',
|
||||
'post__not_in' => array( $post->ID ),
|
||||
'posts_per_page' => 3,
|
||||
);
|
||||
// Related by categories
|
||||
if ( get_theme_mod( 'colormag_related_posts', 'categories' ) == 'categories' ) {
|
||||
|
||||
$cats = get_post_meta( $post->ID, 'related-posts', true );
|
||||
|
||||
if ( ! $cats ) {
|
||||
$cats = wp_get_post_categories( $post->ID, array( 'fields' => 'ids' ) );
|
||||
$args['category__in'] = $cats;
|
||||
} else {
|
||||
$args['cat'] = $cats;
|
||||
}
|
||||
}
|
||||
// Related by tags
|
||||
if ( get_theme_mod( 'colormag_related_posts', 'categories' ) == 'tags' ) {
|
||||
|
||||
$tags = get_post_meta( $post->ID, 'related-posts', true );
|
||||
|
||||
if ( ! $tags ) {
|
||||
$tags = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) );
|
||||
$args['tag__in'] = $tags;
|
||||
} else {
|
||||
$args['tag_slug__in'] = explode( ',', $tags );
|
||||
}
|
||||
if ( ! $tags ) {
|
||||
$break = true;
|
||||
}
|
||||
}
|
||||
|
||||
$query = ! isset( $break ) ? new WP_Query( $args ) : new WP_Query();
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Category Color for widgets and other
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_colored_category' ) ) :
|
||||
function colormag_colored_category() {
|
||||
global $post;
|
||||
$categories = get_the_category();
|
||||
$separator = ' ';
|
||||
$output = '';
|
||||
if ( $categories ) {
|
||||
$output .= '<div class="above-entry-meta"><span class="cat-links">';
|
||||
foreach ( $categories as $category ) {
|
||||
$color_code = colormag_category_color( get_cat_id( $category->cat_name ) );
|
||||
if ( ! empty( $color_code ) ) {
|
||||
$output .= '<a href="' . get_category_link( $category->term_id ) . '" style="background:' . colormag_category_color( get_cat_id( $category->cat_name ) ) . '" rel="category tag">' . $category->cat_name . '</a>' . $separator;
|
||||
} else {
|
||||
$output .= '<a href="' . get_category_link( $category->term_id ) . '" rel="category tag">' . $category->cat_name . '</a>' . $separator;
|
||||
}
|
||||
}
|
||||
$output .= '</span></div>';
|
||||
echo trim( $output, $separator );
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Creating responsive video for posts/pages
|
||||
*/
|
||||
if ( ! function_exists( 'colormag_responsive_video' ) ) :
|
||||
function colormag_responsive_video( $html, $url, $attr, $post_ID ) {
|
||||
return '<div class="fitvids-video">' . $html . '</div>';
|
||||
}
|
||||
|
||||
add_filter( 'embed_oembed_html', 'colormag_responsive_video', 10, 4 );
|
||||
endif;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/*
|
||||
* Use of the hooks for Category Color in the archive titles
|
||||
*/
|
||||
function colormag_colored_category_title( $title ) {
|
||||
$color_value = colormag_category_color( get_cat_id( $title ) );
|
||||
$color_border_value = colormag_category_color( get_cat_id( $title ) );
|
||||
if ( ! empty( $color_value ) ) {
|
||||
return '<h1 class="page-title" style="border-bottom-color: ' . $color_border_value . '">' . '<span style="background-color: ' . $color_value . '">' . $title . '</span></h1>';
|
||||
} else {
|
||||
return '<h1 class="page-title"><span>' . $title . '</span></h1>';
|
||||
}
|
||||
}
|
||||
|
||||
function colormag_category_title_function( $category_title ) {
|
||||
add_filter( 'single_cat_title', 'colormag_colored_category_title' );
|
||||
}
|
||||
|
||||
add_action( 'colormag_category_title', 'colormag_category_title_function' );
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/**
|
||||
* Making the theme Woocommrece compatible
|
||||
*/
|
||||
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
|
||||
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
|
||||
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
|
||||
// Remove WooCommerce default sidebar
|
||||
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
|
||||
|
||||
add_filter( 'woocommerce_show_page_title', '__return_false' );
|
||||
|
||||
add_action( 'woocommerce_before_main_content', 'colormag_wrapper_start', 10 );
|
||||
add_action( 'woocommerce_after_main_content', 'colormag_wrapper_end', 10 );
|
||||
|
||||
function colormag_wrapper_start() {
|
||||
echo '<div id="primary">';
|
||||
}
|
||||
|
||||
function colormag_wrapper_end() {
|
||||
echo '</div>';
|
||||
colormag_sidebar_select();
|
||||
}
|
||||
|
||||
// Displays the site logo
|
||||
if ( ! function_exists( 'colormag_the_custom_logo' ) ) {
|
||||
/**
|
||||
* Displays the optional custom logo.
|
||||
*/
|
||||
function colormag_the_custom_logo() {
|
||||
if ( function_exists( 'the_custom_logo' ) ) {
|
||||
the_custom_logo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate any existing theme CSS codes added in Customize Options to the core option added in WordPress 4.7
|
||||
*/
|
||||
function colormag_custom_css_migrate() {
|
||||
if ( function_exists( 'wp_update_custom_css_post' ) ) {
|
||||
$custom_css = get_theme_mod( 'colormag_custom_css' );
|
||||
if ( $custom_css ) {
|
||||
$core_css = wp_get_custom_css(); // Preserve any CSS already added to the core option.
|
||||
$return = wp_update_custom_css_post( $core_css . $custom_css );
|
||||
if ( ! is_wp_error( $return ) ) {
|
||||
// Remove the old theme_mod, so that the CSS is stored in only one place moving forward.
|
||||
remove_theme_mod( 'colormag_custom_css' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'after_setup_theme', 'colormag_custom_css_migrate' );
|
||||
|
||||
if ( ! function_exists( 'colormag_pingback_header' ) ) :
|
||||
|
||||
/**
|
||||
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
|
||||
*/
|
||||
function colormag_pingback_header() {
|
||||
if ( is_singular() && pings_open() ) {
|
||||
printf( '<link rel="pingback" href="%s">', esc_url( get_bloginfo( 'pingback_url' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
add_action( 'wp_head', 'colormag_pingback_header' );
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
if ( ! function_exists( 'colormag_comment' ) ) :
|
||||
/**
|
||||
* Template for comments and pingbacks.
|
||||
*
|
||||
* Used as a callback by wp_list_comments() for displaying the comments.
|
||||
*/
|
||||
function colormag_comment( $comment, $args, $depth ) {
|
||||
$GLOBALS['comment'] = $comment;
|
||||
switch ( $comment->comment_type ) :
|
||||
case 'pingback' :
|
||||
case 'trackback' :
|
||||
// Display trackbacks differently than normal comments.
|
||||
?>
|
||||
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
|
||||
<p><?php _e( 'Pingback:', 'colormag' ); ?><?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'colormag' ), '<span class="edit-link">', '</span>' ); ?></p>
|
||||
<?php
|
||||
break;
|
||||
default :
|
||||
// Proceed with normal comments.
|
||||
global $post;
|
||||
?>
|
||||
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
||||
<article id="comment-<?php comment_ID(); ?>" class="comment">
|
||||
<header class="comment-meta comment-author vcard">
|
||||
<?php
|
||||
echo get_avatar( $comment, 74 );
|
||||
printf( '<div class="comment-author-link"><i class="fa fa-user"></i>%1$s%2$s</div>',
|
||||
get_comment_author_link(),
|
||||
// If current post author is also comment author, make it known visually.
|
||||
( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'colormag' ) . '</span>' : ''
|
||||
);
|
||||
printf( '<div class="comment-date-time"><i class="fa fa-calendar-o"></i>%1$s</div>',
|
||||
sprintf( __( '%1$s at %2$s', 'colormag' ), get_comment_date(), get_comment_time() )
|
||||
);
|
||||
printf( '<a class="comment-permalink" href="%1$s"><i class="fa fa-link"></i>Permalink</a>', esc_url( get_comment_link( $comment->comment_ID ) ) );
|
||||
edit_comment_link();
|
||||
?>
|
||||
</header><!-- .comment-meta -->
|
||||
|
||||
<?php if ( '0' == $comment->comment_approved ) : ?>
|
||||
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'colormag' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="comment-content comment">
|
||||
<?php comment_text(); ?>
|
||||
<?php comment_reply_link( array_merge( $args, array(
|
||||
'reply_text' => __( 'Reply', 'colormag' ),
|
||||
'after' => '',
|
||||
'depth' => $depth,
|
||||
'max_depth' => $args['max_depth'],
|
||||
) ) ); ?>
|
||||
</section><!-- .comment-content -->
|
||||
|
||||
</article><!-- #comment-## -->
|
||||
<?php
|
||||
break;
|
||||
endswitch; // end comment_type check
|
||||
}
|
||||
endif;
|
||||
?>
|
||||
300
colormag/inc/header-functions.php
Normal file
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
/**
|
||||
* Contains all the fucntions and components related to header part.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.0
|
||||
*/
|
||||
/* * ************************************************************************************* */
|
||||
|
||||
if ( ! function_exists( 'colormag_social_links' ) ) :
|
||||
|
||||
/**
|
||||
* This function is for social links display on header
|
||||
*
|
||||
* Get links through Theme Options
|
||||
*/
|
||||
function colormag_social_links() {
|
||||
// Bail out if social links is not activated
|
||||
if ( get_theme_mod( 'colormag_social_link_activate', 0 ) == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$colormag_social_links = array(
|
||||
'colormag_social_facebook' => 'Facebook',
|
||||
'colormag_social_twitter' => 'Twitter',
|
||||
'colormag_social_googleplus' => 'Google-Plus',
|
||||
'colormag_social_instagram' => 'Instagram',
|
||||
'colormag_social_pinterest' => 'Pinterest',
|
||||
'colormag_social_youtube' => 'YouTube',
|
||||
);
|
||||
?>
|
||||
<div class="social-links clearfix">
|
||||
<ul>
|
||||
<?php
|
||||
$i = 0;
|
||||
$colormag_links_output = '';
|
||||
foreach ( $colormag_social_links as $key => $value ) {
|
||||
$link = get_theme_mod( $key, '' );
|
||||
if ( ! empty( $link ) ) {
|
||||
if ( get_theme_mod( $key . '_checkbox', 0 ) == 1 ) {
|
||||
$new_tab = 'target="_blank"';
|
||||
} else {
|
||||
$new_tab = '';
|
||||
}
|
||||
$colormag_links_output .= '<li><a href="' . esc_url( $link ) . '" ' . $new_tab . '><i class="fa fa-' . strtolower( $value ) . '"></i></a></li>';
|
||||
}
|
||||
$i ++;
|
||||
}
|
||||
echo $colormag_links_output;
|
||||
?>
|
||||
</ul>
|
||||
</div><!-- .social-links -->
|
||||
<?php
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
/* * ************************************************************************************* */
|
||||
|
||||
// Filter the get_header_image_tag() for option of adding the link back to home page option
|
||||
function colormag_header_image_markup( $html, $header, $attr ) {
|
||||
$output = '';
|
||||
$header_image = get_header_image();
|
||||
|
||||
if ( ! empty( $header_image ) ) {
|
||||
$output .= '<div class="header-image-wrap">';
|
||||
if ( get_theme_mod( 'colormag_header_image_link', 0 ) == 1 ) {
|
||||
$output .= '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" rel="home">';
|
||||
}
|
||||
|
||||
$output .= '<img src="' . esc_url( $header_image ) . '" class="header-image" width="' . get_custom_header()->width . '" height="' . get_custom_header()->height . '" alt="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '">';
|
||||
|
||||
if ( get_theme_mod( 'colormag_header_image_link', 0 ) == 1 ) {
|
||||
$output .= '</a>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function colormag_header_image_markup_filter() {
|
||||
add_filter( 'get_header_image_tag', 'colormag_header_image_markup', 10, 3 );
|
||||
}
|
||||
|
||||
add_action( 'colormag_header_image_markup_render', 'colormag_header_image_markup_filter' );
|
||||
|
||||
/* * ************************************************************************************* */
|
||||
|
||||
if ( ! function_exists( 'colormag_render_header_image' ) ) :
|
||||
|
||||
/**
|
||||
* Shows the small info text on top header part
|
||||
*/
|
||||
function colormag_render_header_image() {
|
||||
if ( function_exists( 'the_custom_header_markup' ) ) {
|
||||
do_action( 'colormag_header_image_markup_render' );
|
||||
the_custom_header_markup();
|
||||
} else {
|
||||
$header_image = get_header_image();
|
||||
if ( ! empty( $header_image ) ) {
|
||||
if ( get_theme_mod( 'colormag_header_image_link', 0 ) == 1 ) {
|
||||
?>
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
|
||||
<?php } ?>
|
||||
<div class="header-image-wrap">
|
||||
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
|
||||
</div>
|
||||
<?php if ( get_theme_mod( 'colormag_header_image_link', 0 ) == 1 ) { ?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_top_header_bar_display' ) ) :
|
||||
|
||||
/**
|
||||
* Function to display the top header bar
|
||||
*
|
||||
* @since ColorMag 1.2.2
|
||||
*/
|
||||
function colormag_top_header_bar_display() {
|
||||
if ( get_theme_mod( 'colormag_breaking_news', 0 ) == 1 || get_theme_mod( 'colormag_date_display', 0 ) == 1 || get_theme_mod( 'colormag_social_link_activate', 0 ) == 1 ) :
|
||||
?>
|
||||
<div class="news-bar">
|
||||
<div class="inner-wrap clearfix">
|
||||
<?php
|
||||
if ( get_theme_mod( 'colormag_date_display', 0 ) == 1 ) {
|
||||
colormag_date_display();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( get_theme_mod( 'colormag_breaking_news', 0 ) == 1 ) {
|
||||
colormag_breaking_news();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( ( get_theme_mod( 'colormag_social_link_activate', 0 ) == 1 ) && ( ( get_theme_mod( 'colormag_social_link_location_option', 'both' ) == 'both' ) || ( get_theme_mod( 'colormag_social_link_location_option', 'both' ) == 'header' ) ) ) {
|
||||
colormag_social_links();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_middle_header_bar_display' ) ) :
|
||||
|
||||
/**
|
||||
* Function to display the middle header bar
|
||||
*
|
||||
* @since ColorMag 1.2.2
|
||||
*/
|
||||
function colormag_middle_header_bar_display() {
|
||||
?>
|
||||
|
||||
<div class="inner-wrap">
|
||||
|
||||
<div id="header-text-nav-wrap" class="clearfix">
|
||||
<div id="header-left-section">
|
||||
<?php
|
||||
if ( ( get_theme_mod( 'colormag_header_logo_placement', 'header_text_only' ) == 'show_both' || get_theme_mod( 'colormag_header_logo_placement', 'header_text_only' ) == 'header_logo_only' ) ) {
|
||||
?>
|
||||
<div id="header-logo-image">
|
||||
<?php
|
||||
if ( function_exists( 'the_custom_logo' ) && has_custom_logo( $blog_id = 0 ) ) {
|
||||
colormag_the_custom_logo();
|
||||
}
|
||||
?>
|
||||
</div><!-- #header-logo-image -->
|
||||
<?php
|
||||
}
|
||||
$screen_reader = '';
|
||||
if ( get_theme_mod( 'colormag_header_logo_placement', 'header_text_only' ) == 'header_logo_only' || ( get_theme_mod( 'colormag_header_logo_placement', 'header_text_only' ) == 'disable' ) ) {
|
||||
$screen_reader = 'screen-reader-text';
|
||||
}
|
||||
?>
|
||||
<div id="header-text" class="<?php echo $screen_reader; ?>">
|
||||
<?php if ( is_front_page() || is_home() ) : ?>
|
||||
<h1 id="site-title">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
|
||||
</h1>
|
||||
<?php else : ?>
|
||||
<h3 id="site-title">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
|
||||
</h3>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$description = get_bloginfo( 'description', 'display' );
|
||||
if ( $description || is_customize_preview() ) :
|
||||
?>
|
||||
<p id="site-description"><?php echo $description; ?></p>
|
||||
<?php endif; ?><!-- #site-description -->
|
||||
</div><!-- #header-text -->
|
||||
</div><!-- #header-left-section -->
|
||||
<div id="header-right-section">
|
||||
<?php
|
||||
if ( is_active_sidebar( 'colormag_header_sidebar' ) ) {
|
||||
?>
|
||||
<div id="header-right-sidebar" class="clearfix">
|
||||
<?php
|
||||
// Calling the header sidebar if it exists.
|
||||
if ( ! dynamic_sidebar( 'colormag_header_sidebar' ) ):
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div><!-- #header-right-section -->
|
||||
|
||||
</div><!-- #header-text-nav-wrap -->
|
||||
|
||||
</div><!-- .inner-wrap -->
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'colormag_below_header_bar_display' ) ) :
|
||||
|
||||
/**
|
||||
* Function to display the middle header bar
|
||||
*
|
||||
* @since ColorMag 1.2.2
|
||||
*/
|
||||
function colormag_below_header_bar_display() {
|
||||
?>
|
||||
|
||||
<nav id="site-navigation" class="main-navigation clearfix" role="navigation">
|
||||
<div class="inner-wrap clearfix">
|
||||
<?php
|
||||
if ( get_theme_mod( 'colormag_home_icon_display', 0 ) == 1 ) {
|
||||
if ( is_front_page() ) {
|
||||
$home_icon_class = 'home-icon front_page_on';
|
||||
} else {
|
||||
$home_icon_class = 'home-icon';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="<?php echo $home_icon_class; ?>">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><i class="fa fa-home"></i></a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( get_theme_mod( 'colormag_random_post_in_menu', 0 ) == 1 || get_theme_mod( 'colormag_search_icon_in_menu', 0 ) == 1 ) { ?>
|
||||
<div class="search-random-icons-container">
|
||||
<?php
|
||||
// Displays the random post.
|
||||
if ( get_theme_mod( 'colormag_random_post_in_menu', 0 ) == 1 ) {
|
||||
colormag_random_post();
|
||||
}
|
||||
|
||||
// Displays the search icon.
|
||||
if ( get_theme_mod( 'colormag_search_icon_in_menu', 0 ) == 1 ) {
|
||||
?>
|
||||
<div class="top-search-wrap">
|
||||
<i class="fa fa-search search-top"></i>
|
||||
<div class="search-form-top">
|
||||
<?php get_search_form(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<p class="menu-toggle"></p>
|
||||
<?php
|
||||
if ( has_nav_menu( 'primary' ) ) {
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'primary',
|
||||
'container_class' => 'menu-primary-container',
|
||||
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
|
||||
) );
|
||||
} else {
|
||||
wp_page_menu();
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
endif;
|
||||
17
colormag/inc/post-formats.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php if ( has_post_format( 'gallery' ) ) : ?>
|
||||
|
||||
<div class="gallery-post-format">
|
||||
<?php
|
||||
$galleries = get_post_gallery_images( $post );
|
||||
|
||||
$output = '<ul class="gallery-images">';
|
||||
foreach ($galleries as $gallery) {
|
||||
$output .= '<li>' . '<img src="'. $gallery . '">' . '</li>';
|
||||
}
|
||||
$output .= '</ul>';
|
||||
|
||||
echo $output;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
62
colormag/inc/related-posts.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php $related_posts = colormag_related_posts_function(); ?>
|
||||
|
||||
<?php if ( $related_posts->have_posts() ): ?>
|
||||
|
||||
<h4 class="related-posts-main-title">
|
||||
<i class="fa fa-thumbs-up"></i><span><?php esc_html_e( 'You May Also Like', 'colormag' ); ?></span>
|
||||
</h4>
|
||||
|
||||
<div class="related-posts clearfix">
|
||||
|
||||
<?php while ( $related_posts->have_posts() ) : $related_posts->the_post(); ?>
|
||||
<div class="single-related-posts">
|
||||
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<div class="related-posts-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php the_post_thumbnail( 'colormag-featured-post-medium' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="article-content">
|
||||
|
||||
<h3 class="entry-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
</h3><!--/.post-title-->
|
||||
|
||||
<div class="below-entry-meta">
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ),
|
||||
esc_url( get_permalink() ),
|
||||
esc_attr( get_the_time() ),
|
||||
$time_string
|
||||
);
|
||||
?>
|
||||
|
||||
<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span>
|
||||
|
||||
<?php if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="comments"><i class="fa fa-comment"></i><?php comments_popup_link( '0', '1', '%' ); ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!--/.related-->
|
||||
<?php endwhile; ?>
|
||||
|
||||
</div><!--/.post-related-->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
||||
3760
colormag/inc/tgm-plugin-activation/class-tgm-plugin-activation.php
Normal file
133
colormag/inc/tgm-plugin-activation/tgmpa-colormag.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* This file contains the recommended plugin lists to this theme
|
||||
*/
|
||||
|
||||
add_action( 'tgmpa_register', 'colormag_register_required_plugins' );
|
||||
|
||||
/**
|
||||
* Register the recommended plugins for this theme.
|
||||
*
|
||||
* This function is hooked into `tgmpa_register`, which is fired on the WP `init` action on priority 10.
|
||||
*/
|
||||
function colormag_register_required_plugins() {
|
||||
|
||||
/**
|
||||
* Array of plugin arrays. Required keys are name and slug.
|
||||
*/
|
||||
$plugins = array(
|
||||
|
||||
// Include ThemeGrill Demo Importer as recommended
|
||||
array(
|
||||
'name' => 'ThemeGrill Demo Importer',
|
||||
'slug' => 'themegrill-demo-importer',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
// Include Everest Forms as recommended
|
||||
array(
|
||||
'name' => 'Everest Forms – Easy Contact Form and Form Builder',
|
||||
'slug' => 'everest-forms',
|
||||
'required' => false,
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$config = array(
|
||||
'id' => 'colormag',
|
||||
// Unique ID for hashing notices for multiple instances of TGMPA.
|
||||
'default_path' => '',
|
||||
// Default absolute path to bundled plugins.
|
||||
'menu' => 'tgmpa-install-plugins',
|
||||
// Menu slug.
|
||||
'has_notices' => true,
|
||||
// Show admin notices or not.
|
||||
'dismissable' => true,
|
||||
// If false, a user cannot dismiss the nag message.
|
||||
'dismiss_msg' => '',
|
||||
// If 'dismissable' is false, this message will be output at top of nag.
|
||||
'is_automatic' => false,
|
||||
// Automatically activate plugins after installation or not.
|
||||
'message' => '',
|
||||
// Message to output right before the plugins table.
|
||||
|
||||
'strings' => array(
|
||||
'page_title' => esc_html__( 'Install Required Plugins', 'colormag' ),
|
||||
'menu_title' => esc_html__( 'Install Plugins', 'colormag' ),
|
||||
/* translators: %s: plugin name. */
|
||||
'installing' => esc_html__( 'Installing Plugin: %s', 'colormag' ),
|
||||
/* translators: %s: plugin name. */
|
||||
'updating' => esc_html__( 'Updating Plugin: %s', 'colormag' ),
|
||||
'oops' => esc_html__( 'Something went wrong with the plugin API.', 'colormag' ),
|
||||
'notice_can_install_required' => _n_noop(
|
||||
/* translators: 1: plugin name(s). */
|
||||
'This theme requires the following plugin: %1$s.',
|
||||
'This theme requires the following plugins: %1$s.',
|
||||
'colormag'
|
||||
),
|
||||
'notice_can_install_recommended' => _n_noop(
|
||||
/* translators: 1: plugin name(s). */
|
||||
'This theme recommends the following plugin: %1$s.',
|
||||
'This theme recommends the following plugins: %1$s.',
|
||||
'colormag'
|
||||
),
|
||||
'notice_ask_to_update' => _n_noop(
|
||||
/* translators: 1: plugin name(s). */
|
||||
'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
|
||||
'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
|
||||
'colormag'
|
||||
),
|
||||
'notice_ask_to_update_maybe' => _n_noop(
|
||||
/* translators: 1: plugin name(s). */
|
||||
'There is an update available for: %1$s.',
|
||||
'There are updates available for the following plugins: %1$s.',
|
||||
'colormag'
|
||||
),
|
||||
'notice_can_activate_required' => _n_noop(
|
||||
/* translators: 1: plugin name(s). */
|
||||
'The following required plugin is currently inactive: %1$s.',
|
||||
'The following required plugins are currently inactive: %1$s.',
|
||||
'colormag'
|
||||
),
|
||||
'notice_can_activate_recommended' => _n_noop(
|
||||
/* translators: 1: plugin name(s). */
|
||||
'The following recommended plugin is currently inactive: %1$s.',
|
||||
'The following recommended plugins are currently inactive: %1$s.',
|
||||
'colormag'
|
||||
),
|
||||
'install_link' => _n_noop(
|
||||
'Begin installing plugin',
|
||||
'Begin installing plugins',
|
||||
'colormag'
|
||||
),
|
||||
'update_link' => _n_noop(
|
||||
'Begin updating plugin',
|
||||
'Begin updating plugins',
|
||||
'colormag'
|
||||
),
|
||||
'activate_link' => _n_noop(
|
||||
'Begin activating plugin',
|
||||
'Begin activating plugins',
|
||||
'colormag'
|
||||
),
|
||||
'return' => esc_html__( 'Return to Required Plugins Installer', 'colormag' ),
|
||||
'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'colormag' ),
|
||||
'activated_successfully' => esc_html__( 'The following plugin was activated successfully:', 'colormag' ),
|
||||
/* translators: 1: plugin name. */
|
||||
'plugin_already_active' => esc_html__( 'No action taken. Plugin %1$s was already active.', 'colormag' ),
|
||||
/* translators: 1: plugin name. */
|
||||
'plugin_needs_higher_version' => esc_html__( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'colormag' ),
|
||||
/* translators: 1: dashboard link. */
|
||||
'complete' => esc_html__( 'All plugins installed and activated successfully. %1$s', 'colormag' ),
|
||||
'dismiss' => esc_html__( 'Dismiss this notice', 'colormag' ),
|
||||
'notice_cannot_install_activate' => esc_html__( 'There are one or more required or recommended plugins to install, update or activate.', 'colormag' ),
|
||||
'contact_admin' => esc_html__( 'Please contact the administrator of this site for help.', 'colormag' ),
|
||||
|
||||
'nag_type' => '',
|
||||
// Determines admin notice type - can only be one of the typical WP notice classes, such as 'updated', 'update-nag', 'notice-warning', 'notice-info' or 'error'. Some of which may not work as expected in older WP versions.
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
tgmpa( $plugins, $config );
|
||||
}
|
||||
148
colormag/inc/widgets/colormag-125x125-advertisement-widget.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/**
|
||||
* 125x125 Advertisement Ads
|
||||
*/
|
||||
|
||||
class colormag_125x125_advertisement_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_125x125_advertisement',
|
||||
'description' => __( 'Add your 125x125 Advertisement here', 'colormag' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: 125x125 Advertisement', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$instance = wp_parse_args( ( array ) $instance, array(
|
||||
'title' => '',
|
||||
'125x125_image_url_1' => '',
|
||||
'125x125_image_url_2' => '',
|
||||
'125x125_image_url_3' => '',
|
||||
'125x125_image_url_4' => '',
|
||||
'125x125_image_url_5' => '',
|
||||
'125x125_image_url_6' => '',
|
||||
'125x125_image_link_1' => '',
|
||||
'125x125_image_link_2' => '',
|
||||
'125x125_image_link_3' => '',
|
||||
'125x125_image_link_4' => '',
|
||||
'125x125_image_link_5' => '',
|
||||
'125x125_image_link_6' => '',
|
||||
) );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
for ( $i = 1; $i < 7; $i ++ ) {
|
||||
$image_link = '125x125_image_link_' . $i;
|
||||
$image_url = '125x125_image_url_' . $i;
|
||||
|
||||
$instance[ $image_link ] = esc_url( $instance[ $image_link ] );
|
||||
$instance[ $image_url ] = esc_url( $instance[ $image_url ] );
|
||||
}
|
||||
?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
||||
</p>
|
||||
<label><?php _e( 'Add your Advertisement 125x125 Images Here', 'colormag' ); ?></label>
|
||||
<?php
|
||||
for ( $i = 1; $i < 7; $i ++ ) {
|
||||
$image_link = '125x125_image_link_' . $i;
|
||||
$image_url = '125x125_image_url_' . $i;
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( $image_link ); ?>"> <?php _e( 'Advertisement Image Link ', 'colormag' );
|
||||
echo $i; ?></label>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id( $image_link ); ?>" name="<?php echo $this->get_field_name( $image_link ); ?>" value="<?php echo $instance[ $image_link ]; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( $image_url ); ?>"> <?php _e( 'Advertisement Image ', 'colormag' );
|
||||
echo $i; ?></label>
|
||||
<div class="media-uploader" id="<?php echo $this->get_field_id( $image_url ); ?>">
|
||||
<div class="custom_media_preview">
|
||||
<?php if ( $instance[ $image_url ] != '' ) : ?>
|
||||
<img class="custom_media_preview_default" src="<?php echo esc_url( $instance[ $image_url ] ); ?>" style="max-width:100%;" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<input type="text" class="widefat custom_media_input" id="<?php echo $this->get_field_id( $image_url ); ?>" name="<?php echo $this->get_field_name( $image_url ); ?>" value="<?php echo esc_url( $instance[ $image_url ] ); ?>" style="margin-top:5px;" />
|
||||
<button class="custom_media_upload button button-secondary button-large" id="<?php echo $this->get_field_id( $image_url ); ?>" data-choose="<?php esc_attr_e( 'Choose an image', 'colormag' ); ?>" data-update="<?php esc_attr_e( 'Use image', 'colormag' ); ?>" style="width:100%;margin-top:6px;margin-right:30px;"><?php esc_html_e( 'Select an Image', 'colormag' ); ?></button>
|
||||
</div>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
for ( $i = 1; $i < 7; $i ++ ) {
|
||||
$image_link = '125x125_image_link_' . $i;
|
||||
$image_url = '125x125_image_url_' . $i;
|
||||
|
||||
$instance[ $image_link ] = esc_url_raw( $new_instance[ $image_link ] );
|
||||
$instance[ $image_url ] = esc_url_raw( $new_instance[ $image_url ] );
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
$image_array = array();
|
||||
$link_array = array();
|
||||
|
||||
for ( $i = 1; $i < 7; $i ++ ) {
|
||||
$image_link = '125x125_image_link_' . $i;
|
||||
$image_url = '125x125_image_url_' . $i;
|
||||
|
||||
$image_link = isset( $instance[ $image_link ] ) ? $instance[ $image_link ] : '';
|
||||
$image_url = isset( $instance[ $image_url ] ) ? $instance[ $image_url ] : '';
|
||||
if ( ! empty( $image_link ) ) {
|
||||
array_push( $link_array, $image_link );
|
||||
}
|
||||
if ( ! empty( $image_url ) ) {
|
||||
array_push( $image_array, $image_url );
|
||||
}
|
||||
}
|
||||
echo $before_widget;
|
||||
?>
|
||||
|
||||
<div class="advertisement_125x125">
|
||||
<?php if ( ! empty( $title ) ) { ?>
|
||||
<div class="advertisement-title">
|
||||
<?php echo $before_title . esc_html( $title ) . $after_title; ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$output = '';
|
||||
if ( ! empty( $image_array ) ) {
|
||||
$image_id = attachment_url_to_postid( $image_url );
|
||||
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
|
||||
$output .= '<div class="advertisement-content">';
|
||||
for ( $i = 1; $i < 7; $i ++ ) {
|
||||
$j = $i - 1;
|
||||
if ( ! empty( $image_array[ $j ] ) ) {
|
||||
if ( ! empty( $link_array[ $j ] ) ) {
|
||||
$output .= '<a href="' . $link_array[ $j ] . '" class="single_ad_125x125" target="_blank" rel="nofollow">
|
||||
<img src="' . $image_array[ $j ] . '" width="125" height="125" alt="' . $image_alt . '">
|
||||
</a>';
|
||||
} else {
|
||||
$output .= '<img src="' . $image_array[ $j ] . '" width="125" height="125" alt="' . $image_alt . '">';
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
echo $output;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
114
colormag/inc/widgets/colormag-300x250-advertisement-widget.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* 300x250 Advertisement Ads
|
||||
*/
|
||||
|
||||
class colormag_300x250_advertisement_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_300x250_advertisement',
|
||||
'description' => __( 'Add your 300x250 Advertisement here', 'colormag' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: 300x250 Advertisement', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$instance = wp_parse_args( ( array ) $instance, array(
|
||||
'title' => '',
|
||||
'300x250_image_url' => '',
|
||||
'300x250_image_link' => '',
|
||||
) );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
|
||||
$image_link = '300x250_image_link';
|
||||
$image_url = '300x250_image_url';
|
||||
|
||||
$instance[ $image_link ] = esc_url( $instance[ $image_link ] );
|
||||
$instance[ $image_url ] = esc_url( $instance[ $image_url ] );
|
||||
?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
||||
</p>
|
||||
<label><?php _e( 'Add your Advertisement 300x250 Images Here', 'colormag' ); ?></label>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( $image_link ); ?>"> <?php _e( 'Advertisement Image Link ', 'colormag' ); ?></label>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id( $image_link ); ?>" name="<?php echo $this->get_field_name( $image_link ); ?>" value="<?php echo $instance[ $image_link ]; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( $image_url ); ?>"> <?php _e( 'Advertisement Image ', 'colormag' ); ?></label>
|
||||
<div class="media-uploader" id="<?php echo $this->get_field_id( $image_url ); ?>">
|
||||
<div class="custom_media_preview">
|
||||
<?php if ( $instance[ $image_url ] != '' ) : ?>
|
||||
<img class="custom_media_preview_default" src="<?php echo esc_url( $instance[ $image_url ] ); ?>" style="max-width:100%;" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<input type="text" class="widefat custom_media_input" id="<?php echo $this->get_field_id( $image_url ); ?>" name="<?php echo $this->get_field_name( $image_url ); ?>" value="<?php echo esc_url( $instance[ $image_url ] ); ?>" style="margin-top:5px;" />
|
||||
<button class="custom_media_upload button button-secondary button-large" id="<?php echo $this->get_field_id( $image_url ); ?>" data-choose="<?php esc_attr_e( 'Choose an image', 'colormag' ); ?>" data-update="<?php esc_attr_e( 'Use image', 'colormag' ); ?>" style="width:100%;margin-top:6px;margin-right:30px;"><?php esc_html_e( 'Select an Image', 'colormag' ); ?></button>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
|
||||
$image_link = '300x250_image_link';
|
||||
$image_url = '300x250_image_url';
|
||||
|
||||
$instance[ $image_link ] = esc_url_raw( $new_instance[ $image_link ] );
|
||||
$instance[ $image_url ] = esc_url_raw( $new_instance[ $image_url ] );
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
|
||||
$image_link = '300x250_image_link';
|
||||
$image_url = '300x250_image_url';
|
||||
|
||||
$image_link = isset( $instance[ $image_link ] ) ? $instance[ $image_link ] : '';
|
||||
$image_url = isset( $instance[ $image_url ] ) ? $instance[ $image_url ] : '';
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
|
||||
<div class="advertisement_300x250">
|
||||
<?php if ( ! empty( $title ) ) { ?>
|
||||
<div class="advertisement-title">
|
||||
<?php echo $before_title . esc_html( $title ) . $after_title; ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$output = '';
|
||||
if ( ! empty( $image_url ) ) {
|
||||
$image_id = attachment_url_to_postid( $image_url );
|
||||
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
|
||||
$output .= '<div class="advertisement-content">';
|
||||
if ( ! empty( $image_link ) ) {
|
||||
$output .= '<a href="' . $image_link . '" class="single_ad_300x250" target="_blank" rel="nofollow">
|
||||
<img src="' . $image_url . '" width="300" height="250" alt="' . $image_alt . '">
|
||||
</a>';
|
||||
} else {
|
||||
$output .= '<img src="' . $image_url . '" width="300" height="250" alt="' . $image_alt . '">';
|
||||
}
|
||||
$output .= '</div>';
|
||||
echo $output;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
117
colormag/inc/widgets/colormag-728x90-advertisement-widget.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* 728x90 Advertisement Ads
|
||||
*/
|
||||
|
||||
class colormag_728x90_advertisement_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_728x90_advertisement',
|
||||
'description' => __( 'Add your 728x90 Advertisement here', 'colormag' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: 728x90 Advertisement', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$instance = wp_parse_args( ( array ) $instance, array(
|
||||
'title' => '',
|
||||
'728x90_image_url' => '',
|
||||
'728x90_image_link' => '',
|
||||
) );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
|
||||
$image_link = '728x90_image_link';
|
||||
$image_url = '728x90_image_url';
|
||||
|
||||
$instance[ $image_link ] = esc_url( $instance[ $image_link ] );
|
||||
$instance[ $image_url ] = esc_url( $instance[ $image_url ] );
|
||||
?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
||||
</p>
|
||||
<label><?php _e( 'Add your Advertisement 728x90 Images Here', 'colormag' ); ?></label>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( $image_link ); ?>"> <?php _e( 'Advertisement Image Link ', 'colormag' ); ?></label>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id( $image_link ); ?>" name="<?php echo $this->get_field_name( $image_link ); ?>" value="<?php echo $instance[ $image_link ]; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( $image_url ); ?>"> <?php _e( 'Advertisement Image ', 'colormag' ); ?></label>
|
||||
<div class="media-uploader" id="<?php echo $this->get_field_id( $image_url ); ?>">
|
||||
<div class="custom_media_preview">
|
||||
<?php if ( $instance[ $image_url ] != '' ) : ?>
|
||||
<img class="custom_media_preview_default" src="<?php echo esc_url( $instance[ $image_url ] ); ?>" style="max-width:100%;" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<input type="text" class="widefat custom_media_input" id="<?php echo $this->get_field_id( $image_url ); ?>" name="<?php echo $this->get_field_name( $image_url ); ?>" value="<?php echo esc_url( $instance[ $image_url ] ); ?>" style="margin-top:5px;" />
|
||||
<button class="custom_media_upload button button-secondary button-large" id="<?php echo $this->get_field_id( $image_url ); ?>" data-choose="<?php esc_attr_e( 'Choose an image', 'colormag' ); ?>" data-update="<?php esc_attr_e( 'Use image', 'colormag' ); ?>" style="width:100%;margin-top:6px;margin-right:30px;"><?php esc_html_e( 'Select an Image', 'colormag' ); ?></button>
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
|
||||
$image_link = '728x90_image_link';
|
||||
$image_url = '728x90_image_url';
|
||||
|
||||
$instance[ $image_link ] = esc_url_raw( $new_instance[ $image_link ] );
|
||||
$instance[ $image_url ] = esc_url_raw( $new_instance[ $image_url ] );
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
|
||||
|
||||
$image_link = '728x90_image_link';
|
||||
$image_url = '728x90_image_url';
|
||||
|
||||
$image_link = isset( $instance[ $image_link ] ) ? $instance[ $image_link ] : '';
|
||||
$image_url = isset( $instance[ $image_url ] ) ? $instance[ $image_url ] : '';
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
|
||||
<div class="advertisement_728x90">
|
||||
<?php if ( ! empty( $title ) ) { ?>
|
||||
<div class="advertisement-title">
|
||||
<?php echo $before_title . esc_html( $title ) . $after_title; ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$output = '';
|
||||
$image_id = attachment_url_to_postid( $image_url );
|
||||
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
|
||||
if ( ! empty( $image_url ) ) {
|
||||
$output .= '<div class="advertisement-content">';
|
||||
if ( ! empty( $image_link ) ) {
|
||||
$image_id = attachment_url_to_postid( $image_url );
|
||||
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
|
||||
$output .= '<a href="' . $image_link . '" class="single_ad_728x90" target="_blank" rel="nofollow">
|
||||
<img src="' . $image_url . '" width="728" height="90" alt="' . $image_alt . '">
|
||||
</a>';
|
||||
} else {
|
||||
$output .= '<img src="' . $image_url . '" width="728" height="90" alt="' . $image_alt . '">';
|
||||
}
|
||||
$output .= '</div>';
|
||||
echo $output;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
166
colormag/inc/widgets/colormag-featured-posts-slider-widget.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
/**
|
||||
* Featured Posts widget
|
||||
*/
|
||||
|
||||
class colormag_featured_posts_slider_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_featured_slider widget_featured_meta',
|
||||
'description' => __( 'Display latest posts or posts of specific category, which will be used as the slider.', 'colormag' ),
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: Featured Category Slider', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$tg_defaults['number'] = 4;
|
||||
$tg_defaults['type'] = 'latest';
|
||||
$tg_defaults['category'] = '';
|
||||
$instance = wp_parse_args( ( array ) $instance, $tg_defaults );
|
||||
$number = $instance['number'];
|
||||
$type = $instance['type'];
|
||||
$category = $instance['category'];
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to display:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="radio" <?php checked( $type, 'latest' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="latest" /><?php _e( 'Show latest Posts', 'colormag' ); ?>
|
||||
<br />
|
||||
<input type="radio" <?php checked( $type, 'category' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="category" /><?php _e( 'Show posts from a category', 'colormag' ); ?>
|
||||
<br /></p>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select category', 'colormag' ); ?>
|
||||
:</label>
|
||||
<?php wp_dropdown_categories( array(
|
||||
'show_option_none' => ' ',
|
||||
'name' => $this->get_field_name( 'category' ),
|
||||
'selected' => $category,
|
||||
) ); ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['number'] = absint( $new_instance['number'] );
|
||||
$instance['type'] = $new_instance['type'];
|
||||
$instance['category'] = $new_instance['category'];
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
global $post;
|
||||
$number = empty( $instance['number'] ) ? 4 : $instance['number'];
|
||||
$type = isset( $instance['type'] ) ? $instance['type'] : 'latest';
|
||||
$category = isset( $instance['category'] ) ? $instance['category'] : '';
|
||||
|
||||
$post_status = 'publish';
|
||||
if ( get_option( 'fresh_site' ) == 1 ) {
|
||||
$post_status = array( 'auto-draft', 'publish' );
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
'post_status' => $post_status,
|
||||
);
|
||||
|
||||
// Display posts from category.
|
||||
if ( $type == 'category' ) {
|
||||
$args['category__in'] = $category;
|
||||
}
|
||||
|
||||
$get_featured_posts = new WP_Query( $args );
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
<?php $featured = 'colormag-featured-image'; ?>
|
||||
<div class="widget_slider_area_rotate">
|
||||
<?php
|
||||
$i = 1;
|
||||
while ( $get_featured_posts->have_posts() ):$get_featured_posts->the_post();
|
||||
|
||||
if ( $i == 1 ) {
|
||||
$classes = "single-slide displayblock";
|
||||
} else {
|
||||
$classes = "single-slide displaynone";
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo $classes; ?>">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) {
|
||||
$image = '';
|
||||
$thumbnail_id = get_post_thumbnail_id( $post->ID );
|
||||
$image_alt_text = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
|
||||
$title_attribute = get_the_title( $post->ID );
|
||||
if ( empty( $image_alt_text ) ) {
|
||||
$image_alt_text = $title_attribute;
|
||||
}
|
||||
$image .= '<figure class="slider-featured-image">';
|
||||
$image .= '<a href="' . get_permalink() . '" title="' . the_title( '', '', false ) . '">';
|
||||
$image .= get_the_post_thumbnail( $post->ID, $featured, array(
|
||||
'title' => esc_attr( $title_attribute ),
|
||||
'alt' => esc_attr( $image_alt_text ),
|
||||
) ) . '</a>';
|
||||
$image .= '</figure>';
|
||||
echo $image;
|
||||
} else {
|
||||
?>
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/img/slider-featured-image.png">
|
||||
</a>
|
||||
<?php }
|
||||
?>
|
||||
<div class="slide-content">
|
||||
<?php colormag_colored_category(); ?>
|
||||
<h3 class="entry-title">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
<div class="below-entry-meta">
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string
|
||||
);
|
||||
?>
|
||||
<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span>
|
||||
<?php if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="comments"><i class="fa fa-comment"></i><?php comments_popup_link( '0', '1', '%' ); ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$i ++;
|
||||
endwhile;
|
||||
// Reset Post Data
|
||||
wp_reset_query();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
207
colormag/inc/widgets/colormag-featured-posts-vertical-widget.php
Normal file
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Featured Posts widget
|
||||
*/
|
||||
|
||||
class colormag_featured_posts_vertical_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_featured_posts widget_featured_posts_vertical widget_featured_meta',
|
||||
'description' => __( 'Display latest posts or posts of specific category.', 'colormag' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: Featured Posts (Style 2)', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$tg_defaults['title'] = '';
|
||||
$tg_defaults['text'] = '';
|
||||
$tg_defaults['number'] = 4;
|
||||
$tg_defaults['type'] = 'latest';
|
||||
$tg_defaults['category'] = '';
|
||||
$instance = wp_parse_args( ( array ) $instance, $tg_defaults );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
$text = esc_textarea( $instance['text'] );
|
||||
$number = $instance['number'];
|
||||
$type = $instance['type'];
|
||||
$category = $instance['category'];
|
||||
?>
|
||||
<p><?php _e( 'Layout will be as below:', 'colormag' ) ?></p>
|
||||
<div style="text-align: center;"><img src="<?php echo get_template_directory_uri() . '/img/style-2.jpg' ?>">
|
||||
</div>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
||||
</p>
|
||||
<?php _e( 'Description', 'colormag' ); ?>
|
||||
<textarea class="widefat" rows="5" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo $text; ?></textarea>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to display:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="radio" <?php checked( $type, 'latest' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="latest" /><?php _e( 'Show latest Posts', 'colormag' ); ?>
|
||||
<br />
|
||||
<input type="radio" <?php checked( $type, 'category' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="category" /><?php _e( 'Show posts from a category', 'colormag' ); ?>
|
||||
<br /></p>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select category', 'colormag' ); ?>
|
||||
:</label>
|
||||
<?php wp_dropdown_categories( array(
|
||||
'show_option_none' => ' ',
|
||||
'name' => $this->get_field_name( 'category' ),
|
||||
'selected' => $category,
|
||||
) ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
if ( current_user_can( 'unfiltered_html' ) ) {
|
||||
$instance['text'] = $new_instance['text'];
|
||||
} else {
|
||||
$instance['text'] = stripslashes( wp_filter_post_kses( addslashes( $new_instance['text'] ) ) );
|
||||
}
|
||||
$instance['number'] = absint( $new_instance['number'] );
|
||||
$instance['type'] = $new_instance['type'];
|
||||
$instance['category'] = $new_instance['category'];
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
global $post;
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
$text = isset( $instance['text'] ) ? $instance['text'] : '';
|
||||
$number = empty( $instance['number'] ) ? 4 : $instance['number'];
|
||||
$type = isset( $instance['type'] ) ? $instance['type'] : 'latest';
|
||||
$category = isset( $instance['category'] ) ? $instance['category'] : '';
|
||||
|
||||
$post_status = 'publish';
|
||||
if ( get_option( 'fresh_site' ) == 1 ) {
|
||||
$post_status = array( 'auto-draft', 'publish' );
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
'post_status' => $post_status,
|
||||
);
|
||||
|
||||
// Display from category chosen.
|
||||
if ( $type == 'category' ) {
|
||||
$args['category__in'] = $category;
|
||||
}
|
||||
|
||||
$get_featured_posts = new WP_Query( $args );
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
<?php
|
||||
if ( $type != 'latest' ) {
|
||||
$border_color = 'style="border-bottom-color:' . colormag_category_color( $category ) . ';"';
|
||||
$title_color = 'style="background-color:' . colormag_category_color( $category ) . ';"';
|
||||
} else {
|
||||
$border_color = '';
|
||||
$title_color = '';
|
||||
}
|
||||
if ( ! empty( $title ) ) {
|
||||
echo '<h3 class="widget-title" ' . $border_color . '><span ' . $title_color . '>' . esc_html( $title ) . '</span></h3>';
|
||||
}
|
||||
if ( ! empty( $text ) ) {
|
||||
?> <p> <?php echo esc_textarea( $text ); ?> </p> <?php } ?>
|
||||
<?php
|
||||
$i = 1;
|
||||
while ( $get_featured_posts->have_posts() ):$get_featured_posts->the_post();
|
||||
?>
|
||||
<?php if ( $i == 1 ) {
|
||||
$featured = 'colormag-featured-post-medium';
|
||||
} else {
|
||||
$featured = 'colormag-featured-post-small';
|
||||
} ?>
|
||||
<?php if ( $i == 1 ) {
|
||||
echo '<div class="first-post">';
|
||||
} elseif ( $i == 2 ) {
|
||||
echo '<div class="following-post">';
|
||||
} ?>
|
||||
<div class="single-article clearfix">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) {
|
||||
$image = '';
|
||||
$thumbnail_id = get_post_thumbnail_id( $post->ID );
|
||||
$image_alt_text = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
|
||||
$title_attribute = get_the_title( $post->ID );
|
||||
if ( empty( $image_alt_text ) ) {
|
||||
$image_alt_text = $title_attribute;
|
||||
}
|
||||
$image .= '<figure>';
|
||||
$image .= '<a href="' . get_permalink() . '" title="' . the_title( '', '', false ) . '">';
|
||||
$image .= get_the_post_thumbnail( $post->ID, $featured, array(
|
||||
'title' => esc_attr( $title_attribute ),
|
||||
'alt' => esc_attr( $image_alt_text ),
|
||||
) ) . '</a>';
|
||||
$image .= '</figure>';
|
||||
echo $image;
|
||||
}
|
||||
?>
|
||||
<div class="article-content">
|
||||
<?php colormag_colored_category(); ?>
|
||||
<h3 class="entry-title">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
<div class="below-entry-meta">
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string
|
||||
);
|
||||
?>
|
||||
<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span>
|
||||
<?php if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="comments"><i class="fa fa-comment"></i><?php comments_popup_link( '0', '1', '%' ); ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ( $i == 1 ) { ?>
|
||||
<div class="entry-content">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php if ( $i == 1 ) {
|
||||
echo '</div>';
|
||||
} ?>
|
||||
<?php
|
||||
$i ++;
|
||||
endwhile;
|
||||
if ( $i > 2 ) {
|
||||
echo '</div>';
|
||||
}
|
||||
// Reset Post Data
|
||||
wp_reset_query();
|
||||
?>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
208
colormag/inc/widgets/colormag-featured-posts-widget.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/**
|
||||
* Featured Posts widget
|
||||
*/
|
||||
|
||||
class colormag_featured_posts_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_featured_posts widget_featured_meta',
|
||||
'description' => __( 'Display latest posts or posts of specific category.', 'colormag' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: Featured Posts (Style 1)', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$tg_defaults['title'] = '';
|
||||
$tg_defaults['text'] = '';
|
||||
$tg_defaults['number'] = 4;
|
||||
$tg_defaults['type'] = 'latest';
|
||||
$tg_defaults['category'] = '';
|
||||
$instance = wp_parse_args( ( array ) $instance, $tg_defaults );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
$text = esc_textarea( $instance['text'] );
|
||||
$number = $instance['number'];
|
||||
$type = $instance['type'];
|
||||
$category = $instance['category'];
|
||||
?>
|
||||
<p><?php _e( 'Layout will be as below:', 'colormag' ) ?></p>
|
||||
<div style="text-align: center;"><img src="<?php echo get_template_directory_uri() . '/img/style-1.jpg' ?>">
|
||||
</div>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
||||
</p>
|
||||
<?php _e( 'Description', 'colormag' ); ?>
|
||||
<textarea class="widefat" rows="5" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo $text; ?></textarea>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to display:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="radio" <?php checked( $type, 'latest' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="latest" /><?php _e( 'Show latest Posts', 'colormag' ); ?>
|
||||
<br />
|
||||
<input type="radio" <?php checked( $type, 'category' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="category" /><?php _e( 'Show posts from a category', 'colormag' ); ?>
|
||||
<br /></p>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select category', 'colormag' ); ?>
|
||||
:</label>
|
||||
<?php wp_dropdown_categories( array(
|
||||
'show_option_none' => ' ',
|
||||
'name' => $this->get_field_name( 'category' ),
|
||||
'selected' => $category,
|
||||
) ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
if ( current_user_can( 'unfiltered_html' ) ) {
|
||||
$instance['text'] = $new_instance['text'];
|
||||
} else {
|
||||
$instance['text'] = stripslashes( wp_filter_post_kses( addslashes( $new_instance['text'] ) ) );
|
||||
}
|
||||
$instance['number'] = absint( $new_instance['number'] );
|
||||
$instance['type'] = $new_instance['type'];
|
||||
$instance['category'] = $new_instance['category'];
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
global $post;
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
$text = isset( $instance['text'] ) ? $instance['text'] : '';
|
||||
$number = empty( $instance['number'] ) ? 4 : $instance['number'];
|
||||
$type = isset( $instance['type'] ) ? $instance['type'] : 'latest';
|
||||
$category = isset( $instance['category'] ) ? $instance['category'] : '';
|
||||
|
||||
$post_status = 'publish';
|
||||
if ( get_option( 'fresh_site' ) == 1 ) {
|
||||
$post_status = array( 'auto-draft', 'publish' );
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => true,
|
||||
'post_status' => $post_status,
|
||||
);
|
||||
|
||||
// Display from category chosen.
|
||||
if ( $type == 'category' ) {
|
||||
$args['category__in'] = $category;
|
||||
}
|
||||
|
||||
$get_featured_posts = new WP_Query( $args );
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
<?php
|
||||
if ( $type != 'latest' ) {
|
||||
$border_color = 'style="border-bottom-color:' . colormag_category_color( $category ) . ';"';
|
||||
$title_color = 'style="background-color:' . colormag_category_color( $category ) . ';"';
|
||||
} else {
|
||||
$border_color = '';
|
||||
$title_color = '';
|
||||
}
|
||||
if ( ! empty( $title ) ) {
|
||||
echo '<h3 class="widget-title" ' . $border_color . '><span ' . $title_color . '>' . esc_html( $title ) . '</span></h3>';
|
||||
}
|
||||
if ( ! empty( $text ) ) {
|
||||
?> <p> <?php echo esc_textarea( $text ); ?> </p> <?php } ?>
|
||||
<?php
|
||||
$i = 1;
|
||||
while ( $get_featured_posts->have_posts() ):$get_featured_posts->the_post();
|
||||
?>
|
||||
<?php if ( $i == 1 ) {
|
||||
$featured = 'colormag-featured-post-medium';
|
||||
} else {
|
||||
$featured = 'colormag-featured-post-small';
|
||||
} ?>
|
||||
<?php if ( $i == 1 ) {
|
||||
echo '<div class="first-post">';
|
||||
} elseif ( $i == 2 ) {
|
||||
echo '<div class="following-post">';
|
||||
} ?>
|
||||
<div class="single-article clearfix">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) {
|
||||
$image = '';
|
||||
$thumbnail_id = get_post_thumbnail_id( $post->ID );
|
||||
$image_alt_text = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
|
||||
$title_attribute = get_the_title( $post->ID );
|
||||
if ( empty( $image_alt_text ) ) {
|
||||
$image_alt_text = $title_attribute;
|
||||
}
|
||||
$image .= '<figure>';
|
||||
$image .= '<a href="' . get_permalink() . '" title="' . the_title( '', '', false ) . '">';
|
||||
$image .= get_the_post_thumbnail( $post->ID, $featured, array(
|
||||
'title' => esc_attr( $title_attribute ),
|
||||
'alt' => esc_attr( $image_alt_text ),
|
||||
) ) . '</a>';
|
||||
$image .= '</figure>';
|
||||
echo $image;
|
||||
}
|
||||
?>
|
||||
<div class="article-content">
|
||||
<?php colormag_colored_category(); ?>
|
||||
<h3 class="entry-title">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
<div class="below-entry-meta">
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string
|
||||
);
|
||||
?>
|
||||
<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span>
|
||||
<?php if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="comments"><i class="fa fa-comment"></i><?php comments_popup_link( '0', '1', '%' ); ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ( $i == 1 ) { ?>
|
||||
<div class="entry-content">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php if ( $i == 1 ) {
|
||||
echo '</div>';
|
||||
} ?>
|
||||
<?php
|
||||
$i ++;
|
||||
endwhile;
|
||||
if ( $i > 2 ) {
|
||||
echo '</div>';
|
||||
}
|
||||
// Reset Post Data
|
||||
wp_reset_query();
|
||||
?>
|
||||
<!-- </div> -->
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
160
colormag/inc/widgets/colormag-highlighted-posts-widget.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* Highlighted Posts widget
|
||||
*/
|
||||
|
||||
class colormag_highlighted_posts_widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_highlighted_posts widget_featured_meta',
|
||||
'description' => __( 'Display latest posts or posts of specific category. Suitable for the Area Beside Slider Sidebar.', 'colormag' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array( 'width' => 200, 'height' => 250 );
|
||||
parent::__construct( false, $name = __( 'TG: Highlighted Posts', 'colormag' ), $widget_ops );
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$tg_defaults['number'] = 4;
|
||||
$tg_defaults['type'] = 'latest';
|
||||
$tg_defaults['category'] = '';
|
||||
$instance = wp_parse_args( ( array ) $instance, $tg_defaults );
|
||||
$number = $instance['number'];
|
||||
$type = $instance['type'];
|
||||
$category = $instance['category'];
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to display:', 'colormag' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="radio" <?php checked( $type, 'latest' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="latest" /><?php _e( 'Show latest Posts', 'colormag' ); ?>
|
||||
<br />
|
||||
<input type="radio" <?php checked( $type, 'category' ) ?> id="<?php echo $this->get_field_id( 'type' ); ?>" name="<?php echo $this->get_field_name( 'type' ); ?>" value="category" /><?php _e( 'Show posts from a category', 'colormag' ); ?>
|
||||
<br /></p>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select category', 'colormag' ); ?>
|
||||
:</label>
|
||||
<?php wp_dropdown_categories( array(
|
||||
'show_option_none' => ' ',
|
||||
'name' => $this->get_field_name( 'category' ),
|
||||
'selected' => $category,
|
||||
) ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['number'] = absint( $new_instance['number'] );
|
||||
$instance['type'] = $new_instance['type'];
|
||||
$instance['category'] = $new_instance['category'];
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
extract( $instance );
|
||||
|
||||
global $post;
|
||||
$number = empty( $instance['number'] ) ? 4 : $instance['number'];
|
||||
$type = isset( $instance['type'] ) ? $instance['type'] : 'latest';
|
||||
$category = isset( $instance['category'] ) ? $instance['category'] : '';
|
||||
|
||||
$post_status = 'publish';
|
||||
if ( get_option( 'fresh_site' ) == 1 ) {
|
||||
$post_status = array( 'auto-draft', 'publish' );
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => $number,
|
||||
'post_type' => 'post',
|
||||
'ignore_sticky_posts' => true,
|
||||
'post_status' => $post_status,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
// Display from category chosen.
|
||||
if ( $type == 'category' ) {
|
||||
$args['category__in'] = $category;
|
||||
}
|
||||
|
||||
$get_featured_posts = new WP_Query( $args );
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
<div class="widget_highlighted_post_area">
|
||||
<?php $featured = 'colormag-highlighted-post'; ?>
|
||||
<?php
|
||||
$i = 1;
|
||||
while ( $get_featured_posts->have_posts() ):$get_featured_posts->the_post();
|
||||
?>
|
||||
<div class="single-article">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) {
|
||||
$image = '';
|
||||
$thumbnail_id = get_post_thumbnail_id( $post->ID );
|
||||
$image_alt_text = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
|
||||
$title_attribute = get_the_title( $post->ID );
|
||||
if ( empty( $image_alt_text ) ) {
|
||||
$image_alt_text = $title_attribute;
|
||||
}
|
||||
$image .= '<figure class="highlights-featured-image">';
|
||||
$image .= '<a href="' . get_permalink() . '" title="' . the_title( '', '', false ) . '">';
|
||||
$image .= get_the_post_thumbnail( $post->ID, $featured, array(
|
||||
'title' => esc_attr( $title_attribute ),
|
||||
'alt' => esc_attr( $image_alt_text ),
|
||||
) ) . '</a>';
|
||||
$image .= '</figure>';
|
||||
echo $image;
|
||||
} else {
|
||||
?>
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/img/highlights-featured-image.png">
|
||||
</a>
|
||||
<?php }
|
||||
?>
|
||||
<div class="article-content">
|
||||
<?php colormag_colored_category(); ?>
|
||||
<h3 class="entry-title">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
<div class="below-entry-meta">
|
||||
<?php
|
||||
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
||||
}
|
||||
$time_string = sprintf( $time_string,
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_attr( get_the_modified_date( 'c' ) ),
|
||||
esc_html( get_the_modified_date() )
|
||||
);
|
||||
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string
|
||||
);
|
||||
?>
|
||||
<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span>
|
||||
<?php if ( ! post_password_required() && comments_open() ) { ?>
|
||||
<span class="comments"><i class="fa fa-comment"></i><?php comments_popup_link( '0', '1', '%' ); ?></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$i ++;
|
||||
endwhile;
|
||||
// Reset Post Data
|
||||
wp_reset_query();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
}
|
||||
223
colormag/inc/widgets/widgets.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/**
|
||||
* Contains all the functions related to sidebar and widget.
|
||||
*
|
||||
* @package ThemeGrill
|
||||
* @subpackage ColorMag
|
||||
* @since ColorMag 1.0
|
||||
*/
|
||||
add_action( 'widgets_init', 'colormag_widgets_init' );
|
||||
|
||||
/**
|
||||
* Function to register the widget areas(sidebar) and widgets.
|
||||
*/
|
||||
function colormag_widgets_init() {
|
||||
|
||||
/**
|
||||
* Registering widget areas for front page
|
||||
*/
|
||||
// Registering main right sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Right Sidebar', 'colormag' ),
|
||||
'id' => 'colormag_right_sidebar',
|
||||
'description' => esc_html__( 'Shows widgets at Right side.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering main left sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Left Sidebar', 'colormag' ),
|
||||
'id' => 'colormag_left_sidebar',
|
||||
'description' => esc_html__( 'Shows widgets at Left side.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering Header sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Header Sidebar', 'colormag' ),
|
||||
'id' => 'colormag_header_sidebar',
|
||||
'description' => esc_html__( 'Shows widgets in header section just above the main navigation menu.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
'after_title' => '</h3>',
|
||||
) );
|
||||
|
||||
// registering the Front Page: Slider Area Sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Front Page: Slider Area', 'colormag' ),
|
||||
'id' => 'colormag_front_page_slider_area',
|
||||
'description' => esc_html__( 'Show widget just below menu. Suitable for TG: Featured Category Slider.', 'colormag' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// registering the Front Page: Area beside slider Sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Front Page: Area beside slider', 'colormag' ),
|
||||
'id' => 'colormag_front_page_area_beside_slider',
|
||||
'description' => esc_html__( 'Show widget beside the slider. Suitable for TG: Highlighted Posts.', 'colormag' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// registering the Front Page: Content Top Section Sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Front Page: Content Top Section', 'colormag' ),
|
||||
'id' => 'colormag_front_page_content_top_section',
|
||||
'description' => esc_html__( 'Content Top Section', 'colormag' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// registering the Front Page: Content Middle Left Section Sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Front Page: Content Middle Left Section', 'colormag' ),
|
||||
'id' => 'colormag_front_page_content_middle_left_section',
|
||||
'description' => esc_html__( 'Content Middle Left Section', 'colormag' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// registering the Front Page: Content Middle Right Section Sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Front Page: Content Middle Right Section', 'colormag' ),
|
||||
'id' => 'colormag_front_page_content_middle_right_section',
|
||||
'description' => esc_html__( 'Content Middle Right Section', 'colormag' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// registering the Front Page: Content Bottom Section Sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Front Page: Content Bottom Section', 'colormag' ),
|
||||
'id' => 'colormag_front_page_content_bottom_section',
|
||||
'description' => esc_html__( 'Content Bottom Section', 'colormag' ),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering contact Page sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Contact Page Sidebar', 'colormag' ),
|
||||
'id' => 'colormag_contact_page_sidebar',
|
||||
'description' => esc_html__( 'Shows widgets on Contact Page Template.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering Error 404 Page sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Error 404 Page Sidebar', 'colormag' ),
|
||||
'id' => 'colormag_error_404_page_sidebar',
|
||||
'description' => esc_html__( 'Shows widgets on Error 404 page.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering advertisement above footer sidebar
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Advertisement Above The Footer', 'colormag' ),
|
||||
'id' => 'colormag_advertisement_above_the_footer_sidebar',
|
||||
'description' => esc_html__( 'Shows widgets just above the footer, suitable for TG: 728x90 Advertisement widget.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering footer sidebar one
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Footer Sidebar One', 'colormag' ),
|
||||
'id' => 'colormag_footer_sidebar_one',
|
||||
'description' => esc_html__( 'Shows widgets at footer sidebar one.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering footer sidebar two
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Footer Sidebar Two', 'colormag' ),
|
||||
'id' => 'colormag_footer_sidebar_two',
|
||||
'description' => esc_html__( 'Shows widgets at footer sidebar two.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering footer sidebar three
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Footer Sidebar Three', 'colormag' ),
|
||||
'id' => 'colormag_footer_sidebar_three',
|
||||
'description' => esc_html__( 'Shows widgets at footer sidebar three.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
// Registering footer sidebar four
|
||||
register_sidebar( array(
|
||||
'name' => esc_html__( 'Footer Sidebar Four', 'colormag' ),
|
||||
'id' => 'colormag_footer_sidebar_four',
|
||||
'description' => esc_html__( 'Shows widgets at footer sidebar four.', 'colormag' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h3 class="widget-title"><span>',
|
||||
'after_title' => '</span></h3>',
|
||||
) );
|
||||
|
||||
register_widget( 'colormag_featured_posts_slider_widget' );
|
||||
register_widget( 'colormag_highlighted_posts_widget' );
|
||||
register_widget( 'colormag_featured_posts_widget' );
|
||||
register_widget( 'colormag_featured_posts_vertical_widget' );
|
||||
register_widget( 'colormag_728x90_advertisement_widget' );
|
||||
register_widget( 'colormag_300x250_advertisement_widget' );
|
||||
register_widget( 'colormag_125x125_advertisement_widget' );
|
||||
}
|
||||
|
||||
// Require file for TG: Featured Category Slider widget.
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-featured-posts-slider-widget.php';
|
||||
|
||||
// Require file for TG: Highlighted Posts.
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-highlighted-posts-widget.php';
|
||||
|
||||
// Require file for TG: Featured Posts (Style 1).
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-featured-posts-widget.php';
|
||||
|
||||
// Require file for TG: Featured Posts (Style 2).
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-featured-posts-vertical-widget.php';
|
||||
|
||||
// Require file for TG: 300x250 Advertisement.
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-300x250-advertisement-widget.php';
|
||||
|
||||
// Require file for TG: 728x90 Advertisement.
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-728x90-advertisement-widget.php';
|
||||
|
||||
// Require file for TG: 125x125 Advertisement.
|
||||
require COLORMAG_WIDGETS_DIR . '/colormag-125x125-advertisement-widget.php';
|
||||