Commit 6c643f57 by Simone

Initial commit

parents
<?php
add_action('wp_enqueue_scripts', 'laniakea_enqueue_parent_theme_style');
function laniakea_enqueue_parent_theme_style()
{
$min = get_stylesheet_directory_uri() . '/style.min.css';
$style = file_exists($min) ? $min : get_stylesheet_directory_uri() . '/style.css';
wp_enqueue_style('laniakea-child-style', $style, array('laniakea-style'));
/*
// Inline Compressed Child Style:
add_filter('laniakea-inline-style', 'laniakea_child_style');
$dynamic_child_style_css = apply_filters('laniakea-inline-style', '');
wp_register_style('laniakea-child-style', false, array('laniakea-style'));
wp_enqueue_style('laniakea-child-style');
wp_add_inline_style('laniakea-child-style', $dynamic_child_style_css);
*/
}
add_action('after_setup_theme', 'laniakea_child_theme_setup');
function laniakea_child_theme_setup()
{
load_child_theme_textdomain('laniakea', get_stylesheet_directory() . '/languages');
}
/*
function laniakea_child_style()
{
ob_start();
include_once('style.css');
$dynamic_css = ob_get_clean();
$dynamic_css = laniakea_compress_css($dynamic_css);
return $dynamic_css;
}
*/
// -------------------------------------
// Edit below this line
// -------------------------------------
/*
Theme Name: Laniakea Child
Template: laniakea
Author: Simone Buono
Description: WordPress Theme
Version: 1.0
Description: WordPress theme.
/* Below you can write your style */
not found
\ No newline at end of file
<?php
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly.
}
get_header();
?>
<section id="archive-content" class="d-flex block-at-md contained">
<main>
<?php if (have_posts()) :
while (have_posts()) :
the_post();
if (is_category('news')) get_template_part('templates/loops/news', 'item');
else get_template_part('templates/loops/item', 'content');
endwhile;
endif;
?>
</main>
<?php if (is_active_sidebar('blog-sidebar')) : ?>
<aside>
<?php get_sidebar(); ?>
</aside>
<?php endif; ?>
</section>
<?php get_footer(); ?>
\ No newline at end of file
<?php
function laniakea_factory_options()
{
return [
//colori
'primary_color' => '#5f68dd',
'primary_text_color' => '#333333',
'menu_hover_color' => '#5f68dd',
'footer_color' => '#b5b5b5',
'footer_bgcolor' => '#444444',
'lower_footer_bgcolor' => '#444444',
//tipografia
'global_font' => 'Raleway',
'font_weights' => ['400', '700'],
//logo
'logo_maxwidth' => 100,
//header
'show_preheader' => false,
'menu_padding_top' => 24,
'menu_padding_bottom' => 24,
//footer
'footer_copyright' => 'Laniakea corp. &copy;' . Date('Y'),
//stickybar
'show_stickybar' => 1,
'stickybar_side' => 'right',
'stickybar_top' => 30,
'stickybar_slot1_link' => 'tel:1234567890',
'stickybar_slot1_icon' => 'fa fa-phone',
'stickybar_slot1_title' => 'contatti',
'stickybar_slot2_link' => '/contatti',
'stickybar_slot2_icon' => 'fa fa-envelope',
'stickybar_slot2_title' => 'contattaci',
];
}
function laniakea_get_font_weights()
{
return [
[
'value' => '100',
'label' => 'Thin'
],
[
'value' => '200',
'label' => 'Extra Light'
],
[
'value' => '300',
'label' => 'Light'
],
[
'value' => '400',
'label' => 'Regular'
],
[
'value' => '500',
'label' => 'Medium'
],
[
'value' => '600',
'label' => 'Semibold'
],
[
'value' => '700',
'label' => 'Bold'
],
[
'value' => '800',
'label' => 'ExtraBold'
],
[
'value' => '900',
'label' => 'Black'
]
];
}
function laniakea_tab_options()
{
return [
[
'id' => 'generale',
'icon' => 'globe',
'label' => 'Generale'
],
[
'id' => 'colori',
'icon' => 'palette',
'label' => 'Colori'
],
[
'id' => 'bakery-buttons',
'icon' => 'plug',
'label' => 'Colore Pulsanti Bakery'
],
[
'id' => 'typography',
'icon' => 'font',
'label' => 'Tipografia'
],
[
'id' => 'logo',
'icon' => 'star',
'label' => 'Logo'
],
[
'id' => 'header',
'icon' => 'bars',
'label' => 'Header'
],
[
'id' => 'footer',
'icon' => 'shoe-prints',
'label' => 'Footer'
],
[
'id' => 'stickybar',
'icon' => 'plug',
'label' => 'Barra bordo'
],
[
'id' => 'griglie',
'icon' => 'table-cells-large',
'label' => 'Griglie'
],
[
'id' => 'social',
'icon' => 'share',
'label' => 'Socials'
],
[
'id' => 'iubenda',
'icon' => 'cookie',
'label' => 'Iubenda'
]
];
}
<?php
function laniakea_admin_page()
{
add_menu_page(
'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DIuOGMtMC4yLDEuMS0xLjUsMi41LTIuNSwyLjdjLTEuNCwwLjItMi43LTEtMi40LTIuN2MwLjItMSwxLjItMS45LDEuOS0yLjgNCgkJQzc2LjIsNzcuNiw3Ni42LDc3LjYsNzcsNzcuNnoiLz4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNzQuMywyNS44YzAuOSwxLjMsMS45LDIuMSwxLjgsMi43Yy0wLjIsMC44LTEuMywxLjMtMiwxLjljLTAuNi0wLjctMS41LTEuMy0xLjUtMg0KCQlDNzIuNiwyNy43LDczLjUsMjcsNzQuMywyNS44eiIvPg0KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MC40LDg2LjFjMC43LDEuNCwxLjUsMi4yLDEuNCwyLjljLTAuMSwwLjYtMS4xLDEuMS0xLjcsMS42Yy0wLjYtMC43LTEuNS0xLjMtMS42LTINCgkJQzQ4LjQsODgsNDkuNCw4Ny4zLDUwLjQsODYuMXoiLz4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjMuMiwyMS40YzAuOCwxLjIsMS44LDEuOSwxLjYsMi41Yy0wLjIsMC43LTEuMSwxLjItMS44LDEuOWMtMC41LTAuNi0xLjQtMS4yLTEuNS0xLjkNCgkJQzIxLjUsMjMuMiwyMi40LDIyLjUsMjMuMiwyMS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=',
6.1
);
}
add_action('admin_menu', 'laniakea_admin_page');
function laniakea_checked_array($haystack, $needle)
{
if (!$haystack) return '';
echo in_array($needle, $haystack) ? 'checked' : '';
}
function laniakea_input($name, $type, $id = '')
{
if ($type == 'checkbox') {
echo sprintf('<input id="%s" type="checkbox" name="%s" value="1" %s>', $id, $name, checked(laniakea_option($name), 1, false));
} else if ($type == 'color') {
echo sprintf('
<div class="color-picker" ><input id="%s" type="text" name="%s" value="%s"></div>
', $id, $name, laniakea_option($name));
} else if ($type == 'textarea') {
echo sprintf('<textarea id="%s" name="%s" rows="5">%s</textarea>', $id, $name, laniakea_option($name));
} else {
echo sprintf('<input id="%s" type="%s" name="%s" value="%s">', $id, $type, $name, laniakea_option($name));
}
}
function laniakea_input_color_default($name, $default, $id = '')
{
$value = (empty(laniakea_option($name))) ? $default : laniakea_option($name);
echo sprintf('
<div class="color-picker">
<input id="%1$s" type="text" name="%2$s" value="%3$s" data-default-color="%4$s">
</div>
', $id, $name, $value,$default);
}
function laniakea_color_inputs()
{
return [
'Colore primario' => 'primary_color',
'Colore testo' => 'primary_text_color',
'Colore hover menu' => 'menu_hover_color',
'Colore testo footer' => 'footer_color',
'Colore fondo footer' => 'footer_bgcolor',
'Colore fondo footer basso' => 'lower_footer_bgcolor'
];
}
function laniakea_rev_sliders_alias()
{
if (class_exists('RevSlider')) {
$rev_slider = new RevSlider();
$sliders = $rev_slider->get_sliders();
} else {
$sliders = array();
}
return $sliders;
}
function laniakea_admin()
{
if (!current_user_can('manage_options')) {
wp_die("Non puoi usare laniakea");
}
if (isset($_POST['laniakea_save'])) {
unset($_POST['laniakea_save']);
$data = $_POST;
foreach ($data as $k => $d) {
if (is_string($d)) $d = trim($d);
$data[$k] = stripslashes_deep($d);
}
if (!isset($data['show_preheader'])) {
$data['show_preheader'] = 0;
}
update_option('laniakea_options', $data);
}
if (isset($_POST['laniakea_factory_reset'])) {
delete_option('laniakea_options');
update_option('laniakea_options', laniakea_factory_options());
}
global $laniakea_options;
$laniakea_options = null;
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-autocomplete');
wp_enqueue_media();
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
include "admin-template.php";
}
<script>
var GFONT_APIKEY = '<?php echo LANIAKEA_GFONT_APIKEY ?>';
</script>
<?php
$options = laniakea_tab_options();
?>
<div class="wrap" id="laniakea">
<div class="title">
<img width="div" height="32" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3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gk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNzQuMywyNS44YzAuOSwxLjMsMS45LDIuMSwxLjgsMi43Yy0wLjIsMC44LTEuMywxLjMtMiwxLjljLTAuNi0wLjctMS41LTEuMy0xLjUtMg0KCQlDNzIuNiwyNy43LDczLjUsMjcsNzQuMywyNS44eiIvPg0KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MC40LDg2LjFjMC43LDEuNCwxLjUsMi4yLDEuNCwyLjljLTAuMSwwLjYtMS4xLDEuMS0xLjcsMS42Yy0wLjYtMC43LTEuNS0xLjMtMS42LTINCgkJQzQ4LjQsODgsNDkuNCw4Ny4zLDUwLjQsODYuMXoiLz4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjMuMiwyMS40YzAuOCwxLjIsMS44LDEuOSwxLjYsMi41Yy0wLjIsMC43LTEuMSwxLjItMS44LDEuOWMtMC41LTAuNi0xLjQtMS4yLTEuNS0xLjkNCgkJQzIxLjUsMjMuMiwyMi40LDIyLjUsMjMuMiwyMS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=" />
Laniakea
</div>
<form action="" method="post">
<input type="hidden" name="laniakea_save" value="save" />
<div class="laniakea-multitab">
<ul class="tab-header">
<?php
foreach ($options as $option) {
echo sprintf(
'<li data-tab="#%s"><i class="fa fa-fw fa-%s"></i>%s</li>',
$option['id'],
$option['icon'],
$option['label']
);
} ?>
</ul>
<div class="tab-container">
<?php
foreach ($options as $option) : ?>
<div class="tab" id="<?php echo $option['id'] ?>">
<?php include "options/" . $option['id'] . ".php" ?>
</div>
<?php endforeach ?>
</div>
</div>
<input type="submit" class="button-primary" value="Salva" />
</form>
<form method="post" action="" class="factory_reset">
<input type="hidden" name="laniakea_factory_reset" value="save" />
<input type="submit" class="button" value="Factory Reset" />
<p>Ripristina i valori alle impostazioni di fabbrica.</p>
</form>
</div>
\ No newline at end of file
<?php
$bakery_buttons = laniakea_bakery_btn_colors();
?>
<div class="field-group">
<div class="color-inputs">
<?php foreach ($bakery_buttons as $button) :
$button_value = laniakea_option('bakery_btn_color_' . $button['value']);
?>
<div class="color-item">
<label>
<?php echo $button['label']; ?>
<?php if (!empty($button_value) && $button_value != $button['default']) : ?>
&nbsp;<i class="fa fa-pen" style="color:red"></i>
<?php endif ?>
</label>
<?php laniakea_input_color_default('bakery_btn_color_' . $button['value'], $button['default']); ?>
</div>
<?php endforeach; ?>
</div>
</div>
<h3>Hover</h3>
<div class="field-group">
<h4>Colore sfondo</h4>
<?php laniakea_input_color_default('bakery_btn_hover_bg', laniakea_option('primary_color', '#333')); ?>
</div>
<div class="field-group">
<h4>Colore testo</h4>
<?php laniakea_input_color_default('bakery_btn_hover_color', '#efefef'); ?>
</div>
\ No newline at end of file
<div class="field-group">
<div class="color-inputs">
<?php foreach (laniakea_color_inputs() as $color_label => $color_name) : ?>
<div class="color-item">
<label><?php echo $color_label; ?></label>
<?php laniakea_input($color_name, 'color'); ?>
</div>
<?php endforeach; ?>
</div>
</div>
\ No newline at end of file
<div class="field-group">
<h3>Footer Copyright</h3>
<?php laniakea_input('footer_copyright', 'textarea'); ?>
</div>
<div class="field-group">
<h3>Post Footer Copyright</h3>
<?php laniakea_input('post_footer_copyright', 'textarea'); ?>
</div>
<?php
$objSliders = laniakea_rev_sliders_alias();
?>
<div class="field-group">
<h3>Revolution Slider Home</h3>
<select name="rev_slider">
<option value>Nessun slider</option>
<?php foreach ($objSliders as $slider) { ?>
<option value="<?php echo $slider->alias; ?>" <?php selected(laniakea_option('rev_slider'), $slider->alias, true) ?>>
<?php echo $slider->title; ?>
</option>
<?php } ?>
</select>
</div>
<div class="field-group">
<h3>Larghezza contenuto pagine (px)</h3>
<?php laniakea_input('content_width','number')?>
</div>
\ No newline at end of file
<h3>Risultati ricerca</h3>
<div class="field-group">
<h4>Numero colonne</h4>
<?php laniakea_input('search_grid_count', 'number') ?>
<h4>Gap colonne (px)</h4>
<?php laniakea_input('search_grid_gap', 'number') ?>
</div>
<h3>Archivi</h3>
<div class="field-group">
<h4>Numero colonne</h4>
<?php laniakea_input('archive_grid_count', 'number') ?>
<h4>Gap colonne (px)</h4>
<?php laniakea_input('archive_grid_gap', 'number') ?>
</div>
<h3>Categorie</h3>
<div class="field-group">
<h4>Numero colonne</h4>
<?php laniakea_input('category_grid_count', 'number') ?>
<h4>Gap colonne (px)</h4>
<?php laniakea_input('category_grid_gap', 'number') ?>
</div>
\ No newline at end of file
<div class="field-group">
<h3><label><?php laniakea_input('header_fullwidth', 'checkbox'); ?> Header a larghezza piena</label></h3>
</div>
<div class="field-group">
<h3><label><?php laniakea_input('show_preheader', 'checkbox'); ?> Mostra Pre Header</label></h3>
</div>
<div class="field-group">
<h3>Margine superiore Menu (px)</h3>
<?php laniakea_input('menu_padding_top', 'number'); ?>
</div>
<div class="field-group">
<h3>Margine inferiore Menu (px)</h3>
<?php laniakea_input('menu_padding_bottom', 'number'); ?>
</div>
<div class="field-group">
<h3>Grandezza Font Menu (px)</h3>
<select name="menu_font_weight">
<?php foreach (laniakea_get_font_weights() as $weight) : ?>
<option value="<?php echo $weight['value']; ?>" <?php selected(laniakea_option('menu_font_weight'), $weight['value'], true); ?>><?php echo $weight['label'] . ' ' . $weight['value']; ?></option>
<?php endforeach; ?>
</select>
</div>
\ No newline at end of file
<div class="field-group">
<h3><label><?php laniakea_input('iubenda_popup', 'checkbox'); ?> Abilita script per Popup di visione privacy e cookie policy</label></h3>
</div>
<div class="field-group">
<h3>Site ID</h3>
<?php laniakea_input('iubenda_site_id', 'number'); ?>
</div>
<div class="field-group">
<h3>Cookie Policy ID</h3>
<?php laniakea_input('iubenda_cookie_policy_id', 'number'); ?>
</div>
<a href="https://www.iubenda.com/it/help/1698-dove-trovo-i-miei-cookie-policy-id-e-site-id" target="_blank" >Dove trovo i miei cookie policy ID e site ID?</a>
<div class="field-group">
<h3>Posizione icona preferenze</h3>
<select name="iubenda_cookie_button_pos">
<option value="bottom-right" <?php selected(laniakea_option('iubenda_cookie_button_pos'), 'bottom-right', true) ?>>Destra</option>
<option value="bottom-left" <?php selected(laniakea_option('iubenda_cookie_button_pos'), 'bottom-left', true) ?>>Sinistra</option>
</select>
</div>
\ No newline at end of file
<div class="field-group">
<h3>Logo</h3>
<table>
<tr>
<td>
<div class="d-flex">
<div class="flex-item">
<h4>Primario</h4>
<div class="image-preview-container mb-1">
<img id='primary-logo-preview' src='<?php laniakea_get_logo(laniakea_option('primary_logo'), LANIAKEA_THEME_URI . 'logo.png') ?>' width="80" height="80" style='max-height: 100px;width:auto;'>
</div>
<input id="primary-logo-button" type="button" class="button" value="Scegli logo primario" />
<?php laniakea_input('primary_logo', 'hidden', 'primary-logo-input'); ?>
</div>
<div class="flex-item">
<h4>Invertito</h4>
<div class="image-preview-container mb-1" style="background-color: black;">
<img id='inverted-logo-preview' src='<?php laniakea_get_logo(laniakea_option('inverted_logo'), LANIAKEA_THEME_URI . 'logo-white.png') ?>' width="80" height="80" style='max-height: 100px;width:auto;'>
</div>
<input id="inverted-logo-button" type="button" class="button" value="Scegli logo invertito" />
<?php laniakea_input('inverted_logo', 'hidden', 'inverted-logo-input'); ?>
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="field-group">
<h3>Logo Mobile</h3>
<table>
<tr>
<td>
<div class="d-flex">
<div class="flex-item">
<h4>Primario</h4>
<div class="image-preview-container mb-1">
<img id='primary-logo-mobile-preview' src='<?php laniakea_get_logo(laniakea_option('primary_logo_mobile'), LANIAKEA_THEME_URI . 'logo.png') ?>' width="80" height="80" style='max-height: 100px;width:auto;'>
</div>
<input id="primary-logo-mobile-button" type="button" class="button" value="Scegli logo mobile primario" />
<?php laniakea_input('primary_logo_mobile', 'hidden', 'primary-logo-mobile-input'); ?>
</div>
<div class="flex-item">
<h4>Invertito</h4>
<div class="image-preview-container mb-1" style="background-color: black;">
<img id='inverted-logo-mobile-preview' src='<?php laniakea_get_logo(laniakea_option('inverted_logo_mobile'), LANIAKEA_THEME_URI . 'logo-white.png') ?>' width="80" height="80" style='max-height: 100px;width:auto;'>
</div>
<input id="inverted-logo-mobile-button" type="button" class="button" value="Scegli logo mobile invertito" />
<?php laniakea_input('inverted_logo_mobile', 'hidden', 'inverted-logo-mobile-input'); ?>
</div>
<!-- <div class="flex-item" style="margin-left:24px">
<h4>Breakpoint max-width (px)</h4>
<?php laniakea_input('logo_mobile_break_max', 'number'); ?>
</div> -->
</div>
</td>
</tr>
</table>
</div>
<div class="field-group">
<h3>Breakpoint Logo (px)</h3>
<?php laniakea_input('logo_break', 'number'); ?>
</div>
<div class="field-group">
<h3>Larghezza Massima Logo (px)</h3>
<?php laniakea_input('logo_maxwidth', 'number'); ?>
</div>
\ No newline at end of file
<?php
$socials = laniakea_get_socials();
?>
<h3>URLs</h3>
<table>
<?php foreach ($socials as $social) : ?>
<tr>
<th>
<i class="<?php echo $social['icon'] ?>"></i>
<?php echo $social['label'] ?>
</th>
<td><?php laniakea_input('social_' . $social['name'], 'text'); ?></td>
</tr>
<?php endforeach; ?>
</table>
<h3>Shortcode</h3>
<input class="shortcode-copy" onclick="this.select()" value='[laniakea-social align="center" size="24"]' />
<?php
$primary_color = laniakea_option('primary_color', '#5f68dd');
$stickybar_top = laniakea_option('stickybar_top', '30%');
?>
<div class="sticky-preview">
<div class="laniakea-stickybar" style="position:absolute;right:0px;top : <?php echo $stickybar_top; ?>%;">
<div class="laniakea-stickybar-container">
<ul>
<?php for ($i = 1; $i < 4; $i++) : ?>
<?php
$slot_icon = laniakea_option('stickybar_slot' . $i . '_icon');
if ($slot_icon) :
$slot_title = laniakea_option('stickybar_slot' . $i . '_title');
?>
<li style="margin-bottom:1px;list-style-type: none">
<a style="background-color:<?php echo $primary_color; ?>;color:white;padding:15px;display:block" title="<?php echo $slot_title ?>">
<span class="icon <?php echo $slot_icon; ?>" style="font-size:22px"></span>
</a>
</li>
<?php endif; ?>
<?php endfor; ?>
</ul>
</div>
</div>
</div>
<div class="field-group">
<h3><label><?php laniakea_input('show_stickybar', 'checkbox'); ?> Mostra Sticky Bar</label></h3>
</div>
<div class="field-group">
<h3>Aggancia a </h3>
<select name="stickybar_side">
<option value="right" <?php selected(laniakea_option('stickybar_side'), "right", true) ?>>Destra</option>
<option value="left" <?php selected(laniakea_option('stickybar_side'), "left", true) ?>>Sinistra</option>
</select>
</div>
<div class="field-group">
<h3>Altezza %</h3>
<?php laniakea_input('stickybar_top', 'number') ?>
</div>
<?php for ($i = 1; $i < 4; $i++) : ?>
<h3>Slot <?php echo $i; ?></h3>
<table>
<tr>
<th>Classe Icona</th>
<td>
<?php laniakea_input('stickybar_slot' . $i . '_icon', 'text'); ?>
&nbsp;<i class="<?php echo laniakea_option('stickybar_slot' . $i . '_icon') ?>"></i>
</td>
</tr>
<tr>
<th>Link</th>
<td>
<?php laniakea_input('stickybar_slot' . $i . '_link', 'text'); ?>
</td>
</tr>
<tr>
<th>Titolo</th>
<td>
<?php laniakea_input('stickybar_slot' . $i . '_title', 'text'); ?>
</td>
</tr>
</table>
<?php endfor; ?>
icone : <a target="_blank" href="https://fontawesome.com/v6/search">https://fontawesome.com/v6/search</a>
\ No newline at end of file
<?php
$font_weights = laniakea_get_font_weights();
?>
<div class="field-group">
<h3>Font del sito</h3>
<?php laniakea_input('global_font', 'text', 'gfont-autocomplete'); ?>
</div>
<div class="field-group">
<h3>Grandezza del font</h3>
<div style="column-count:2">
<b>Roman</b>
<?php
foreach ($font_weights as $font) : ?>
<div>
<label>
<input type="checkbox" name="font_weights[]" class="font_weight_input" value="<?php echo $font['value'] ?>" <?php laniakea_checked_array(laniakea_option('font_weights'), $font['value']); ?>>
<?php echo $font['label'] . ' ' . $font['value'] ?>
</label>
</div>
<?php endforeach; ?>
<b>Italic</b>
<?php foreach ($font_weights as $font) : ?>
<div>
<label>
<input type="checkbox" name="font_weights[]" class="font_weight_input" value="1,<?php echo $font['value'] ?>" <?php laniakea_checked_array(laniakea_option('font_weights'), '1,' . $font['value']); ?>>
<?php echo $font['label'] . ' ' . $font['value'] ?> Italic
</label>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="field-group">
<h3>specificare px,em,rem,...</h3>
<?php for ($i = 1; $i < 6; $i++) : ?>
<h3>H<?php echo $i ?></h3>
<div class="d-flex">
<div class="flex-item" style="width:250px">
<label> dimensione </label>
<?php laniakea_input('h' . $i . '_size', 'text'); ?>
</div>
<div class="flex-item" style="width:250px">
<label> interlinea </label>
<?php laniakea_input('h' . $i . '_line_height', 'text'); ?>
</div>
</div>
<?php endfor; ?>
</div>
<h3>Paragrafo</h3>
<div class="field-group">
<div class="d-flex">
<div class="flex-item" style="width:250px">
<label>dimensione</label>
<?php laniakea_input('paragraph_size', 'text'); ?>
</div>
<div class="flex-item" style="width:250px">
<label>interlinea</label>
<?php laniakea_input('paragraph_line_height', 'text'); ?>
</div>
</div>
</div>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(s,i),t.JsonHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./folding/cstyle").FoldMode,a=e("../worker/worker_client").WorkerClient,f=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new u};r.inherits(f,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start"){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(f.prototype),t.Mode=f}); (function() {
ace.require(["ace/mode/json"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
ace.define("ace/theme/twilight-css",["require","exports","module"],function(e,t,n){n.exports=".ace-twilight .ace_gutter {\n background: #232323;\n color: #E2E2E2\n}\n\n.ace-twilight .ace_print-margin {\n width: 1px;\n background: #232323\n}\n\n.ace-twilight {\n background-color: #141414;\n color: #F8F8F8\n}\n\n.ace-twilight .ace_cursor {\n color: #A7A7A7\n}\n\n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20)\n}\n\n.ace-twilight.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #141414;\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(102, 82, 0)\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25)\n}\n\n.ace-twilight .ace_marker-layer .ace_active-line {\n background: rgba(255, 255, 255, 0.031)\n}\n\n.ace-twilight .ace_gutter-active-line {\n background-color: rgba(255, 255, 255, 0.031)\n}\n\n.ace-twilight .ace_marker-layer .ace_selected-word {\n border: 1px solid rgba(221, 240, 255, 0.20)\n}\n\n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25)\n}\n\n.ace-twilight .ace_keyword,\n.ace-twilight .ace_meta {\n color: #CDA869\n}\n\n.ace-twilight .ace_constant,\n.ace-twilight .ace_constant.ace_character,\n.ace-twilight .ace_constant.ace_character.ace_escape,\n.ace-twilight .ace_constant.ace_other,\n.ace-twilight .ace_heading,\n.ace-twilight .ace_markup.ace_heading,\n.ace-twilight .ace_support.ace_constant {\n color: #CF6A4C\n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color: #F8F8F8;\n background-color: rgba(86, 45, 86, 0.75)\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration: underline;\n font-style: italic;\n color: #D2A8A1\n}\n\n.ace-twilight .ace_support {\n color: #9B859D\n}\n\n.ace-twilight .ace_fold {\n background-color: #AC885B;\n border-color: #F8F8F8\n}\n\n.ace-twilight .ace_support.ace_function {\n color: #DAD085\n}\n\n.ace-twilight .ace_list,\n.ace-twilight .ace_markup.ace_list,\n.ace-twilight .ace_storage {\n color: #F9EE98\n}\n\n.ace-twilight .ace_entity.ace_name.ace_function,\n.ace-twilight .ace_meta.ace_tag {\n color: #AC885B\n}\n\n.ace-twilight .ace_string {\n color: #8F9D6A\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color: #E9C062\n}\n\n.ace-twilight .ace_comment {\n font-style: italic;\n color: #5F5A60\n}\n\n.ace-twilight .ace_variable {\n color: #7587A6\n}\n\n.ace-twilight .ace_xml-pe {\n color: #494949\n}\n\n.ace-twilight .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-twilight .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n"}),ace.define("ace/theme/twilight",["require","exports","module","ace/theme/twilight-css","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=e("./twilight-css");var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass,!1)}); (function() {
ace.require(["ace/theme/twilight"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
const LaniakeaAdminModule = (function () {
function ready(fn) {
if (document.readyState !== "loading") {
fn();
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
function onReady() {
const TabHeaders = document.querySelectorAll(
".laniakea-multitab .tab-header li"
);
const Tabs = document.querySelectorAll(".laniakea-multitab .tab");
let currentTab =
sessionStorage.getItem("laniakea_admin_curtab") ?? "generale";
let tabHeaderToHighlight = document.querySelector(
'li[data-tab="#' + currentTab + '"]'
);
removeActiveTabHeaderClass();
if (tabHeaderToHighlight) tabHeaderToHighlight.classList.add("active");
changeActiveTab(document.querySelector("#laniakea #" + currentTab));
function removeActiveTabHeaderClass() {
TabHeaders.forEach((th) => th.classList.remove("active"));
}
function changeActiveTab(tab) {
if (!tab) return;
Tabs.forEach((tab) => tab.classList.remove("active"));
tab.classList.add("active");
sessionStorage.setItem("laniakea_admin_curtab", tab.id);
}
TabHeaders.forEach((th) => {
th.addEventListener("click", (e) => {
removeActiveTabHeaderClass();
e.currentTarget.classList.add("active");
let dataTab = e.currentTarget.getAttribute("data-tab");
changeActiveTab(document.querySelector(dataTab));
});
});
////LOGO
var file_frame;
const logoButton = document.querySelector("#primary-logo-button");
const primaryLogoPreview = document.querySelector("#primary-logo-preview");
const primaryLogoInput = document.querySelector("#primary-logo-input");
const logoMobileButton = document.querySelector(
"#primary-logo-mobile-button"
);
const primaryLogoMobilePreview = document.querySelector(
"#primary-logo-mobile-preview"
);
const primaryLogoMobileInput = document.querySelector(
"#primary-logo-mobile-input"
);
const invertedLogoButton = document.querySelector("#inverted-logo-button");
const invertedLogoPreview = document.querySelector(
"#inverted-logo-preview"
);
const invertedLogoInput = document.querySelector("#inverted-logo-input");
const invertedLogoMobileButton = document.querySelector(
"#inverted-logo-mobile-button"
);
const invertedLogoMobilePreview = document.querySelector(
"#inverted-logo-mobile-preview"
);
const invertedLogoMobileInput = document.querySelector(
"#inverted-logo-mobile-input"
);
function initFileFrame(options) {
file_frame = wp.media.frames.file_frame = wp.media({
title: options.title,
button: {
text: "Usa Questa immmagine",
},
multiple: false,
});
file_frame.on("select", () => {
attachment = file_frame.state().get("selection").first().toJSON();
options.previewNode.setAttribute("src", attachment.url);
options.inputNode.value = attachment.id;
});
}
logoButton &&
logoButton.addEventListener("click", (e) => {
initFileFrame({
title: "Scegli logo primario",
previewNode: primaryLogoPreview,
inputNode: primaryLogoInput,
});
file_frame.open();
});
invertedLogoButton &&
invertedLogoButton.addEventListener("click", (e) => {
initFileFrame({
title: "Scegli logo inverito",
previewNode: invertedLogoPreview,
inputNode: invertedLogoInput,
});
file_frame.open();
});
logoMobileButton &&
logoMobileButton.addEventListener("click", (e) => {
initFileFrame({
title: "Scegli logo primario",
previewNode: primaryLogoMobilePreview,
inputNode: primaryLogoMobileInput,
});
file_frame.open();
});
invertedLogoMobileButton &&
invertedLogoMobileButton.addEventListener("click", (e) => {
initFileFrame({
title: "Scegli logo inverito",
previewNode: invertedLogoMobilePreview,
inputNode: invertedLogoMobileInput,
});
file_frame.open();
});
///COLORS
const ResetBakeryButtons = document.querySelectorAll(".reset-bakery");
ResetBakeryButtons.forEach((b) =>
b.addEventListener("click", (e) => {
let targetName = e.currentTarget.getAttribute("data-name");
let color = e.currentTarget.getAttribute("data-color");
console.log(color, targetName);
let input = document.querySelector(`input[name=${targetName}]`);
console.log("-->", input);
input.value = color;
})
);
var gfonts = [];
(async function fetchGoogleFonts($) {
///FONT AUTOCOMPLETE
if (typeof GFONT_APIKEY != "undefined") {
let url = `https://www.googleapis.com/webfonts/v1/webfonts?key=${GFONT_APIKEY}`;
const response = await fetch(url);
const fonts = await response.json();
gfonts = fonts.items.map((f) => f.family);
}
$(function () {
try {
$("#gfont-autocomplete").autocomplete({
source: gfonts,
minLength: 3,
select: function (event, ui) {
$("#gfont-autocomplete").val(ui.item.value);
},
classes: {
"ui-autocomplete": "laniakea-autocomplete",
},
});
///COLOR PICKER
$(".color-picker input").wpColorPicker();
} catch (e) {
console.debug("catched exception", e);
}
});
})(jQuery);
}
ready(onReady);
})();
const LaniakeaModule = (function ($) {
function ready(fn) {
if (document.readyState !== "loading") {
fn();
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
ready(onReady);
function onReady() {
const Wrapper = document.getElementById("wrapper");
const docElem = document.documentElement;
const header = document.querySelector("#main-header");
const logo = document.querySelector("#main-header #logo");
const mobileBurger = document.querySelector(".mobile-burger");
const linesBurger = document.querySelectorAll(
".mobile-burger .burger-line"
);
const mainNav = document.querySelector(".main-nav");
//widget
const widgetSearch = document.querySelector(
".searchform input[type='submit']"
);
$(".blog_widget #s").each(function () {
$(this).attr("placeholder", "Cerca");
});
if (widgetSearch) widgetSearch.value = "";
//wrapper reset opacity on ready:
Wrapper.style.opacity = 1;
let didScroll = false;
let changeHeaderOn = 50;
function init() {
window.addEventListener(
"scroll",
function (event) {
if (!didScroll) {
didScroll = true;
setTimeout(scrollPage, 100);
}
},
false
);
window.addEventListener(
"load",
function (event) {
if (!didScroll) {
didScroll = true;
setTimeout(scrollPage, 100);
}
},
false
);
mobileBurger.addEventListener("click", function (event) {
document.body.classList.toggle("menu-mobile-open");
if (document.body.classList.contains("menu-mobile-open")) {
setTimeout(toggleLineBurgerWhite, 400);
} else {
toggleLineBurgerWhite();
}
mainNav.classList.toggle("visible-mobile");
});
}
function toggleLineBurgerWhite() {
linesBurger.forEach((el) => {
el.classList.toggle("stroke-white");
});
}
function scrollPage() {
var sy = scrollY();
if (sy >= changeHeaderOn) {
header.classList.add("fixed");
} else {
header.classList.remove("fixed");
}
didScroll = false;
}
function scrollY() {
return docElem.scrollTop;
}
init();
$(document).on(
"click",
".wpcf7-not-valid-tip,.wpcf7-response-output",
function () {
$(this).fadeOut();
}
);
}
})(jQuery);
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
require_once "swiper-class.php";
function laniakea_custom_post_type()
{
global $pagenow;
//PORTFOLIO
register_post_type(
'laniakea_portfolio',
array(
'labels' => array(
'name' => __('Portfolio', 'laniakea'),
'singular_name' => __('Portfolio', 'laniakea'),
'add_new' => __('Aggiungi nuovo', 'laniakea'),
'add_new_item' => __('Aggiungi nuovo Portfolio', 'laniakea'),
'edit_item' => __('Modifica Portfolio', 'laniakea'),
'view_item' => __('Vedi Portfolio', 'laniakea'),
'all_items' => __('Tutti i Portfolio', 'laniakea'),
'not_found' => __('Nessun Portfolio', 'laniakea'),
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail', 'revisions',),
'taxonomies' => array('category'),
)
);
}
add_action('init', 'laniakea_custom_post_type');
<?php
$primary_color = laniakea_option('primary_color', '#5f68dd');
$primary_text_color = laniakea_option('primary_text_color', '#333333');
$stickybar_side = laniakea_option('stickybar_side', 'right');
$show_stickybar = laniakea_option('show_stickybar');
$stickybar_top = laniakea_option('stickybar_top', '30%');
$bakery_buttons = laniakea_bakery_btn_colors();
$archive_count = laniakea_option('archive_grid_count');
$search_count = laniakea_option('search_grid_count');
$category_count = laniakea_option('category_grid_count');
$archive_col_gap = laniakea_option('archive_grid_gap');
$search_col_gap = laniakea_option('search_grid_gap');
$category_col_gap = laniakea_option('category_grid_gap');
$menu_padding_top = laniakea_option('menu_padding_top', 24);
$menu_padding_bottom = laniakea_option('menu_padding_bottom', 24);
$hf = 250 + $menu_padding_top + $menu_padding_bottom;
$wrapper_min_height = 'calc( 100vh - ' . $hf . 'px )';
?>
:root{
--primary-color : <?php echo $primary_color; ?>;
}
.contained{
max-width : <?php echo laniakea_option('content_width', 1300); ?>px;
}
#wrapper{
min-height:<?php echo $wrapper_min_height; ?>;
}
body,
#wrapper h1,
#wrapper h2,
#wrapper h3,
#wrapper h4,
#wrapper h5,
#wrapper h6
{
font-family: <?php echo laniakea_option('global_font', 'Raleway') ?>, sans-serif !important;
}
<?php for ($i = 1; $i < 6; $i++) : ?>
<?php
$size = laniakea_option('h' . $i . '_size');
$line_height = laniakea_option('h' . $i . '_line_height');
?>
h<?php echo $i; ?>{
<?php if (!empty($size)) : ?>font-size : <?php echo $size ?>;<?php endif; ?>
<?php if (!empty($line_height)) : ?>line-height: <?php echo $line_height ?>;<?php endif; ?>
}
<?php endfor; ?>
p{
<?php if (laniakea_option('paragraph_size')) echo 'font-size:' . laniakea_option('paragraph_size') . ';' ?>
<?php if (laniakea_option('paragraph_line_height')) echo 'line-height:' . laniakea_option('paragraph_line_height') . ';' ?>
color : <?php echo $primary_text_color; ?>;
}
<?php if ($show_stickybar == 1) : ?>
.laniakea-stickybar{
<?php echo $stickybar_side ?> : 0px;
top : <?php echo $stickybar_top; ?>%;
}
<?php endif; ?>
#main-header #logo{
max-width : <?php echo laniakea_option('logo_maxwidth', 100) ?>px;
}
.laniakea-stickybar a:hover,
.wpcf7 .wpcf7-submit{
background-color : <?php echo $primary_color; ?>;
}
.laniakea-menu li a{
font-weight: <?php echo laniakea_option('menu_font_weight', '700'); ?>;
}
.laniakea-menu li a:hover,
.laniakea-menu li.current-menu-item a,
.laniakea-pre-menu li a:hover,
laniakea-pre-menu li.current-menu-item a {
color: <?php echo laniakea_option('menu_hover_color', '#5f68dd') ?>;
}
@media (min-width: 992px){
.laniakea-menu>ul>li>a {
padding-top : <?php echo $menu_padding_top; ?>px;
padding-bottom :<?php echo $menu_padding_bottom; ?>px;
}
}
footer{
background-color : <?php echo laniakea_option('footer_bgcolor', '#444'); ?>
}
footer *{
color : <?php echo laniakea_option('footer_color', 'silver'); ?>
}
footer .lower-footer{
background-color : <?php echo laniakea_option('lower_footer_bgcolor', '#444'); ?>
}
.captcha-image .cf7ic_instructions span{
color : <?php echo $primary_color; ?>
}
#archive-content main{
<?php if (!empty($archive_count)) :
$fr = array_fill(0, $archive_count, '1fr');
$fr = join(' ', $fr);
?>
grid-template-columns: <?php echo $fr ?>;
<?php endif; ?>
<?php if (!empty($archive_col_gap)) : ?>
gap : <?php echo $archive_col_gap; ?>px;
<?php endif; ?>
}
#search-content{
<?php if (!empty($search_count)) :
$fr = array_fill(0, $search_count, '1fr');
$fr = join(' ', $fr);
?>
grid-template-columns: <?php echo $fr ?>;
<?php endif; ?>
<?php if (!empty($search_col_gap)) : ?>
gap : <?php echo $search_col_gap; ?>px;
<?php endif; ?>
}
body.archive.category #archive-content main{
<?php if (!empty($category_count)) :
$fr = array_fill(0, $category_count, '1fr');
$fr = join(' ', $fr);
?>
grid-template-columns: <?php echo $fr ?>;
<?php endif; ?>
<?php if (!empty($category_col_gap)) : ?>
gap : <?php echo $category_col_gap; ?>px;
<?php endif; ?>
}
#wrapper .vc_btn3:hover{
<?php if (!empty(laniakea_option('bakery_btn_hover_bg'))) : ?>
background-color:<?php echo laniakea_option('bakery_btn_hover_bg') ?>!important;
<?php endif; ?>
<?php if (!empty(laniakea_option('bakery_btn_hover_color'))) : ?>
color:<?php echo laniakea_option('bakery_btn_hover_color') ?>!important;;
<?php endif; ?>
}
<?php foreach ($bakery_buttons as $btn) :
$color = laniakea_option('bakery_btn_color_' . $btn['value']);
if (
!empty($color)
&& $color != $btn['default']
) :
?>
#wrapper .vc_btn3.vc_btn3-color-<?php echo $btn['value']; ?>{
background-color : <?php echo $color; ?>;
}
<?php endif;
endforeach; ?>
<?php if (is_page()): global $post;?>
.page .has-image:before{
background-color: <?php echo get_post_meta($post->ID, 'laniakea_header_bg', true); ?>;
}
<?php endif; ?>
\ No newline at end of file
<?php
function laniakea_option($k, $default = '')
{
global $laniakea_options;
if (empty(($laniakea_options))) {
$laniakea_options = get_option('laniakea_options');
}
if (isset($laniakea_options[$k]) && !empty($laniakea_options[$k])) return $laniakea_options[$k];
else return $default;
}
function laniakea_get_logo($attachment_id, $default = '')
{
if (!empty($attachment_id)) echo wp_get_attachment_url($attachment_id);
else echo $default;
}
function laniakea_compress_css($css = '')
{
if (!empty($css)) {
$css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css);
$css = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $css);
$css = str_replace(', ', ',', $css);
}
return $css;
}
function laniakea_get_googleapi_font()
{
$font_weights = laniakea_option('font_weights', ['400', '700']);
$has_italic = false;
foreach ($font_weights as $key => $font) {
if (substr($font, 0, 2) == '1,') {
$has_italic = true;
break;
}
}
foreach ($font_weights as $key => $font) {
if ($has_italic && substr($font, 0, 2) != '1,') {
$font_weights[$key] = '0,' . $font;
}
}
$family = laniakea_option('global_font', 'Raleway');
$family .= $has_italic ? ':ital,wght' : ':wght';
$weights = join(';', $font_weights);
$href = sprintf("https://fonts.googleapis.com/css2?family=%s@%s&display=swap", $family, $weights);
echo sprintf('<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="%s" rel="stylesheet">', $href);
}
function laniakea_get_socials()
{
return [
[
'label' => 'Facebook',
'name' => 'facebook',
'icon' => 'fa-brands fa-facebook'
],
[
'label' => 'LinkedIn',
'name' => 'linkedin',
'icon' => 'fa-brands fa-linkedin'
],
[
'label' => 'Instagram',
'name' => 'instagram',
'icon' => 'fa-brands fa-instagram'
],
[
'label' => 'Youtube',
'name' => 'youtube',
'icon' => 'fa-brands fa-youtube'
],
[
'label' => 'Vimeo',
'name' => 'vimeo',
'icon' => 'fa-brands fa-vimeo'
],
[
'label' => 'Tik Tok',
'name' => 'tiktok',
'icon' => 'fa-brands fa-tiktok'
],
[
'label' => 'Twitter',
'name' => 'twitter',
'icon' => 'fa-brands fa-twitter'
],
[
'label' => 'Github',
'name' => 'github',
'icon' => 'fa-brands fa-github'
],
[
'label' => 'Discord',
'name' => 'discord',
'icon' => 'fa-brands fa-discord'
],
[
'label' => 'Stack Overflow',
'name' => 'stack_overflow',
'icon' => 'fa-brands fa-stack-overflow'
],
[
'label' => 'Behance',
'name' => 'behance',
'icon' => 'fa-brands fa-behance'
],
[
'label' => 'Spotify',
'name' => 'spotify',
'icon' => 'fa-brands fa-spotify'
],
[
'label' => 'Soundcloud',
'name' => 'soundcloud',
'icon' => 'fa-brands fa-soundcloud'
],
];
}
function laniakea_bakery_btn_colors()
{
return [
[
'label' => 'Classic Grey',
'value' => 'default',
'default' => '#ebebeb'
],
[
'label' => 'Classic Blue',
'value' => 'primary',
'default' => '#0088cc'
],
[
'label' => 'Classic Turquoise',
'value' => 'info',
'default' => '#58b9da'
],
[
'label' => 'Classic Green',
'value' => 'success',
'default' => '#6ab165'
],
[
'label' => 'Classic Orange',
'value' => 'warning',
'default' => '#ff9900'
],
[
'label' => 'Classic Red',
'value' => 'danger',
'default' => '#ff675b'
],
[
'label' => 'Classic Black',
'value' => 'inverse',
'default' => '#555555'
],
[
'label' => 'Blu',
'value' => 'blue',
'default' => '#5472d2'
],
[
'label' => 'Turchese',
'value' => 'turquoise',
'default' => '#00c1cf'
],
[
'label' => 'Pink',
'value' => 'pink',
'default' => '#fe6c61'
],
[
'label' => 'Violet',
'value' => 'violet',
'default' => '#8d6dc4'
],
[
'label' => 'Peacoc',
'value' => 'peacoc',
'default' => '#4cadc9'
],
[
'label' => 'Chino',
'value' => 'chino',
'default' => '#cec2ab'
],
[
'label' => 'Mulled Wine',
'value' => 'mulled-wine',
'default' => '#50485b'
],
[
'label' => 'Vista Blue',
'value' => 'vista-blue',
'default' => '#75d69c'
],
[
'label' => 'Nero',
'value' => 'black',
'default' => '#2a2a2a'
],
[
'label' => 'Grigio',
'value' => 'grey',
'default' => '#ebebeb'
],
[
'label' => 'Arancione',
'value' => 'orange',
'default' => '#f7be68'
],
[
'label' => 'Sky',
'value' => 'sky',
'default' => '#5aa1e3'
],
[
'label' => 'Verde',
'value' => 'green',
'default' => '#6dab3c'
],
[
'label' => 'Juicy pink',
'value' => 'juicy-pink',
'default' => '#f4524d'
],
[
'label' => 'Sandy brown',
'value' => 'sandy-brown',
'default' => '#f79468'
],
[
'label' => 'Purple',
'value' => 'purple',
'default' => '#b97ebb'
],
[
'label' => 'White',
'value' => 'white',
'default' => '#ffffff'
]
];
}
\ No newline at end of file
<?php
define('LANIAKEA_THEME_VERSION', '1.0');
define('LANIAKEA_THEME_DIR', trailingslashit(get_template_directory()));
define('LANIAKEA_THEME_URI', trailingslashit(esc_url(get_template_directory_uri())));
define('LANIAKEA_MAINTENANCE_MODE', false);
define('LANIAKEA_GFONT_APIKEY', 'AIzaSyB_IDts3fy_LJC9CacWooGOXWX3y8f2cWM');
require_once LANIAKEA_THEME_DIR . 'core/tgmpa/tgmpa-activation.php';
require_once LANIAKEA_THEME_DIR . 'core/helper-functions.php';
require_once LANIAKEA_THEME_DIR . 'core/theme-sidebars.php';
require_once LANIAKEA_THEME_DIR . 'core/custom-posts.php';
require_once LANIAKEA_THEME_DIR . 'core/svg-support.php';
require_once LANIAKEA_THEME_DIR . 'core/shortcodes/shortcodes.php';
/* //WPCF7 INTEGRATIONS:
require_once LANIAKEA_THEME_DIR . 'core/wpcf7-integrations.php';
*/
//ADMIN PAGE
if (is_admin()) {
require_once LANIAKEA_THEME_DIR . 'core/iubenda-menu-item.php';
require_once LANIAKEA_THEME_DIR . 'core/admin/admin-configs.php';
require_once LANIAKEA_THEME_DIR . 'core/admin/admin-page.php';
require_once LANIAKEA_THEME_DIR . 'core/post-meta-box.php';
}
function laniakea_admin_bar_item(WP_Admin_Bar $wp_admin_bar)
{
$wp_admin_bar->add_menu(
array(
'id' => 'laniakea-options-page',
'parent' => null, // use 'top-secondary' for toggle menu position.
'href' => admin_url('admin.php?page=laniakea-options'),
'title' => '<span class="laniakea-icon"></span>Opzioni Tema',
)
);
}
add_action('admin_bar_menu', 'laniakea_admin_bar_item', 100);
function laniakea_enqueue_scripts()
{
wp_enqueue_style('fontawesome-style', LANIAKEA_THEME_URI . '/core/assets/fontawesome/css/all.min.css', array());
wp_enqueue_style('swiper-style', LANIAKEA_THEME_URI . '/core/assets/swiper/swiper-bundle.min.css', array(), '11.0.5');
wp_enqueue_style('laniakea-style', LANIAKEA_THEME_URI . '/style.min.css', array('fontawesome-style'));
wp_enqueue_script('laniakea-scripts', LANIAKEA_THEME_URI . '/core/assets/js/scripts.js', array('jquery'), '1.0', true);
wp_enqueue_script('swiper-scripts', LANIAKEA_THEME_URI . '/core/assets/swiper/swiper-bundle.min.js', array(), '11.0.5', true);
// Inline styles
add_filter('laniakea-inline-style', 'laniakea_dynamic_style');
$theme_dynamic_css = apply_filters('laniakea-inline-style', '');
wp_register_style('laniakea-dyna-style', false);
wp_enqueue_style('laniakea-dyna-style');
wp_add_inline_style('laniakea-dyna-style', $theme_dynamic_css);
}
add_action('wp_enqueue_scripts', 'laniakea_enqueue_scripts');
function laniakea_enqueue_admin_scripts()
{ //fontawesome css
wp_enqueue_style('fontawesome-style', LANIAKEA_THEME_URI . '/core/assets/fontawesome/css/all.min.css', array());
wp_enqueue_style('laniakea-admin-style', LANIAKEA_THEME_URI . '/laniakea-admin.css', array());
wp_enqueue_script('laniakea-admin-scripts', LANIAKEA_THEME_URI . '/core/assets/js/admin.js', array(), '1.0', true);
//ace js
wp_enqueue_script('laniakea-ace-scripts', LANIAKEA_THEME_URI . '/core/assets/ace/ace.js', array(), '1.0', false);
}
add_action('admin_enqueue_scripts', 'laniakea_enqueue_admin_scripts');
add_action('after_setup_theme', 'laniakea_setup');
function laniakea_setup()
{
// Add multilanguage support
load_theme_textdomain('laniakea', LANIAKEA_THEME_DIR . 'languages');
// Add theme support for feed links
add_theme_support('automatic-feed-links');
// Manage the document title tag
add_theme_support('title-tag');
// Add theme support for menus
if (function_exists('register_nav_menus')) {
register_nav_menus(
array(
'laniakea-pre-header-menu' => 'Pre Header Menu',
'laniakea-header-menu' => 'Header Menu',
'laniakea-footer-menu' => 'Footer Menu',
)
);
}
// Enable support for Blog Posts Thumbnails
add_theme_support('post-thumbnails');
// Selective Refresh Support for Widgets
add_theme_support('customize-selective-refresh-widgets');
// Enable support for WooCommerce
add_theme_support('woocommerce', array(
'thumbnail_image_width' => 400,
'gallery_thumbnail_image_width' => 400,
'single_image_width' => 800,
));
add_theme_support('wc-product-gallery-lightbox');
// Switch default core markup for search form, comment form, and comments to output valid HTML5.
add_theme_support('html5', array(
'style',
'script',
));
// Remove block-based widget support
remove_theme_support('widgets-block-editor');
}
// ------------------------------------------------------------------------
// Content Width
// ------------------------------------------------------------------------
function laniakea_set_content_width()
{
if (!isset($content_width)) {
$content_width = laniakea_option('content_width', 1300);
}
}
add_action('wp', 'laniakea_set_content_width');
// ------------------------------------------------------------------------
// Blog functionality
// ------------------------------------------------------------------------
// Custom blog navigation
function laniakea_blog_prev_link($output)
{
return str_replace('<a href=', '<a class="prev" href=', $output);
}
add_filter('previous_post_link', 'laniakea_blog_prev_link');
function laniakea_blog_next_link($output)
{
return str_replace('<a href=', '<a class="next" href=', $output);
}
add_filter('next_post_link', 'laniakea_blog_next_link');
// Excerpt length
function laniakea_excerpt_length($length)
{
return 23;
}
add_filter('excerpt_length', 'laniakea_excerpt_length');
if (class_exists('WPBakeryShortCode')) {
if (!function_exists('laniakea_vc_set_as_theme')) {
function laniakea_vc_set_as_theme()
{
vc_set_as_theme($disable_updater = true);
}
}
}
add_action('vc_before_init', 'laniakea_vc_set_as_theme');
function LANIAKEA_MAINTENANCE_MODE($template)
{
$maintenance_mode = LANIAKEA_MAINTENANCE_MODE;
$new_template = locate_template(array('maintenance-page-template.php'));
if ($maintenance_mode && !is_user_logged_in()) {
return $new_template;
}
return $template;
}
add_action('template_include', 'LANIAKEA_MAINTENANCE_MODE', 1);
function laniakea_dynamic_style()
{
ob_start();
include_once(LANIAKEA_THEME_DIR . 'core/dynamic-styles.php');
$dynamic_css = ob_get_clean();
$dynamic_css = laniakea_compress_css($dynamic_css);
return $dynamic_css;
}
<?php
/**
* Abilita custom field per Iubenda popup nei menu
*/
function laniakea_menu_item_iubenda($item_id, $item)
{
$menu_item_iubenda = get_post_meta($item_id, '_menu_item_iubenda', true);
?>
<div style="clear: both;">
<label for="menu-item-iubenda-<?php echo $item_id; ?>">Iubenda Popup</label>
<input type="hidden" class="nav-menu-id" value="<?php echo $item_id; ?>" />
<div class="logged-input-holder">
<input type="checkbox" name="_menu_item_iubenda[<?php echo $item_id; ?>]" id="menu-item-iubenda-<?php echo $item_id; ?>" value="1" <?php checked($menu_item_iubenda, 1, true); ?> />
</div>
</div>
<?php
}
add_action('wp_nav_menu_item_custom_fields', 'laniakea_menu_item_iubenda', 10, 2);
function laniakea_save_menu_item_iubenda($menu_id, $menu_item_db_id)
{
if (isset($_POST['_menu_item_iubenda'][$menu_item_db_id])) {
update_post_meta($menu_item_db_id, '_menu_item_iubenda', $_POST['_menu_item_iubenda'][$menu_item_db_id]);
} else {
delete_post_meta($menu_item_db_id, '_menu_item_iubenda');
}
}
add_action('wp_update_nav_menu_item', 'laniakea_save_menu_item_iubenda', 10, 2);
function laniakea_add_specific_menu_atts($atts, $item, $args)
{
$menu_item_iubenda = get_post_meta($item->ID, '_menu_item_iubenda', true);
if ($menu_item_iubenda == 1) {
$atts['class'] = 'iubenda-nostyle no-brand iubenda-noiframe iubenda-embed iubenda-noiframe';
}
return $atts;
}
add_filter('nav_menu_link_attributes', 'laniakea_add_specific_menu_atts', 10, 3);
\ No newline at end of file
<?php
/**
* Calls the class on the post edit screen.
*/
function call_LaniakeaMetaBoxes()
{
new LaniakeaMetaBoxes();
}
if (is_admin()) {
add_action('load-post.php', 'call_LaniakeaMetaBoxes');
add_action('load-post-new.php', 'call_LaniakeaMetaBoxes');
}
/**
* The Class.
*/
class LaniakeaMetaBoxes
{
/**
* Hook into the appropriate actions when the class is constructed.
*/
public function __construct()
{
add_action('add_meta_boxes', array($this, 'add_meta_box'));
add_action('save_post', array($this, 'save'));
}
/**
* Adds the meta box container.
*/
public function add_meta_box($post_type)
{
// Limit meta box to certain post types.
$post_types = array('post', 'page');
if (in_array($post_type, $post_types)) {
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
add_meta_box(
'laniakea_header_box',
__('Laniakea | Intestazione Pagina', 'laniakea'),
array($this, 'render_header_box'),
$post_type,
'advanced',
'high'
);
}
}
/**
* Save the meta when the post is saved.
*
* @param int $post_id The ID of the post being saved.
*/
public function save($post_id)
{
/*
* We need to verify this came from the our screen and with proper authorization,
* because save_post can be triggered at other times.
*/
// Check if our nonce is set.
if (!isset($_POST['laniakea_box_nonce'])) {
return $post_id;
}
$nonce = $_POST['laniakea_box_nonce'];
// Verify that the nonce is valid.
if (!wp_verify_nonce($nonce, 'laniakea_box')) {
return $post_id;
}
/*
* If this is an autosave, our form has not been submitted,
* so we don't want to do anything.
*/
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return $post_id;
}
// Check the user's permissions.
if ('page' == $_POST['post_type']) {
if (!current_user_can('edit_page', $post_id)) {
return $post_id;
}
} else {
if (!current_user_can('edit_post', $post_id)) {
return $post_id;
}
}
/* OK, it's safe for us to save the data now. */
// Sanitize the user input.
$header_title = sanitize_text_field($_POST['laniakea_header_title']);
$header_show = isset($_POST['laniakea_show_header']) ? 1 : 0;
$transparent_header = isset($_POST['laniakea_transparent_header']) ? 1 : 0;
// Update the meta field.
update_post_meta($post_id, 'laniakea_header_title', $header_title);
update_post_meta($post_id, 'laniakea_show_header', $header_show);
update_post_meta($post_id, 'laniakea_transparent_header', $transparent_header);
update_post_meta($post_id, 'laniakea_header_bg', sanitize_hex_color($_POST['laniakea_header_bg']));
}
/**
* Render Meta Box content.
*
* @param WP_Post $post The post object.
*/
public function render_header_box($post)
{
// Add an nonce field so we can check for it later.
wp_nonce_field('laniakea_box', 'laniakea_box_nonce');
// Use get_post_meta to retrieve an existing value from the database.
$laniakea_show_header = get_post_meta($post->ID, 'laniakea_show_header', true);
$laniakea_header_title = get_post_meta($post->ID, 'laniakea_header_title', true);
$laniakea_transparent_header = get_post_meta($post->ID, 'laniakea_transparent_header', true);
$laniakea_header_bg = get_post_meta($post->ID, 'laniakea_header_bg', true);
// Display the form, using the current value.
?>
<div class="laniakea-meta-box">
<div class="field-group">
<input type="checkbox" id="laniakea_show_header" name="laniakea_show_header" value="1" <?php checked($laniakea_show_header, 1, true); ?> />
<label for="laniakea_show_header">
<?php _e('Mostra Intestazione', 'laniakea'); ?>
</label>
</div>
<div class="field-group">
<input type="checkbox" id="laniakea_transparent_header" name="laniakea_transparent_header" value="1" <?php checked($laniakea_transparent_header, 1, true); ?> />
<label for="laniakea_transparent_header">
<?php _e('Menu trasparente', 'laniakea'); ?>
</label>
</div>
<div class="field-group color-picker">
<label for="laniakea_header_bg">
<?php _e('Background Intestazione', 'laniakea'); ?>
</label>
<input type="text" id="laniakea_header_bg" name="laniakea_header_bg" value="<?php echo esc_attr($laniakea_header_bg); ?>" />
</div>
<div class="field-group">
<label for="laniakea_header_title">
<?php _e('Titolo Intestazione', 'laniakea'); ?>
</label>
<input type="text" id="laniakea_header_title" name="laniakea_header_title" value="<?php echo esc_attr($laniakea_header_title); ?>" style="width:100%" />
</div>
</div>
<?php
}
}
<?php
class LaniakeaBaseShortCode
{
public $template;
public $args;
public $atts = [];
public $shortname;
public function __construct($shortname, $templatePath, $args)
{
$this->template = $templatePath;
$this->shortname = $shortname;
$this->args = is_callable($args) ? $args() : $args;
if ($this->args) {
$this->atts = $this->args['atts'];
}
add_shortcode($shortname, array($this, 'shortcodefn'));
}
function shortcodefn($atts)
{
$this->atts = shortcode_atts($this->atts, $atts, $this->shortname);
$path = LANIAKEA_THEME_DIR . 'core/shortcodes/templates/' . $this->template;
if (is_file($path)) {
ob_start();
include $path;
return ob_get_clean();
}
}
}
<?php
class SocialController {
public static function init(){
$socials = laniakea_get_socials();
$arr = [];
array_map(function ($social) use (&$arr) {
$option = laniakea_option('social_' . $social['name']);
if (!empty($option)) {
$arr[] = [
'link' => $option,
'icon' => $social['icon'],
'title' => $social['label'],
'name' => $social['name']
];
}
}, $socials);
return [
'atts' => [
'align' => 'left',
'size' => ''
],
'socials' => $arr
];
}
}
\ No newline at end of file
<?php
class SwiperController
{
public static function init()
{
return [
'atts' => [
'custom_post' => '',
'gruppo' => '',
'initialslide' => '0',
'loop' => true,
'spacebetween' => 16,
'centeredslides' => true,
'button_text' => '',
'button_color' => 'white'
]
];
}
}
<?php
require_once LANIAKEA_THEME_DIR . 'core/shortcodes/base-shortcode.php';
require_once LANIAKEA_THEME_DIR . 'core/shortcodes/controllers/social.controller.php';
require_once LANIAKEA_THEME_DIR . 'core/shortcodes/controllers/swiper.controller.php';
new LaniakeaBaseShortCode("laniakea-social", "social.template.php", SocialController::init());
new LaniakeaBaseShortCode("laniakea-swiper", "swiper.template.php", SwiperController::init());
<?php
$size = !empty($this->atts['size']) ? "style='font-size:{$this->atts['size']}px;' " : '';
?>
<div class="laniakea-social <?php echo 'align-' . $this->atts['align'] ?>">
<?php foreach ($this->args['socials'] as $social) : ?>
<a target="_blank" <?php echo $size;?> class="social-<?php echo $social['name']; ?>" href="<?php echo $social['link']; ?>" alt="<?php echo $social['title']; ?>" title="<?php echo $social['title']; ?>">
<i class="<?php echo $social['icon']; ?>"></i>
</a>
<?php endforeach; ?>
</div>
\ No newline at end of file
<?php
//https://swiperjs.com/swiper-api
$post_type = !empty($this->atts['custom_post']) ? $this->atts['custom_post'] : 'laniakea_swiper';
if (!empty($this->atts['custom_post'])) {
$args = array(
'post_type' => $this->atts['custom_post'],
'post_status' => 'publish',
'order' => 'ASC',
'orderby' => 'menu_order',
);
} else {
$args = array(
'post_type' => 'laniakea_swiper',
'post_status' => 'publish',
'order' => 'ASC',
'orderby' => 'menu_order',
'tax_query' => array(
array(
'taxonomy' => 'swiper_group',
'field' => 'slug',
'terms' => $this->atts['gruppo'],
)
),
);
}
$the_query = new WP_Query($args);
if ($this->atts['gruppo']) {
$term = get_term_by('slug',$this->atts['gruppo'],'swiper_group');
$term_meta = get_option("taxonomy_term_$term->term_id");
$swiper_json = wp_unslash($term_meta["swiper_group_json"]);
}
if ($the_query->have_posts()) : ?>
<div class="swiper">
<div class="swiper-wrapper">
<?php while ($the_query->have_posts()) :
$the_query->the_post();
$link = $post_type == 'laniakea_swiper' ? get_post_meta(get_the_ID(), 'slide_link', true) : get_the_permalink();
?>
<div class="swiper-slide">
<div class="card">
<?php if (!empty($this->atts['button_text'])) : ?>
<div class="vc_btn3-container vc_btn3-inline">
<a href="<?php echo $link; ?>" class="vc_general vc_btn3 vc_btn3-size-lg vc_btn3-shape-square vc_btn3-style-flat vc_btn3-color-<?php echo $this->atts['button_color'] ?>">
<?php echo $this->atts['button_text'] ?>
</a>
</div>
<?php else : ?>
<a class="card__link" href="<?php echo $link; ?>"></a>
<?php endif; ?>
<div class="card__inner">
<div class="card_image">
<?php the_post_thumbnail('large'); ?>
</div>
<div class="card_caption">
<?php the_title() ?>
</div>
<?php if( $post_type == 'laniakea_swiper'):?>
<div class="card_content">
<?php the_content() ?>
</div>
<?php endif;?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<div class="swiper-pagination"></div>
<figure class="swiper-button-prev"></figure>
<figure class="swiper-button-next"></figure>
<div class="swiper-scrollbar"></div>
</div>
<?php endif; ?>
<script>
function ready(fn) {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
const swiperOptions = <?php
if (!empty($swiper_json)) {
echo $swiper_json;
} else {
echo "
{
speed: 400,
slidesPerView: 1,
spaceBetween: ".$this->atts['spacebetween'].",
loop: ".$this->atts['loop'].",
initialSlide: ".$this->atts['initialslide']." ,
centeredSlides: false,
centerInsufficientSlides: false,
scrollbar: {
enabled: false
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
freeMode: {
enabled: true,
},
breakpoints: {
1280: {
slidesPerView: 4
},
1024: {
slidesPerView: 3
},
768: {
slidesPerView: 2
}
},
}";
}
?>
ready(function() {
const swiper = new Swiper('.swiper', swiperOptions);
});
</script>
\ No newline at end of file
<?php
// Allow SVG
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {
global $wp_version;
if ( $wp_version !== '4.7.1' ) {
return $data;
}
$filetype = wp_check_filetype( $filename, $mimes );
return [
'ext' => $filetype['ext'],
'type' => $filetype['type'],
'proper_filename' => $data['proper_filename']
];
}, 10, 4 );
function cc_mime_types( $mimes ){
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter( 'upload_mimes', 'cc_mime_types' );
function laniakea_fix_svg() {
echo '<style type="text/css">
.attachment-266x266, .thumbnail img {
width: 100% !important;
height: auto !important;
}
</style>';
}
current_user_can( 'manage_options' ) && add_action( 'admin_head', 'laniakea_fix_svg' );
\ No newline at end of file
<?php
class LaniakeaSwiperCPT
{
public $swiper_options = "
{
speed: 400,
slidesPerView: 1,
spaceBetween: 16,
loop: true,
initialSlide: '0',
centeredSlides: false,
centerInsufficientSlides: false,
scrollbar: {
enabled: false
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
freeMode: {
enabled: true,
},
breakpoints: {
1280: {
slidesPerView: 4
},
1024: {
slidesPerView: 3
},
768: {
slidesPerView: 2
}
},
}
";
public function __construct()
{
add_action('init', array($this, 'register_cpt'));
add_action('save_post', array($this, 'save_metabox'), 10, 2);
//swiper group custom fields:
add_action('swiper_group_edit_form_fields', array($this, 'swiper_group_custom_fields'), 10, 2);
add_action('edited_swiper_group', array($this, 'save_swiper_group_custom_fields'), 10, 2);
}
function register_cpt($hook)
{
global $pagenow;
//SWIPER
register_post_type(
'laniakea_swiper',
array(
'labels' => array(
'name' => __('Swiper Slide', 'laniakea'),
'singular_name' => __('Swiper Slide', 'laniakea'),
'add_new' => __('Aggiungi nuovo', 'laniakea'),
'add_new_item' => __('Aggiungi nuovo Swiper Slide', 'laniakea'),
'edit_item' => __('Modifica Swiper Slide', 'laniakea'),
'view_item' => __('Vedi Swiper Slide', 'laniakea'),
'all_items' => __('Tutti gli Swiper Slides', 'laniakea'),
'not_found' => __('Nessun Swiper Slides', 'laniakea'),
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail', 'revisions',),
'taxonomies' => array('swiper_group'),
'register_meta_box_cb' => array($this, 'register_metaboxes'),
)
);
//RIMUOVE EDITOR VISUALE DALLO SWIPER:
if ('post.php' == $pagenow) {
$type = get_post_type($_GET['post']);
if ('laniakea_swiper' == $type)
add_filter('user_can_richedit', '__return_false');
} elseif ('post-new.php' == $pagenow) {
if (isset($_GET['post_type']) && $_GET['post_type'] == 'laniakea_swiper')
add_filter('user_can_richedit', '__return_false');
}
//SWIPER TAXONOMY
register_taxonomy('swiper_group', ['laniakea_swiper'], [
'label' => __('Gruppi Slide', 'laniakea'),
'hierarchical' => true,
'rewrite' => ['slug' => 'swiper-group'],
'show_admin_column' => true,
'show_in_rest' => true,
'labels' => [
'singular_name' => __('Genre', 'laniakea'),
'all_items' => __('Tutti i Gruppi Slide', 'laniakea'),
'edit_item' => __('Modifica Gruppo Slide', 'laniakea'),
'view_item' => __('Vedi Gruppo Slide', 'laniakea'),
'update_item' => __('Aggiorna Gruppo Slide', 'laniakea'),
'add_new_item' => __('Aggiungi Nuovo Gruppo Slide', 'laniakea'),
'new_item_name' => __('Nuovo nome Gruppo Slide', 'laniakea'),
'search_items' => __('Cerca Gruppi Slide', 'laniakea'),
'not_found' => __('Nessun Gruppo Slide', 'laniakea'),
]
]);
register_taxonomy_for_object_type('swiper_group', 'laniakea_swiper');
}
function register_metaboxes()
{
add_meta_box(
'Swiper Slide Link',
'Features',
array($this, 'render_metabox'),
'laniakea_swiper',
'advanced',
'high'
);
}
public function render_metabox($post)
{
wp_nonce_field('laniakea_nonce_action', 'laniakea_nonce_name');
?>
<div class="field-group">
<label>Link della slide</label>
<input type="text" name="slide_link" value="<?php echo get_post_meta($post->ID, 'slide_link', true); ?>" />
</div>
<?php
}
public function save_metabox($post_id, $post)
{
// Add nonce for security and authentication.
$nonce_name = isset($_POST['laniakea_nonce_name']) ? $_POST['laniakea_nonce_name'] : '';
$nonce_action = 'laniakea_nonce_action';
// Check if nonce is valid.
if (!wp_verify_nonce($nonce_name, $nonce_action)) {
return;
}
// Check if user has permissions to save data.
if (!current_user_can('edit_post', $post_id)) {
return;
}
// Check if not an autosave.
if (wp_is_post_autosave($post_id)) {
return;
}
// Check if not a revision.
if (wp_is_post_revision($post_id)) {
return;
}
if (isset($_POST['slide_link'])) update_post_meta($post_id, 'slide_link', $_POST['slide_link']);
}
public function swiper_group_custom_fields($tag)
{
$term_id = $tag->term_id;
$term_meta = get_option("taxonomy_term_$term_id");
$term_meta_value = isset($term_meta['swiper_group_json']) ? $term_meta['swiper_group_json'] : $this->swiper_options;
?>
<tr class="form-field">
<th scope="row" valign="top">
<label for="swiper_group_json">Swiper Options</label>
</th>
<td>
<pre id="swiper_options_ace_editor"></pre>
<textarea id="swiper_options_textarea" name="term_meta[swiper_group_json]" id="term_meta[swiper_group_json]"><?php echo esc_textarea(wp_unslash($term_meta_value)); ?></textarea>
<span class="description"><a href="https://swiperjs.com/swiper-api#parameters" target="_blank">SwiperJs API</a></span>
</td>
</tr>
<script>
const swiperOptionsTextarea = document.getElementById('swiper_options_textarea');
var editor = ace.edit("swiper_options_ace_editor", {
mode: "ace/mode/javascript",
theme: "ace/theme/twilight",
value: swiperOptionsTextarea.value,
useWorker: false,
});
editor.session.on('change', function(delta) {
// delta.start, delta.end, delta.lines, delta.action
const value = editor.getValue();
swiperOptionsTextarea.value = value;
});
</script>
<?php
}
function save_swiper_group_custom_fields($term_id)
{
if (isset($_POST['term_meta'])) {
$t_id = $term_id;
$term_meta = get_option("taxonomy_term_$t_id");
$cat_keys = array_keys($_POST['term_meta']);
foreach ($cat_keys as $key) {
if (isset($_POST['term_meta'][$key])) {
$term_meta[$key] = trim($_POST['term_meta'][$key]);
}
}
//save the option array
update_option("taxonomy_term_$t_id", $term_meta);
}
}
}
new LaniakeaSwiperCPT();
# How To Contribute
Thanks for reading our contribution guidelines.
The following guidelines for contribution should be followed if you want to submit a pull request.
## How To Prepare
* You need a [GitHub account](https://github.com/signup/free).
* Before reporting a bug or suggesting an improvement, please check the `develop` branch to see if it has already been addressed.
* Duplicate tickets will be closed without hesitation, so please check through existing tickets first to see if someone else has already discussed it.
* Submit an [issue ticket] for your issue if there is not one yet.
* Describe the issue and include steps to reproduce if it's a bug.
* If the issue is a bug, add any relevant JavaScript or PHP error messages. For PHP error messages, a backtrace is preferred. If you don't know how to get one, please [follow these instructions](https://gist.github.com/jrfnl/5925642).
* Include relevant version numbers.
* Additional screenshots or videos are often helpful.
* If you are able and want to fix this, fork the repository on GitHub.
## Make Changes
We use the [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model. Before reporting a bug or new feature, please check the `develop` branch to see if it's already been addressed.
* In your forked repository, create a topic branch for your upcoming patch. Usually this is based on the `develop` branch.
* For enhancements, name the branch according to the feature e.g. `feature/auto-activate`.
* For un-reported bug fixes, add a `fix-` prefix e.g. `feature/fix-admin-notices`.
* For code that addresses an existing Issue, add the Issue number as a prefix e.g. `feature/123-auto-activate` or `feature/321-fix-admin-notices`.
* Please avoid working directly on the `develop` branch.
* Code should follow the [WordPress Coding Standards for PHP](https://make.wordpress.org/core/handbook/coding-standards/php/).
* Use [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) with the [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) sniffs to check. Since we use `phpcs.xml`, you should be able to navigate on command line to the root of the repo and just run `phpcs` without any arguments.
* Make commits of logical units and describe them properly.
* Check for unnecessary whitespace with `git diff --check` before committing.
## Commit Messages
We suggest you follow best practices for commit messages:
* Separate subject (first line) from body with a blank line.
* Limit the subject line to 50 characters.
* Capitalize the subject line.
* Do not end the subject line with a period.
* Use the imperative mood in the subject line.
* Wrap the body at 72 characters.
* Use the body to explain _what_ and _why_ versus _how_.
* Please [reference any existing issue](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message.
Read [this post](http://chris.beams.io/posts/git-commit/) for more detail.
## Submit Changes
* Push your changes to a topic branch in your fork of the repository.
* Open a pull request to the original repository and choose the correct original branch (probably `develop`) you want to patch.
* Do not close any issue you referenced in your commit message.
* If you have write access to the repository, do not directly push or merge your own pull-requests. Add the `[reviewmerge]` label when your branch is considered complete and let another team member review your pull request and approve.
## License
All submissions are agreed to be licensed under the same license as present in the repository.
## Security
There is no need to sign-off or GPG sign your commits. Tags (from 2.4.1 onwards) will be GPG signed.
# Additional Resources
* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/).
* [Read the Issue Guidelines by @necolas](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md) for more details,
[issue ticket]: https://github.com/TGMPA/TGM-Plugin-Activation/issues
[reviewmerge]: https://github.com/TGMPA/TGM-Plugin-Activation/labels/reviewmerge
# TGM Plugin Activation
[![GitHub license](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://raw.githubusercontent.com/TGMPA/TGM-Plugin-Activation/develop/LICENSE.md)
[![Build Status](https://travis-ci.org/TGMPA/TGM-Plugin-Activation.svg?branch=develop)](https://travis-ci.org/TGMPA/TGM-Plugin-Activation)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/TGMPA/TGM-Plugin-Activation/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/TGMPA/TGM-Plugin-Activation/?branch=develop)
**Lead Developers:**
[Thomas Griffin](https://github.com/thomasgriffin) ([@jthomasgriffin](https://twitter.com/jthomasgriffin)), [Gary Jones](https://github.com/GaryJones) ([@GaryJ](https://twitter.com/GaryJ)), [Juliette Reinders Folmer](https://github.com/jrfnl) ([@jrf_nl](https://twitter.com/jrf_nl))
**Version:** 2.6.1
**Requires at least:** 3.7.0
**Tested up to:** 4.5.2
## Description
TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
## Installation
1. Generate a customized version of the latest version of TGMPA based on your intended use-case using the [Custom TGMPA Generator](http://tgmpluginactivation.com/download/).
2. Extract the class file and place it somewhere in your theme hierarchy.
3. Add a `require_once` call within `functions.php` (or other file) referencing the class file.
4. Create a function, hooked to `tgmpa_register`, that registers the plugin and configurations.
For steps 3 and 4, it is recommended you view, copy and paste the contents of `example.php`
and amend to suit. The `example.php` file is a model for how you should include the class in your theme.
Detailed documentation on [how to configure TGMPA](http://tgmpluginactivation.com/configuration/) is available on the website.
__*We strongly recommend the use of the [Custom TGMPA Generator](http://tgmpluginactivation.com/download/) if you intend to use TGMPA in a theme which is to be published via WordPress.org or Themeforest.*__
The generated customized version of TGMPA will comply with the Theme Review guidelines and Theme Check.
### Composer
TGM Plugin Activation is also available as a [package](https://packagist.org/packages/tgmpa/tgm-plugin-activation) installable via Composer:
~~~sh
composer create-project tgmpa/tgm-plugin-activation --no-dev
~~~
## Frequently Asked Questions
See [the FAQ page](http://tgmpluginactivation.com/faq/).
## Feedback
See https://github.com/TGMPA/TGM-Plugin-Activation/issues for current issues and the [guidelines for reporting bugs and enhancements](https://github.com/TGMPA/TGM-Plugin-Activation/wiki/Guidelines-for-reporting-bugs).
__Note:__ TGM Plugin Activation library authors are not responsible for the *end-user support* for any plugin or theme which uses the library.
## Changelog
See [CHANGELOG.md](CHANGELOG.md).
## Contributing to TGM Plugin Activation
If you have a patch, or stumbled upon an issue with TGM Plugin Activation core, you can contribute this back to the code. Please read our [contributor guidelines](CONTRIBUTING.md) for more information how you can do this.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
function laniakea_sidebars_register()
{
register_sidebar( array(
'name' =>'Blog Sidebar',
'id' => 'blog-sidebar',
'class' => '',
'description' =>'Add widgets for the blog sidebar area. If none added, default sidebar widgets will be used.',
'before_widget' => '<div id="%1$s" class="blog_widget widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5 class="widget-title"><span>',
'after_title' => '</span></h5>',
) );
register_sidebar( array(
'name' =>'Shop Sidebar',
'id' => 'shop-sidebar',
'class' => '',
'description' =>'Add widgets for the shop sidebar area.',
'before_widget' => '<div id="%1$s" class="blog_widget widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5 class="widget-title"><span>',
'after_title' => '</span></h5>',
) );
register_sidebar( array(
'name' =>'Footer first widget area',
'id' => 'footer-first-widget-area',
'class' => '',
'description' =>'Add one widget for the first footer widget area.',
'before_widget' => '<div id="%1$s" class="footer_widget widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5 class="widget-title"><span>',
'after_title' => '</span></h5>',
) );
register_sidebar( array(
'name' =>'Footer second widget area',
'id' => 'footer-second-widget-area',
'class' => '',
'description' =>'Add one widget for the second footer widget area.',
'before_widget' => '<div id="%1$s" class="footer_widget widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5 class="widget-title"><span>',
'after_title' => '</span></h5>',
) );
register_sidebar( array(
'name' =>'Footer third widget area',
'id' => 'footer-third-widget-area',
'class' => '',
'description' =>'Add one widget for the third footer widget area.',
'before_widget' => '<div id="%1$s" class="footer_widget widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5 class="widget-title"><span>',
'after_title' => '</span></h5>',
) );
register_sidebar( array(
'name' =>'Footer fourth widget area',
'id' => 'footer-fourth-widget-area',
'class' => '',
'description' =>'Add one widget for the fourth footer widget area.',
'before_widget' => '<div id="%1$s" class="footer_widget widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5 class="widget-title"><span>',
'after_title' => '</span></h5>',
) );
}
add_action('widgets_init', 'laniakea_sidebars_register');
<?php
add_action('wpcf7_init', 'custom_add_form_tag_clock');
function custom_add_form_tag_clock()
{
wpcf7_add_form_tag('clock', 'custom_clock_form_tag_handler'); // "clock" is the type of the form-tag
}
function custom_clock_form_tag_handler($tag)
{
return date_i18n(get_option('time_format'));
}
add_action('wpcf7_admin_init', 'clock_add_tag_generator', 55); // A
function clock_add_tag_generator()
{
$tag_generator = WPCF7_TagGenerator::get_instance();
$tag_generator->add(
'clock',
'CLOCK',
'clock_tag_generator',
array('nameless' => 1)
);
}
function clock_tag_generator($contact_form, $args = '')
{
$args = wp_parse_args($args, array()); ?>
<div class="insert-box">
<input type="text" name="clock" class="tag code" readonly="readonly" onfocus="this.select()" />
<div class="submitbox">
<input type="button" class="button button-primary insert-tag"
value="<?php echo esc_attr(__('Insert Tag', 'contact-form-7')); ?>" />
</div>
</div>
<?php
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment