added lot of things

This commit is contained in:
infeeeee
2019-07-18 23:55:33 +02:00
parent 0f3aaed434
commit 7ea5c5d1e8
13 changed files with 538 additions and 230 deletions

View File

@@ -16,11 +16,17 @@ External Modules/Files
//ChromePhp::log('Hello console!');
// Debug $data will display in console
function console_debug( $data ) {
function console_debug($data)
{
$data = json_encode($data);
echo "<script>console.dir($data)</script>";
}
/**
* Customizer additions.
*/
include get_template_directory() . '/customizer.php';
/*------------------------------------*\
Theme Support
\*------------------------------------*/
@@ -144,16 +150,16 @@ function dis2019_header_scripts()
wp_register_script('modernizr', get_template_directory_uri() . '/js/lib/modernizr-custom.js', array(), '2.7.1'); // Modernizr
wp_enqueue_script('modernizr'); // Enqueue it!
wp_register_script('simpler-sidebar', get_template_directory_uri() . '/js/lib/jquery.simpler-sidebar.min.js', array('jquery'), '2.2.5'); //
wp_register_script('simpler-sidebar', get_template_directory_uri() . '/js/lib/jquery.simpler-sidebar.min.js', array('jquery'), '2.2.5'); //
wp_enqueue_script('simpler-sidebar'); // Enqueue it!
// wp_register_script('snap-scroll', get_template_directory_uri() . '/js/lib/snap-scroll.min.js', array('jquery'), '1.0.0'); //
// wp_register_script('snap-scroll', get_template_directory_uri() . '/js/lib/snap-scroll.min.js', array('jquery'), '1.0.0'); //
// wp_enqueue_script('snap-scroll'); // Enqueue it!
wp_register_script('jquery.colorbox', get_template_directory_uri() . '/js/lib/jquery.colorbox-min.js', array('jquery'), '1.0.0'); //
wp_register_script('jquery.colorbox', get_template_directory_uri() . '/js/lib/jquery.colorbox-min.js', array('jquery'), '1.0.0'); //
wp_enqueue_script('jquery.colorbox'); // Enqueue it!
wp_register_script('lettering', get_template_directory_uri() . '/js/lib/jquery.lettering.js', array('jquery'), '1.0.0'); //
wp_register_script('lettering', get_template_directory_uri() . '/js/lib/jquery.lettering.js', array('jquery'), '1.0.0'); //
wp_enqueue_script('lettering'); // Enqueue it!
wp_register_script('dis2019scripts', get_template_directory_uri() . '/js/scripts.js', array(
@@ -196,12 +202,11 @@ function dis2019_styles()
}
//remove events from home page
// !!!add event cat id to here!!!!
//search keywords: event esemeny esemény category
function exclude_category_home($query)
{
if ($query->is_home) {
$query->set('cat', '-5');
$minus_catid = '-' . get_theme_mod('dis-2019-event-cat-id');
$query->set('cat', $minus_catid);
}
return $query;
@@ -209,17 +214,13 @@ function exclude_category_home($query)
add_filter('pre_get_posts', 'exclude_category_home');
// order events by date on events page
// !!!add event cat id to here!!!!
//search keywords: event esemeny esemény category
add_action('pre_get_posts', 'dis_2019_order_events_by_date', 1);
function dis_2019_order_events_by_date(&$query)
{
//Before anything else, make sure this is the right query...
if (!$query->get('category_name') == 'esemeny') {
if (!$query->get('category_name') == get_theme_mod('dis-2019-event-cat-slug')) {
return;
}
@@ -522,15 +523,16 @@ function dis_2019_more_posts_on_home(&$query)
if (!$query->is_home() && !$query->is_archive()) {
return;
}
if ($query->is_home()) {
$pposts = 14;
$pposts = get_theme_mod( 'dis-2019-posts-on-home' );
} elseif ($query->is_tag()) {
$pposts = 10;
$pposts = get_theme_mod( 'dis-2019-posts-on-tag' );;
} elseif (!$query->in_the_loop()) {
return;
} else {
$pposts = 6;
$pposts = get_option( 'posts_per_page' );
// $pposts = 6;
}
//set post_per_page if it's homepage
@@ -734,7 +736,6 @@ function dis2019_register_taxonomy_writer()
'not_found' => __('No writer found', 'dis2019'),
'back_to_items' => __('Back to writers', 'dis2019'),
];
$args = [
'hierarchical' => false, // make it hierarchical (like categories)