@@ -0,0 +1,348 @@ | |||
{ | |||
"team":{ | |||
"name":"team", | |||
"label":"Team", | |||
"singular_label":"Team", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"show_ui":"true", | |||
"show_in_nav_menus":"true", | |||
"delete_with_user":"false", | |||
"show_in_rest":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"has_archive":"false", | |||
"has_archive_string":"", | |||
"exclude_from_search":"true", | |||
"capability_type":"post", | |||
"hierarchical":"false", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"menu_position":"6", | |||
"show_in_menu":"true", | |||
"show_in_menu_string":"", | |||
"menu_icon":"dashicons-groups", | |||
"supports":[ | |||
"title", | |||
"thumbnail", | |||
"excerpt", | |||
"revisions", | |||
"page-attributes" | |||
], | |||
"taxonomies":[ | |||
], | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"add_new":"", | |||
"add_new_item":"", | |||
"edit_item":"", | |||
"new_item":"", | |||
"view_item":"", | |||
"view_items":"", | |||
"search_items":"", | |||
"not_found":"", | |||
"not_found_in_trash":"", | |||
"parent_item_colon":"", | |||
"featured_image":"", | |||
"set_featured_image":"", | |||
"remove_featured_image":"", | |||
"use_featured_image":"", | |||
"archives":"", | |||
"insert_into_item":"", | |||
"uploaded_to_this_item":"", | |||
"filter_items_list":"", | |||
"items_list_navigation":"", | |||
"items_list":"", | |||
"attributes":"", | |||
"name_admin_bar":"", | |||
"item_published":"", | |||
"item_published_privately":"", | |||
"item_reverted_to_draft":"", | |||
"item_scheduled":"", | |||
"item_updated":"" | |||
}, | |||
"custom_supports":"" | |||
}, | |||
"faq":{ | |||
"name":"faq", | |||
"label":"FAQ", | |||
"singular_label":"FAQs", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"show_ui":"true", | |||
"show_in_nav_menus":"true", | |||
"delete_with_user":"false", | |||
"show_in_rest":"false", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"has_archive":"false", | |||
"has_archive_string":"", | |||
"exclude_from_search":"false", | |||
"capability_type":"post", | |||
"hierarchical":"false", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"menu_position":"7", | |||
"show_in_menu":"true", | |||
"show_in_menu_string":"", | |||
"menu_icon":"dashicons-welcome-learn-more", | |||
"supports":[ | |||
"title", | |||
"editor", | |||
"revisions", | |||
"page-attributes" | |||
], | |||
"taxonomies":[ | |||
"topic" | |||
], | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"add_new":"", | |||
"add_new_item":"", | |||
"edit_item":"", | |||
"new_item":"", | |||
"view_item":"", | |||
"view_items":"", | |||
"search_items":"", | |||
"not_found":"", | |||
"not_found_in_trash":"", | |||
"parent_item_colon":"", | |||
"featured_image":"", | |||
"set_featured_image":"", | |||
"remove_featured_image":"", | |||
"use_featured_image":"", | |||
"archives":"", | |||
"insert_into_item":"", | |||
"uploaded_to_this_item":"", | |||
"filter_items_list":"", | |||
"items_list_navigation":"", | |||
"items_list":"", | |||
"attributes":"", | |||
"name_admin_bar":"", | |||
"item_published":"", | |||
"item_published_privately":"", | |||
"item_reverted_to_draft":"", | |||
"item_scheduled":"", | |||
"item_updated":"" | |||
}, | |||
"custom_supports":"" | |||
}, | |||
"section":{ | |||
"name":"section", | |||
"label":"Sections", | |||
"singular_label":"Section", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"true", | |||
"show_ui":"true", | |||
"show_in_nav_menus":"true", | |||
"delete_with_user":"false", | |||
"show_in_rest":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"has_archive":"false", | |||
"has_archive_string":"", | |||
"exclude_from_search":"false", | |||
"capability_type":"post", | |||
"hierarchical":"false", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"menu_position":"21", | |||
"show_in_menu":"true", | |||
"show_in_menu_string":"", | |||
"menu_icon":"dashicons-excerpt-view", | |||
"supports":[ | |||
"title", | |||
"editor", | |||
"thumbnail", | |||
"page-attributes" | |||
], | |||
"taxonomies":[ | |||
"sectiongroup", | |||
"benefit" | |||
], | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"add_new":"", | |||
"add_new_item":"", | |||
"edit_item":"", | |||
"new_item":"", | |||
"view_item":"", | |||
"view_items":"", | |||
"search_items":"", | |||
"not_found":"", | |||
"not_found_in_trash":"", | |||
"parent_item_colon":"", | |||
"featured_image":"", | |||
"set_featured_image":"", | |||
"remove_featured_image":"", | |||
"use_featured_image":"", | |||
"archives":"", | |||
"insert_into_item":"", | |||
"uploaded_to_this_item":"", | |||
"filter_items_list":"", | |||
"items_list_navigation":"", | |||
"items_list":"", | |||
"attributes":"", | |||
"name_admin_bar":"", | |||
"item_published":"", | |||
"item_published_privately":"", | |||
"item_reverted_to_draft":"", | |||
"item_scheduled":"", | |||
"item_updated":"" | |||
}, | |||
"custom_supports":"" | |||
}, | |||
"news":{ | |||
"name":"news", | |||
"label":"News", | |||
"singular_label":"News", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"show_ui":"true", | |||
"show_in_nav_menus":"true", | |||
"delete_with_user":"false", | |||
"show_in_rest":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"has_archive":"false", | |||
"has_archive_string":"", | |||
"exclude_from_search":"false", | |||
"capability_type":"post", | |||
"hierarchical":"false", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"menu_position":"7", | |||
"show_in_menu":"true", | |||
"show_in_menu_string":"", | |||
"menu_icon":"dashicons-megaphone", | |||
"supports":[ | |||
"title", | |||
"thumbnail", | |||
"excerpt" | |||
], | |||
"taxonomies":[ | |||
], | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"add_new":"", | |||
"add_new_item":"", | |||
"edit_item":"", | |||
"new_item":"", | |||
"view_item":"", | |||
"view_items":"", | |||
"search_items":"", | |||
"not_found":"", | |||
"not_found_in_trash":"", | |||
"parent_item_colon":"", | |||
"featured_image":"", | |||
"set_featured_image":"", | |||
"remove_featured_image":"", | |||
"use_featured_image":"", | |||
"archives":"", | |||
"insert_into_item":"", | |||
"uploaded_to_this_item":"", | |||
"filter_items_list":"", | |||
"items_list_navigation":"", | |||
"items_list":"", | |||
"attributes":"", | |||
"name_admin_bar":"", | |||
"item_published":"", | |||
"item_published_privately":"", | |||
"item_reverted_to_draft":"", | |||
"item_scheduled":"", | |||
"item_updated":"" | |||
}, | |||
"custom_supports":"" | |||
}, | |||
"device":{ | |||
"name":"device", | |||
"label":"Devices", | |||
"singular_label":"Device", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"show_ui":"true", | |||
"show_in_nav_menus":"true", | |||
"delete_with_user":"false", | |||
"show_in_rest":"false", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"has_archive":"false", | |||
"has_archive_string":"", | |||
"exclude_from_search":"false", | |||
"capability_type":"post", | |||
"hierarchical":"false", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"menu_position":"7", | |||
"show_in_menu":"true", | |||
"show_in_menu_string":"", | |||
"menu_icon":"dashicons-admin-plugins", | |||
"supports":[ | |||
"title", | |||
"thumbnail", | |||
"excerpt" | |||
], | |||
"taxonomies":[ | |||
"basis", | |||
"plattform" | |||
], | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"add_new":"", | |||
"add_new_item":"", | |||
"edit_item":"", | |||
"new_item":"", | |||
"view_item":"", | |||
"view_items":"", | |||
"search_items":"", | |||
"not_found":"", | |||
"not_found_in_trash":"", | |||
"parent_item_colon":"", | |||
"featured_image":"", | |||
"set_featured_image":"", | |||
"remove_featured_image":"", | |||
"use_featured_image":"", | |||
"archives":"", | |||
"insert_into_item":"", | |||
"uploaded_to_this_item":"", | |||
"filter_items_list":"", | |||
"items_list_navigation":"", | |||
"items_list":"", | |||
"attributes":"", | |||
"name_admin_bar":"", | |||
"item_published":"", | |||
"item_published_privately":"", | |||
"item_reverted_to_draft":"", | |||
"item_scheduled":"", | |||
"item_updated":"" | |||
}, | |||
"custom_supports":"" | |||
} | |||
} |
@@ -0,0 +1,196 @@ | |||
{ | |||
"topic":{ | |||
"name":"topic", | |||
"label":"Topics", | |||
"singular_label":"Topic", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"hierarchical":"false", | |||
"show_ui":"true", | |||
"show_in_menu":"true", | |||
"show_in_nav_menus":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"1", | |||
"rewrite_hierarchical":"0", | |||
"show_admin_column":"true", | |||
"show_in_rest":"false", | |||
"show_in_quick_edit":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"edit_item":"", | |||
"view_item":"", | |||
"update_item":"", | |||
"add_new_item":"", | |||
"new_item_name":"", | |||
"parent_item":"", | |||
"parent_item_colon":"", | |||
"search_items":"", | |||
"popular_items":"", | |||
"separate_items_with_commas":"", | |||
"add_or_remove_items":"", | |||
"choose_from_most_used":"", | |||
"not_found":"", | |||
"no_terms":"", | |||
"items_list_navigation":"", | |||
"items_list":"" | |||
}, | |||
"meta_box_cb":"", | |||
"default_term":"", | |||
"object_types":[ | |||
"faq" | |||
] | |||
}, | |||
"sectiongroup":{ | |||
"name":"sectiongroup", | |||
"label":"Sectiongroups", | |||
"singular_label":"sectiongroup", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"hierarchical":"false", | |||
"show_ui":"true", | |||
"show_in_menu":"true", | |||
"show_in_nav_menus":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"1", | |||
"rewrite_hierarchical":"0", | |||
"show_admin_column":"true", | |||
"show_in_rest":"true", | |||
"show_in_quick_edit":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"edit_item":"", | |||
"view_item":"", | |||
"update_item":"", | |||
"add_new_item":"", | |||
"new_item_name":"", | |||
"parent_item":"", | |||
"parent_item_colon":"", | |||
"search_items":"", | |||
"popular_items":"", | |||
"separate_items_with_commas":"", | |||
"add_or_remove_items":"", | |||
"choose_from_most_used":"", | |||
"not_found":"", | |||
"no_terms":"", | |||
"items_list_navigation":"", | |||
"items_list":"" | |||
}, | |||
"meta_box_cb":"", | |||
"default_term":"", | |||
"object_types":[ | |||
"page", | |||
"section" | |||
] | |||
}, | |||
"benefit":{ | |||
"name":"benefit", | |||
"label":"Benefits", | |||
"singular_label":"Benefit", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"false", | |||
"hierarchical":"false", | |||
"show_ui":"true", | |||
"show_in_menu":"true", | |||
"show_in_nav_menus":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"1", | |||
"rewrite_hierarchical":"0", | |||
"show_admin_column":"false", | |||
"show_in_rest":"true", | |||
"show_in_quick_edit":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"edit_item":"", | |||
"view_item":"", | |||
"update_item":"", | |||
"add_new_item":"", | |||
"new_item_name":"", | |||
"parent_item":"", | |||
"parent_item_colon":"", | |||
"search_items":"", | |||
"popular_items":"", | |||
"separate_items_with_commas":"", | |||
"add_or_remove_items":"", | |||
"choose_from_most_used":"", | |||
"not_found":"", | |||
"no_terms":"", | |||
"items_list_navigation":"", | |||
"items_list":"" | |||
}, | |||
"meta_box_cb":"", | |||
"default_term":"", | |||
"object_types":[ | |||
"page", | |||
"section" | |||
] | |||
}, | |||
"platform":{ | |||
"name":"platform", | |||
"label":"Platforms", | |||
"singular_label":"Platform", | |||
"description":"", | |||
"public":"true", | |||
"publicly_queryable":"true", | |||
"hierarchical":"false", | |||
"show_ui":"true", | |||
"show_in_menu":"true", | |||
"show_in_nav_menus":"true", | |||
"query_var":"true", | |||
"query_var_slug":"", | |||
"rewrite":"true", | |||
"rewrite_slug":"", | |||
"rewrite_withfront":"1", | |||
"rewrite_hierarchical":"0", | |||
"show_admin_column":"true", | |||
"show_in_rest":"false", | |||
"show_in_quick_edit":"true", | |||
"rest_base":"", | |||
"rest_controller_class":"", | |||
"labels":{ | |||
"menu_name":"", | |||
"all_items":"", | |||
"edit_item":"", | |||
"view_item":"", | |||
"update_item":"", | |||
"add_new_item":"", | |||
"new_item_name":"", | |||
"parent_item":"", | |||
"parent_item_colon":"", | |||
"search_items":"", | |||
"popular_items":"", | |||
"separate_items_with_commas":"", | |||
"add_or_remove_items":"", | |||
"choose_from_most_used":"", | |||
"not_found":"", | |||
"no_terms":"", | |||
"items_list_navigation":"", | |||
"items_list":"" | |||
}, | |||
"meta_box_cb":"", | |||
"default_term":"", | |||
"object_types":[ | |||
"device" | |||
] | |||
} | |||
} |
@@ -1,6 +1,7 @@ | |||
<?php get_header() ?> | |||
<?php | |||
$site_host = parse_url(get_site_url(), PHP_URL_HOST); | |||
/** | |||
* Collect term data | |||
* ================= | |||
@@ -63,6 +64,13 @@ | |||
</div> | |||
<?php } ?> | |||
</header> | |||
<?php if ( ( is_home() || is_archive() ) && !is_front_page() ) { ?> | |||
<?php | |||
/* | |||
* @Sidebar Highlight | |||
*/ | |||
get_sidebar('highlight'); ?> | |||
<?php } ?> | |||
<?php | |||
/* | |||
* @Sidebar Content before | |||
@@ -89,7 +97,7 @@ | |||
$more_class = 'more'; | |||
$more_target = ''; | |||
$post_class = 'no-download'; | |||
$content_meta_args = array('date'); | |||
$content_meta_args = array('rtime', 'author', 'date'); | |||
$subheadline = isset($post_meta['_subheadline']) ? apply_filters('the_content', $post_meta['_subheadline']) : ''; | |||
// post thumbnail as background image | |||
@@ -122,6 +130,16 @@ | |||
$content_meta_args = false; | |||
} | |||
// Post type "aktivitaet" | |||
if ( $post_type === 'aktivitaet' ) { | |||
$content_meta_args = array('period'); | |||
} | |||
// Post type "news" | |||
if ( $post_type === 'news' ) { | |||
$content_meta_args = false; | |||
} | |||
// Post type "product" fields | |||
$produkt_pdf = isset($post_meta['_pdf-download']) ? $post_meta['_pdf-download'] : ''; | |||
$produkt_url = isset($post_meta['_product-url']) ? $post_meta['_product-url'] : ''; | |||
@@ -146,8 +164,9 @@ | |||
} | |||
if ( empty($excerpt) ) { | |||
$excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : wp_trim_words(get_the_content(), 40)); | |||
$excerpt = has_excerpt() ? get_the_excerpt() : wp_trim_words(get_the_content(), 40); | |||
} | |||
$excerpt .= ' <a class="more" href="' . get_the_permalink() . '">' . $more_text . '</a>'; | |||
// more class attribute | |||
if ( $more_class !== '' ) { | |||
$more_class = ' class="' . $more_class . '"'; | |||
@@ -170,10 +189,12 @@ | |||
</div> | |||
<?php } ?> | |||
<h2 class="title"><a href="<?php echo $more_url; ?>"<?php echo $more_target; ?>><?php the_title() ?></a></h2> | |||
<?php if ( !empty($excerpt) ) { ?> | |||
<?php echo $excerpt; ?> | |||
<?php if ( $meta = sandbox_get_meta_data($content_meta_args) ) { ?> | |||
<ul class="meta"> | |||
<?php echo $meta; ?> | |||
</ul> | |||
<?php } ?> | |||
<a class="button" href="<?php the_permalink() ?>"><?php printf($more_text); ?></a> | |||
<?php echo apply_filters('the_content', $excerpt); ?> | |||
<?php /* if ( !empty($post_taxonomies) ) { ?> | |||
<dl class="clearfix"> | |||
<?php foreach ( $post_taxonomies as $post_taxonomy ) { ?> | |||
@@ -186,29 +207,12 @@ | |||
<?php } ?> | |||
</dl> | |||
<?php } */ ?> | |||
<?php if ( $meta = sandbox_get_meta_data(array('rtime', 'date', 'author', 'terms')) ) { ?> | |||
<ul class="meta"> | |||
<?php echo $meta; ?> | |||
</ul> | |||
<?php } ?> | |||
</div> | |||
</div> | |||
</article><!-- .post --> | |||
<?php } ?> | |||
<?php endwhile; ?> | |||
<?php if ( sandbox_archive_is_paged($term) ) { ?> | |||
<?php if ( function_exists('wp_pagenavi') ) { | |||
wp_pagenavi(); // http://wordpress.org/plugins/wp-pagenavi/ | |||
} else { | |||
?> | |||
<nav id="nav-below" class="navigation"> | |||
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">«</span> Older results', 'sandbox' ) ) ?></div> | |||
<div class="nav-next"><?php previous_posts_link( __( 'Newer results <span class="meta-nav">»</span>', 'sandbox' ) ) ?></div> | |||
</nav> | |||
<?php } ?> | |||
<?php } ?> | |||
<?php } else { ?> | |||
<article id="post-0" class="post no-results not-found"> | |||
@@ -244,5 +248,17 @@ | |||
* @Sidebar Content after | |||
*/ | |||
get_sidebar('content-after'); ?> | |||
<?php if ( sandbox_archive_is_paged($term) ) { ?> | |||
<?php if ( function_exists('wp_pagenavi') ) { | |||
wp_pagenavi(); // http://wordpress.org/plugins/wp-pagenavi/ | |||
} else { | |||
?> | |||
<nav id="nav-below" class="navigation"> | |||
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">«</span> Older results', 'sandbox' ) ) ?></div> | |||
<div class="nav-next"><?php previous_posts_link( __( 'Newer results <span class="meta-nav">»</span>', 'sandbox' ) ) ?></div> | |||
</nav> | |||
<?php } ?> | |||
<?php } ?> | |||
</section> | |||
<?php get_footer() ?> |
@@ -1,6 +1,6 @@ | |||
#login h1 a, | |||
.login h1 a { | |||
background: url(../img/socos-logo-color.svg) 50% 50% no-repeat; | |||
background: url(../img/logo-text-kinderlandwien.svg) 50% 50% no-repeat; | |||
background-size:contain; | |||
padding:0; | |||
margin:0; | |||
@@ -58,9 +58,12 @@ function sandbox_setup_theme() { | |||
// load scripts | |||
add_action('wp_enqueue_scripts', 'sandbox_enqueue_scripts'); | |||
if ( !is_admin() ) { | |||
add_action('script_loader_tag', 'sandbox_script_loader_tag', 10, 2); | |||
} | |||
// init sidebars | |||
add_action('init', 'sandbox_sidebars_init'); | |||
add_action('widgets_init', 'sandbox_sidebars_init'); | |||
/** | |||
* Theme filters | |||
@@ -108,11 +111,12 @@ function sandbox_template_redirect(){ | |||
function sandbox_enqueue_scripts(){ | |||
$profile_post_ID = array(5142, 5480); // on profile page or descendants | |||
$post_id = get_the_ID(); | |||
$post = get_post(); | |||
$post_type = get_post_type(); | |||
$post_type_object = get_post_type_object($post_type); | |||
$post_type_rest_base = $post_type; | |||
if ( property_exists($post_type_object, 'rest_base') ) { | |||
if ( !is_null($post_type_object) && property_exists($post_type_object, 'rest_base') && is_string($post_type_object->rest_base) ) { | |||
$post_type_rest_base = $post_type_object->rest_base; | |||
} | |||
@@ -126,6 +130,10 @@ function sandbox_enqueue_scripts(){ | |||
wp_enqueue_script('comment-reply'); | |||
} | |||
// remove wp-embed.min.js | |||
// https://wordpress.stackexchange.com/a/285907/81728 | |||
wp_deregister_script('wp-embed'); | |||
// Javascript data for window.sandboxTheme_data | |||
$data = array( | |||
'id' => $post_id, | |||
@@ -146,6 +154,7 @@ function sandbox_enqueue_scripts(){ | |||
'is_archive' => is_archive(), | |||
'is_admin' => is_admin(), | |||
'is_single' => is_single(), | |||
'has_content_form' => !is_null($post) && has_shortcode($post->post_content, 'cf7form'), | |||
'comments_open' => comments_open(), | |||
'is_page' => is_page(), | |||
'is_tag' => is_tag(), | |||
@@ -159,16 +168,38 @@ function sandbox_enqueue_scripts(){ | |||
); | |||
// custom script: edit there for your own needs | |||
wp_register_script('actions', get_template_directory_uri() . '/js/actions.js', false, '7', true); | |||
wp_register_script('actions', get_template_directory_uri() . '/js/actions.js', array('jquery-core'), '3', true); | |||
// Javascript data for window.sandboxTheme_data | |||
wp_localize_script('actions', 'sandboxTheme_data', $data ); | |||
wp_enqueue_script('actions'); | |||
// custom script: edit there for your own needs | |||
} | |||
/* | |||
if ( is_user_logged_in() && ( is_page($profile_post_ID[0]) || is_page($profile_post_ID[1]) ) ) { | |||
wp_enqueue_script('wp-util'); | |||
wp_enqueue_script('password-strength-meter'); | |||
} | |||
*/ | |||
} | |||
function sandbox_script_loader_tag($tag, $handle){ | |||
// add script handles to the array below | |||
$scripts_to_defer = array( | |||
'jquery-core', | |||
'jquery-migrate', | |||
'jquery-plugins', | |||
'actions', | |||
'query-monitor', | |||
'easy-swipebox-init', | |||
'easy-swipebox', | |||
'contact-form-7', | |||
'cf7-grid-layout', | |||
); | |||
if ( in_array($handle, $scripts_to_defer) && strpos($tag, 'defer') === false ) { | |||
$tag = str_replace(' src', ' defer="defer" src', $tag); | |||
} | |||
return $tag; | |||
} | |||
@@ -265,9 +296,14 @@ function sandbox_get_page_description($sep, $num_words, $meta = true){ | |||
$description = wp_title($sep, false); | |||
$sep = ' ' . $sep . ' '; | |||
if ( is_single() || is_page() || ( is_front_page() && !is_home() ) ) { | |||
if ( is_404() ) { | |||
$description = __( 'Apologies, but we were unable to find what you were looking for.', 'socio' ); | |||
} else if ( is_single() || is_page() || ( is_front_page() && !is_home() ) ) { | |||
$post = get_post(get_the_ID()); | |||
if ( has_excerpt() ) { | |||
if ( $post_seo_description = get_post_meta($post->ID, '_seo-description', true) ) { | |||
$description = $post_seo_description; | |||
} else if ( has_excerpt() ) { | |||
$description = $post->post_excerpt; | |||
} else { | |||
$description = $post->post_content; | |||
@@ -283,12 +319,12 @@ function sandbox_get_page_description($sep, $num_words, $meta = true){ | |||
if ( is_author() ) { | |||
$termTitle = get_the_author_meta('display_name'); | |||
$termDesc = get_the_author_meta('description'); | |||
$taxonomyTitle = __('Author', 'sandbox'); | |||
$taxonomyTitle = __('Author', 'socio'); | |||
} | |||
if ( !empty($termDesc) ) { | |||
$termDesc = $sep . $termDesc; | |||
} | |||
$description = $taxonomyTitle . ' ' . __('archive', 'sandbox') . $sep . $termTitle . $termDesc ; | |||
$description = $taxonomyTitle . ' ' . __('archive', 'socio') . $sep . $termTitle . $termDesc ; | |||
} | |||
if ( is_home() && ( $posts_page = get_option('page_for_posts') ) ) { | |||
$description = get_the_title($posts_page); | |||
@@ -296,7 +332,7 @@ function sandbox_get_page_description($sep, $num_words, $meta = true){ | |||
$description = get_option('blogname'); | |||
} | |||
if ( is_search() ) { | |||
$description = __('Search Results For', 'sandbox') . ' ' . get_search_query(); | |||
$description = __('Search Results For', 'socio') . ' ' . get_search_query(); | |||
} | |||
} | |||
$description .= $sep . get_bloginfo('description'); | |||
@@ -336,38 +372,39 @@ function sandbox_the_current_URI(){ | |||
// Post meta single output for all fields | |||
function sandbox_get_post_meta($post_id=0){ | |||
$numeric_fields = array('_alpha_file_count', '_favorites', '_wpcr_rating', '_thumbnail_id'); | |||
$serialized_fields = array('_more-link', '_alpha_file_options'); | |||
$serialized_fields = array('_more-link', '_alpha_file_options', '_section-linked', '_conditions-table', '_links-internal', '_links-external'); | |||
$post_id = absint($post_id); | |||
if ( !$post_id ) { | |||
$post_id = get_the_ID(); | |||
} | |||
$post_custom = get_post_custom($post_id); | |||
$post_meta_keys = get_post_custom_keys($post_id); | |||
$post_meta_keys_old = array_keys($post_custom); | |||
// echo var_dump($post_meta_keys_old); | |||
$post_meta = array(); | |||
foreach ( $post_meta_keys as $post_meta_key ) { | |||
if ( !empty($post_custom[$post_meta_key][0]) ) { | |||
$post_meta[$post_meta_key] = $post_custom[$post_meta_key][0]; | |||
// exeptions | |||
// numeric field type | |||
if ( in_array($post_meta_key, $numeric_fields) ) { | |||
$post_meta[$post_meta_key] = intval($post_custom[$post_meta_key][0]); | |||
} | |||
// serialized field type | |||
if ( in_array($post_meta_key, $serialized_fields) ) { | |||
$post_meta[$post_meta_key] = unserialize($post_custom[$post_meta_key][0]); | |||
} | |||
} else { | |||
$post_meta[$post_meta_key] = ''; | |||
// exeptions | |||
// numeric field type | |||
if ( in_array($post_meta_key, $numeric_fields) ) { | |||
$post_meta[$post_meta_key] = 0; | |||
} | |||
// serialized field type | |||
if ( in_array($post_meta_key, $serialized_fields) ) { | |||
$post_meta[$post_meta_key] = array(); | |||
if ( $post_custom !== false ) { | |||
foreach ( $post_meta_keys as $post_meta_key ) { | |||
if ( !empty($post_custom[$post_meta_key][0]) ) { | |||
$post_meta[$post_meta_key] = $post_custom[$post_meta_key][0]; | |||
// exeptions | |||
// numeric field type | |||
if ( in_array($post_meta_key, $numeric_fields) ) { | |||
$post_meta[$post_meta_key] = intval($post_custom[$post_meta_key][0]); | |||
} | |||
// serialized field type | |||
if ( in_array($post_meta_key, $serialized_fields) ) { | |||
$post_meta[$post_meta_key] = unserialize($post_custom[$post_meta_key][0]); | |||
} | |||
} else { | |||
$post_meta[$post_meta_key] = ''; | |||
// exeptions | |||
// numeric field type | |||
if ( in_array($post_meta_key, $numeric_fields) ) { | |||
$post_meta[$post_meta_key] = 0; | |||
} | |||
// serialized field type | |||
if ( in_array($post_meta_key, $serialized_fields) ) { | |||
$post_meta[$post_meta_key] = array(); | |||
} | |||
} | |||
} | |||
} | |||
@@ -438,6 +475,21 @@ function sandbox_sanitize_phone($phone) { | |||
return $data[0] . ' ' . $data[1] . ' ' . $data[2] . ' ' . $data[3] . ' ' . $data[4] . $data[5]; | |||
} | |||
// output from +436641234567 to +43 664 123 45 - 67 | |||
function sandbox_sanitize_mobile_phone($phone) { | |||
$data = array( | |||
substr($phone, 0,3), | |||
substr($phone, 3,3), | |||
substr($phone, 6,3), | |||
substr($phone, 9,2), | |||
substr($phone, 11,2), | |||
); | |||
if ( !empty($data[4]) ) { | |||
$data[4] = ' - ' . $data[4]; | |||
} | |||
return $data[0] . ' ' . $data[1] . ' ' . $data[2] . ' ' . $data[3] . ' ' . $data[4]; | |||
} | |||
// Comment cancel reply link | |||
function sandbox_cancel_comment_reply_link($formatted_link, $link, $text){ | |||
return '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '">' . $text . '</a>'; | |||
@@ -597,7 +649,7 @@ function sandbox_get_archive_term(){ | |||
$term->title = $queried_object->label; | |||
$term->thumbnail = esc_url(get_template_directory_uri()) . '/img/' . $queried_object->name . '.jpg'; | |||
// $term->thumbnail = ''; | |||
// $term->byline = __('All articles in', 'sandbox') . ' ' . $term->title; | |||
// $term->byline = __('All articles in', 'socio') . ' ' . $term->title; | |||
$term->count = wp_count_posts($queried_object->name)->publish; //$queried_object->count; | |||
$term->byline = $queried_object->labels->name; | |||
$term->post_type['WP_Post_Type'] = $queried_object; | |||
@@ -611,7 +663,7 @@ function sandbox_get_archive_term(){ | |||
$term->thumbnail = ''; | |||
$term->thumbnail_id = isset($term_meta['_term_image']) && !empty($term_meta['_term_image'][0]) ? intval($term_meta['_term_image'][0]) : 0; | |||
if ( $term->thumbnail_id !== 0 ) { | |||
$term->thumbnail = wp_get_attachment_image($term->thumbnail_id, 'sandbox-hero'); | |||
$term->thumbnail = wp_get_attachment_image($term->thumbnail_id, 'socio-hero'); | |||
} | |||
$term->taxonomy['title'] = $queried_taxonomy->labels->singular_name; | |||
$term->taxonomy['WP_Taxonomy'] = $queried_taxonomy; | |||
@@ -633,13 +685,13 @@ function sandbox_get_archive_term(){ | |||
if ( is_author() ) { | |||
$term->title = get_the_author_meta('display_name'); | |||
$term->thumbnail = get_avatar($queried_object->data->ID, 'smr-thumb'); | |||
$term->taxonomy['title'] = __('Author', 'sandbox'); | |||
$term->taxonomy['title'] = __('Author', 'socio'); | |||
$term->byline = $term->title; | |||
$term->count = count_user_posts($queried_object->data->ID); | |||
} | |||
if ( is_date() ) { | |||
global $wp_query; | |||
$term->title = __('All articles from', 'sandbox') . ' '; | |||
$term->title = __('All articles from', 'socio') . ' '; | |||
$term->count = $wp_query->found_posts; | |||
if ( is_day() ) { | |||
@@ -667,13 +719,13 @@ function sandbox_get_archive_term(){ | |||
// echo 'blah: ' . var_dump($all_pages); | |||
if ( $paged > 1 && !is_404() ) { | |||
/* translators: %s: Page number. */ | |||
$current_page = sprintf(__('Page %s'), $paged); | |||
$of = ' ' . __('von', 'sandbox') . ' '; | |||
$current_page = sprintf(__('Page %s', 'socio'), $paged); | |||
$of = ' ' . __('von', 'socio') . ' '; | |||
$term->byline .= ' ' . $current_page . $of . $all_pages; | |||
} else if ( $term->count > $posts_per_page ) { | |||
$all_pages = ceil($term->count/$posts_per_page); | |||
$of = ' ' . __('von', 'sandbox') . ' '; | |||
$term->byline .= ' ' . __('Seite 1') . $of . $all_pages; | |||
$of = ' ' . __('von', 'socio') . ' '; | |||
$term->byline .= ' ' . __('Seite 1', 'socio') . $of . $all_pages; | |||
} | |||
if ( !empty($term->taxonomy['title']) ) { | |||
$term->taxonomy['title'] .= ' - '; | |||
@@ -728,14 +780,12 @@ function sandbox_archive_is_paged($term = NULL){ | |||
} | |||
function sandbox_get_more_url($post_type, $post_meta){ | |||
$more_url = get_permalink(); | |||
if ( ( isset($post_meta["_more-link-url"]) && !empty($post_meta["_more-link-url"]) ) || ( isset($post_meta['_more-link']) && !empty($post_meta['_more-link']) ) ) { | |||
// "download_aktion_de" uses that field for download button | |||
if ( $post_type !== 'download_aktion_de' ) { | |||
if ( !empty($post_meta["_more-link-url"]) ) { | |||
$more_url = $post_meta["_more-link-url"]; | |||
} elseif ( isset($post_meta['_more-link'][0]) && isset($post_meta['_more-link'][0]['_more-link-url']) && !empty($post_meta['_more-link'][0]['_more-link-url']) ) { | |||
$more_url = $post_meta['_more-link'][0]['_more-link-url']; | |||
} | |||
if ( !empty($post_meta["_more-link-url"]) ) { | |||
$more_url = $post_meta["_more-link-url"]; | |||
} elseif ( isset($post_meta['_more-link'][0]) && isset($post_meta['_more-link'][0]['_more-link-url']) && !empty($post_meta['_more-link'][0]['_more-link-url']) ) { | |||
$more_url = $post_meta['_more-link'][0]['_more-link-url']; | |||
} | |||
} | |||
return $more_url; | |||
@@ -743,13 +793,16 @@ function sandbox_get_more_url($post_type, $post_meta){ | |||
function sandbox_get_more_text($post_type, $post_meta){ | |||
// Text for "Read more" button | |||
$more_texts = array( | |||
'default' => __('Read more', 'sandbox'), | |||
'default' => __('Mehr davon', 'sandbox'), | |||
'download' => __('Download', 'sandbox'), | |||
'alpha_download' => array( | |||
'default' => __('More details', 'sandbox'), | |||
'default' => __('Mehr details', 'sandbox'), | |||
), | |||
'download_aktion_de' => array( | |||
'default' => __('More details', 'sandbox'), | |||
'default' => __('Mehr details', 'sandbox'), | |||
), | |||
'aktivitaet' => array( | |||
'default' => __('Mehr Infos', 'sandbox'), | |||
), | |||
); | |||
$more_text = $more_texts['default']; | |||
@@ -857,6 +910,25 @@ function sandbox_get_meta_data( $force_meta = false ) { | |||
$meta = get_the_date(); | |||
break; | |||
case 'period': | |||
$date_begin = isset($post_meta['_date-begin']) ? $post_meta['_date-begin'][0] : ''; | |||
$date_end = isset($post_meta['_date-end']) ? $post_meta['_date-end'][0] : ''; | |||
$meta = ''; | |||
echo '<!-- date-begin: ' . $date_begin . ' -->'; | |||
if ( !empty($date_begin) ) { | |||
$date_begin = date('d.m.Y', strtotime($date_begin)); | |||
if ( !empty($date_end) ) { | |||
$date_end = date('d.m.Y', strtotime($date_end)); | |||
$meta = $date_begin . ' - ' . $date_end; | |||
// $meta = __('Von', 'sandbox') . ' ' . $date_begin . ' ' . __('bis', 'sandbox') . ' ' . $date_end; | |||
} else { | |||
// $meta = __('Am', 'sandbox') . ' ' . $date_begin; | |||
$meta = $date_begin; | |||
} | |||
} | |||
break; | |||
case 'terms': | |||
$terms_in_taxes = sandbox_get_the_terms(); | |||
$meta = ''; | |||
@@ -1,3 +1,4 @@ | |||
<?php header('X-Frame-Options: SAMEORIGIN'); ?> | |||
<!--[if IE_NEEDS_THIS]><![endif]--> | |||
<!DOCTYPE html> | |||
<!--[if lt IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]--> | |||
@@ -14,7 +15,7 @@ | |||
<!-- all countries as js array <script type="text/javascript" src="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/js/allcountries.js"></script> --> | |||
<link rel="stylesheet" type="text/css" href="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/css/normalize.css?v=1" /> | |||
<link rel="stylesheet" type="text/css" href="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/css/default.css?v=1" /> | |||
<link rel="stylesheet" type="text/css" href="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/css/style.css?v=38" /> | |||
<link rel="stylesheet" type="text/css" href="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/css/style.css?v=7" /> | |||
<link rel="stylesheet" media="print" type="text/css" href="<?php echo esc_url(get_stylesheet_directory_uri()); ?>/css/print.css" /> | |||
<link rel="alternate" type="application/rss+xml" href="<?php echo esc_url(get_bloginfo('rss2_url')); ?>" title="<?php printf( __( '%s latest posts', 'sandbox' ), htmlspecialchars( get_bloginfo('name'), 1 ) ) ?>" /> | |||
<link rel="profile" href="http://gmpg.org/xfn/11"> | |||
@@ -36,7 +37,7 @@ | |||
</nav> | |||
<!-- ______________________ HEADER _______________________ --> | |||
<header id="site-header" class="site-header site-container color-scheme-dark"> | |||
<header id="site-header" class="site-header site-container"> | |||
<div class="inner"> | |||
<<?php | |||
@@ -47,7 +48,7 @@ | |||
if ( is_front_page() || is_home() ) { echo 'h1'; } else { echo 'h2'; } ?> id="site-name" class="site-name"> | |||
<a id="site-logo" class="site-logo" rel="home" href="<?php echo esc_url(home_url()) ?>/" title="<?php | |||
echo htmlspecialchars(get_bloginfo('name')), ' - ', htmlspecialchars(get_bloginfo('description')); | |||
?>"><img src="<?php echo esc_url(get_template_directory_uri()); ?>/img/socos-logo-dark.svg" alt="<?php | |||
?>"><img src="<?php echo esc_url(get_template_directory_uri()); ?>/img/logo-text-kinderlandwien.svg" alt="<?php | |||
echo htmlspecialchars(__('Logo', 'sandbox')), ' - ', htmlspecialchars(get_bloginfo('name')); ?>"/></a> | |||
</<?php if ( is_front_page() || is_home() ) { echo 'h1'; } else { echo 'h2'; } ?>> | |||
@@ -65,12 +66,13 @@ | |||
* @Sidebar Menu | |||
*/ | |||
get_sidebar('menu'); ?> | |||
<?php if ( !is_home() && !is_archive() ) { ?> | |||
<?php | |||
/* | |||
* @Sidebar Highlight | |||
*/ | |||
get_sidebar('highlight'); ?> | |||
<?php | |||
/* | |||
* @Sidebar Highlight | |||
*/ | |||
get_sidebar('highlight'); ?> | |||
<?php } ?> | |||
<main class="site-main site-container" id="main"> | |||
<div class="inner"> |
@@ -688,6 +688,67 @@ | |||
}, | |||
/** | |||
* FAQ navigation | |||
*/ | |||
content_tabs: { | |||
options: { | |||
selectors: { | |||
tabs: '.tabs' | |||
}, | |||
classNames: { | |||
active: 'active' | |||
}, | |||
scroll_offset: 45, | |||
scroll_speed: 300, | |||
scrollIntoView: { | |||
behavior: 'auto', | |||
block: 'center', | |||
inline: 'nearest' | |||
} | |||
}, | |||
scroll: function(){ | |||
var classNames = this.options.classNames, | |||
scroll_top = $(document).scrollTop()+this.options.scroll_offset+20, | |||
$tab_items = this.$tab_items; | |||
$tab_items.each(function(index){ | |||
var $tab_item = $(this), | |||
$content = $(this.hash); | |||
if ( $content.position().top <= scroll_top && $content.position().top + $content.height() > scroll_top) { | |||
$tab_items.removeClass(classNames.active); | |||
$tab_item.addClass(classNames.active); | |||
} else { | |||
$tab_item.removeClass(classNames.active); | |||
} | |||
}); | |||
}, | |||
events: function(){ | |||
var options = this.options, | |||
selectors = options.selectors; | |||
this.$tab_items.on('click', function(event){ | |||
var $tab_item = $(this); | |||
$('html, body').stop().animate({ | |||
scrollTop: $(this.hash).offset().top-parseInt(options.scroll_offset), | |||
}, options.scroll_speed, 'swing'); | |||
event.preventDefault(); | |||
}); | |||
}, | |||
ready: function(){ | |||
this.$tabs = $(this.options.selectors.tabs); | |||
this.$tab_items = this.$tabs.find('a'); | |||
this.events(); | |||
}, | |||
setup: function(){ | |||
return sandboxTheme.info.post_type === 'aktivitaet'; | |||
} | |||
}, | |||
/** | |||
* FAQ navigation | |||
*/ | |||
@@ -972,8 +1033,6 @@ | |||
} else { | |||
sandboxTheme.init(sandboxTheme_data); | |||
} | |||
}).error(function(){ | |||
sandboxTheme.init(sandboxTheme_data); | |||
}); | |||
})(jQuery); |
@@ -55,9 +55,9 @@ | |||
$post_class .= ' image-position-' . $post_meta['_image-position']; | |||
} | |||
// Show image with shadow or not | |||
if ( isset($post_meta['_image-shadow']) ) { | |||
$post_class .= ' thumbnail-' . $post_meta['_image-shadow']; | |||
// Show image with decoration or not | |||
if ( isset($post_meta['_image-decoration']) ) { | |||
$post_class .= ' thumbnail-' . $post_meta['_image-decoration']; | |||
} | |||
// Post type "page" fields | |||
@@ -209,8 +209,16 @@ | |||
$post_taxonomies = sandbox_get_the_taxonomies_and_terms($post_id); | |||
$content = ''; | |||
$section_linked_id = 0; | |||
$section_linked = false; | |||
$post_class = 'no-download'; | |||
$content_meta_args = array(); | |||
// Linked section | |||
if ( isset($post_meta['_section-linked']) ) { | |||
$section_linked_id = intval($post_meta['_section-linked'][0]); | |||
$section_linked = get_post($section_linked_id); | |||
} | |||
// post style attribute | |||
$post_style = ''; | |||
@@ -242,9 +250,9 @@ | |||
$post_class .= ' image-position-' . $post_meta['_image-position']; | |||
} | |||
// Show image with shadow or not | |||
if ( isset($post_meta['_image-shadow']) ) { | |||
$post_class .= ' thumbnail-' . $post_meta['_image-shadow']; | |||
// Show image with decoration or not | |||
if ( isset($post_meta['_image-decoration']) ) { | |||
$post_class .= ' thumbnail-' . $post_meta['_image-decoration']; | |||
} | |||
// Post type "page" fields | |||
@@ -287,9 +295,13 @@ | |||
} | |||
?> | |||
<article id="section-<?php sandbox_the_slug(); ?>" <?php post_class($post_class) ?><?php echo $post_style; ?>> | |||
<?php if ( has_post_thumbnail() ) { ?> | |||
<?php if ( has_post_thumbnail() ) { ?> | |||
<?php if ( $section_linked_id === 0 ) { ?> | |||
<span class="post-thumbnail"><?php the_post_thumbnail('full'); ?></span> | |||
<?php } else { ?> | |||
<a href="<?php echo get_permalink($section_linked_id); ?>" class="post-thumbnail"><?php the_post_thumbnail('full'); ?></a> | |||
<?php } ?> | |||
<?php } ?> | |||
<div class="content inner"> | |||
<?php if ( !has_term('testimonials', 'sectiongroup') ) { ?> | |||
<header class="content-header"> | |||
@@ -299,7 +311,11 @@ | |||
<?php echo $subheadline; ?> | |||
</div> | |||
<?php } ?> | |||
<?php if ( $section_linked_id === 0 ) { ?> | |||
<h2 class="title"><?php the_title(); ?></h2> | |||
<?php } else { ?> | |||
<h2 class="title"><a href="<?php echo get_permalink($section_linked_id); ?>"><?php the_title(); ?></a></h2> | |||
<?php } ?> | |||
<?php if ( !empty($download_url) ) { ?> | |||
<a class="download" href="<?php echo $download_url; ?>"<?php echo $download_target; ?>><?php echo __('Download', 'sandbox'); ?></a> | |||
<?php } ?></h1> | |||
@@ -319,6 +335,9 @@ | |||
<?php if ( !empty($content) ) { ?> | |||
<?php echo $content; ?> | |||
<?php } ?> | |||
<?php if ( $section_linked_id > 0 ) { ?> | |||
<p><a class="button" href="<?php echo get_permalink($section_linked_id); ?>"><?php echo apply_filters('post_title', $section_linked->post_title); ?></a></p> | |||
<?php } ?> | |||
</div> | |||
<?php if ( isset($post_taxonomies['benefit']) && !empty($post_taxonomies['benefit']) ) { ?> | |||
<div class="<?php echo esc_attr(sanitize_html_class(strtolower($post_taxonomies['benefit']['label']))); ?>"> | |||
@@ -54,7 +54,7 @@ | |||
$post_meta = sandbox_get_post_meta($post_id); | |||
if ( !isset($post_meta['_hide']) || !filter_var($post_meta['_hide'], FILTER_VALIDATE_BOOLEAN) ) { | |||
$excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : ''); | |||
$excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : get_the_content()); | |||
$team_position = $post_meta['_team-position']; | |||
$team_phone = $post_meta['_team-phone']; | |||
$team_phone_display = sandbox_sanitize_phone($team_phone, true); | |||
@@ -64,7 +64,7 @@ | |||
// post thumbnail as background image | |||
$thumbnail_style = ''; | |||
if ( has_post_thumbnail() ) { | |||
$thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'full') . ');"'; | |||
$thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'semi-large') . ');"'; | |||
} | |||
?> | |||
@@ -137,7 +137,7 @@ | |||
$post_meta = sandbox_get_post_meta($post_id); | |||
if ( !isset($post_meta['_hide']) || !filter_var($post_meta['_hide'], FILTER_VALIDATE_BOOLEAN) ) { | |||
$excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : ''); | |||
$excerpt = apply_filters('the_content', has_excerpt() ? get_the_excerpt() : get_the_content()); | |||
$team_position = $post_meta['_team-position']; | |||
$team_phone = $post_meta['_team-phone']; | |||
$team_phone_display = sandbox_sanitize_phone($team_phone, true); | |||
@@ -147,7 +147,7 @@ | |||
// post thumbnail as background image | |||
$thumbnail_style = ''; | |||
if ( has_post_thumbnail() ) { | |||
$thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'full') . ');"'; | |||
$thumbnail_style = ' style="background-image:url(' . get_the_post_thumbnail_url($post_id, 'semi-large') . ');"'; | |||
} | |||
?> | |||
@@ -115,7 +115,7 @@ | |||
get_sidebar('content-before'); ?> | |||
<div class="content inner"> | |||
<?php if ( has_post_thumbnail() ) { ?> | |||
<span class="post-thumbnail" <?php echo $thumbnail_style; ?>><?php the_post_thumbnail('full'); ?></span> | |||
<span class="post-thumbnail"><?php the_post_thumbnail('full'); ?></span> | |||
<?php } ?> | |||
<?php if ( !empty($content) ) { ?> | |||
<?php echo $content; ?> | |||
@@ -1,4 +1,14 @@ | |||
<footer id="site-footer" class="site-footer site-container color-scheme-dark"> | |||
<?php | |||
/** | |||
* Footer | |||
* | |||
* possible other classNames for site-footer: | |||
* - color-scheme-dark | |||
* - color-scheme-light (should be default not necessary) | |||
*/ | |||
?><footer id="site-footer" class="site-footer site-container"> | |||
<div class="inner"> | |||
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer') ) : // begin secondary sidebar widgets ?> | |||
<div class="content"><p><?php echo date('Y'); ?> Theme <a href="http://sandbox.service4me.org" target="_blank">sandbox</a> by <a href="http://www.service4me.at">service4me</a> and <a href="http://www.netzgestaltung.at" target="_blank">Netzgestaltung</a> under <a href="https://github.com/service4me/sandbox-drupal7-theme/blob/master/LICENSE" target="_blank">GPLv3</a></p></div> | |||
@@ -6,6 +6,7 @@ | |||
$site_host = parse_url(get_site_url(), PHP_URL_HOST); | |||
$post_id = get_the_ID(); | |||
$post_type = get_post_type($post_id); | |||
$post_type_object = get_post_type_object($post_type); | |||
$post_meta = sandbox_get_post_meta($post_id); | |||
if ( !isset($post_meta['_hide']) || !filter_var($post_meta['_hide'], FILTER_VALIDATE_BOOLEAN) ) { | |||
@@ -13,7 +14,7 @@ | |||
$content = ''; | |||
$post_class = 'no-download'; | |||
$content_meta_args = array('rtime', 'date', 'author', 'terms'); | |||
$content_meta_args = array('rtime', 'author', 'date'); | |||
// Post type "page" fields | |||
$subheadline = isset($post_meta['_subheadline']) ? apply_filters('the_content', $post_meta['_subheadline']) : ''; | |||
@@ -28,6 +29,24 @@ | |||
$content_meta_args = false; | |||
} | |||
// Post type "aktivitaet" | |||
if ( $post_type === 'aktivitaet' ) { | |||
$content_meta_args = array('period'); | |||
// echo var_dump($post_meta); | |||
$can_book = isset($post_meta['_can-book']) ? filter_var($post_meta['_can-book'], FILTER_VALIDATE_BOOLEAN) : false; | |||
$booking_form_slug = isset($post_meta['_booking-form']) ? $post_meta['_booking-form'] : ''; | |||
$conditions_table = isset($post_meta['_conditions-table']) ? $post_meta['_conditions-table'] : ''; | |||
$terms = isset($post_meta['_terms']) ? $post_meta['_terms'] : ''; | |||
$links_internal = isset($post_meta['_links-internal']) ? $post_meta['_links-internal'] : ''; | |||
$links_external = isset($post_meta['_links-external']) ? $post_meta['_links-external'] : ''; | |||
$pdf_download = isset($post_meta['_pdf-download']) ? $post_meta['_pdf-download'] : ''; | |||
} | |||
// Post type "news" | |||
if ( $post_type === 'news' ) { | |||
$content_meta_args = false; | |||
} | |||
// Post type "product" fields | |||
$produkt_pdf = isset($post_meta['_pdf-download']) ? $post_meta['_pdf-download'] : ''; | |||
$produkt_url = isset($post_meta['_product-url']) ? $post_meta['_product-url'] : ''; | |||
@@ -53,6 +72,32 @@ | |||
if ( empty($content) ) { | |||
$content = apply_filters('the_content', get_the_content()); | |||
} | |||
$related_options = array( | |||
'orderby' => 'menu_order', | |||
'order' => 'DESC', | |||
'posts_per_page' => 3, | |||
); | |||
$has_related = false; | |||
$post_tag_ids = array(); | |||
if ( !empty($post_taxonomies) ) { | |||
foreach( $post_taxonomies['post_tag']['terms'] as $post_tag ) { | |||
$post_tag_ids[] = $post_tag['term_id']; | |||
} | |||
} | |||
if ( !empty($post_tag_ids) ) { | |||
$related_options = array_merge($related_options, array( | |||
'post_type' => $post_type, | |||
'tax_query' => array(array( | |||
'taxonomy' => 'post_tag', | |||
'terms' => $post_tag_ids, | |||
)), | |||
'post__not_in' => array($post_id), | |||
)); | |||
$has_related = true; | |||
} | |||
?> | |||
<article id="content" <?php post_class($post_class) ?>> | |||
<?php | |||
@@ -61,35 +106,117 @@ | |||
*/ | |||
get_sidebar('content-before'); ?> | |||
<div class="content inner"> | |||
<?php if ( has_post_thumbnail() ) { ?> | |||
<a href="<?php the_permalink() ?>" class="post-thumbnail"><?php the_post_thumbnail('full'); ?></a> | |||
<?php } ?> | |||
<header class="content-header"> | |||
<div class="inner"> | |||
<h1 class="title"><?php the_title(); ?> | |||
<?php if ( !empty($download_url) ) { ?> | |||
<a class="download" href="<?php echo $download_url; ?>"<?php echo $download_target; ?>><?php echo __('Download', 'sandbox'); ?></a> | |||
<?php } ?></h1> | |||
<h1 class="title"><?php the_title(); ?></h1> | |||
<?php if ( !empty($subheadline) ) { ?> | |||
<div class="subheadline"> | |||
<?php echo $subheadline; ?> | |||
</div> | |||
<?php } ?> | |||
<?php if ( has_excerpt() ) { ?> | |||
<div class="intro"> | |||
<?php the_excerpt(); ?> | |||
</div> | |||
<?php } ?> | |||
<?php if ( $meta = sandbox_get_meta_data($content_meta_args) ) { ?> | |||
<ul class="meta"> | |||
<?php echo $meta; ?> | |||
</ul> | |||
<?php } ?> | |||
<?php if ( has_excerpt() ) { ?> | |||
<div class="intro"> | |||
<?php the_excerpt(); ?> | |||
</div> | |||
<?php } ?> | |||
</div> | |||
</header> | |||
<?php if ( $post_type === 'aktivitaet' ) { ?> | |||
<nav class="<?php echo $post_type; ?>-tabs"> | |||
<ul class="menu tabs"> | |||
<?php if ( !empty($content) ) { ?> | |||
<li class="<?php echo $post_type; ?>-description"><a href="#<?php echo $post_type; ?>-beschreibung"><?php echo __('Beschreibung', 'sandbox'); ?></a></li> | |||
<?php } ?> | |||
<?php if ( !empty($conditions) ) { ?> | |||
<li class="<?php echo $post_type; ?>-conditions"><a href="#<?php echo $post_type; ?>-konditionen"><?php echo __('Konditionen', 'sandbox'); ?></a></li> | |||
<?php } ?> | |||
<?php if ( !empty($terms) ) { ?> | |||
<li class="<?php echo $post_type; ?>-terms"><a href="#<?php echo $post_type; ?>-bedingungen"><?php echo __('Bedingungen', 'sandbox'); ?></a></li> | |||
<?php } ?> | |||
<?php if ( $can_book && !empty($booking_form_slug) ) { ?> | |||
<li class="<?php echo $post_type; ?>-booking"><a href="#<?php echo $post_type; ?>-anmeldung"><?php echo __('Anmeldung', 'sandbox'); ?></a></li> | |||
<?php } ?> | |||
<li class="<?php echo $post_type; ?>-downloads"><a href="#<?php echo $post_type; ?>-downloads"><?php echo __('Links & Downloads', 'sandbox'); ?></a></li> | |||
</ul> | |||
</nav> | |||
<?php } ?> | |||
<?php if ( has_post_thumbnail() ) { ?> | |||
<span class="post-thumbnail"><?php the_post_thumbnail('blog-hero'); ?></span> | |||
<?php } ?> | |||
<?php if ( !empty($content) ) { ?> | |||
<?php echo $content; ?> | |||
<section id="<?php echo $post_type; ?>-beschreibung"> | |||
<?php echo $content; ?> | |||
</section> | |||
<?php } ?> | |||
<?php if ( $post_type === 'aktivitaet' ) { ?> | |||
<?php if ( !empty($conditions_table) ) { ?> | |||
<?php | |||
$table_content = ''; | |||
foreach ( $conditions_table as $condition_row ) { | |||
if ( !empty($condition_row) ) { | |||
$table_content .= '<tr>'; | |||
foreach ( $condition_row as $condition_cell ) { | |||
$table_content .= '<td>'; | |||
$table_content .= empty($condition_cell) ? ' ' : $condition_cell; | |||
$table_content .= '</td>'; | |||
} | |||
$table_content .= '</tr>'; | |||
} | |||
} | |||
?> | |||
<section id="<?php echo $post_type; ?>-konditionen" class="conditions"> | |||
<h3><?php echo __('Konditionen', 'sandbox'); ?></h3> | |||
<table> | |||
<colgroup> | |||
<col width="auto"> | |||
<col width="80px"> | |||
<col width="80px"> | |||
</colgroup> | |||
<tbody> | |||
<?php echo $table_content; ?> | |||
</tbody> | |||
</table> | |||
</section> | |||
<?php } ?> | |||
<?php if ( !empty($terms) ) { ?> | |||
<section id="<?php echo $post_type; ?>-bedingungen" class="terms"> | |||
<h3><?php echo __('Teilnahmebedingungen ', 'sandbox'); ?></h3> | |||
<?php echo apply_filters('the_content', $terms); ?> | |||
</section> | |||
<?php } ?> | |||
<?php if ( $can_book && !empty($booking_form_slug) ) { ?> | |||
<section id="<?php echo $post_type; ?>-anmeldung" class="booking"> | |||
<h3><?php echo __('Anmeldung', 'sandbox'); ?> <?php the_title(); ?></h3> | |||
<?php echo do_shortcode('[cf7form cf7key="' . $booking_form_slug . '"]'); ?> | |||
</section> | |||
<?php } ?> | |||
<?php if ( !empty($links_internal) || !empty($links_external) || !empty($pdf_download) ) { ?> | |||
<section id="<?php echo $post_type; ?>-downloads" class="downloads"> | |||
<h3><?php echo __('Links & Downloads', 'sandbox'); ?></h3> | |||
<ul class="links-downloads"> | |||
<?php if ( !empty($links_internal) ) { ?> | |||
<?php foreach ( $links_internal as $link_id ) { ?> | |||
<li class="internal"><a href="<?php echo get_permalink(intval($link_id)); ?>"><?php echo get_the_title(intval($link_id)); ?></a></li> | |||
<?php } ?> | |||
<?php } ?> | |||
<?php if ( !empty($links_external) ) { ?> | |||
<?php foreach ( $links_external as $link ) { ?> | |||
<li class="external"><a href="<?php echo $link['url']; ?>" target="_blank" rel="nofollow,noopener"><?php echo $link['text']; ?></a></li> | |||
<?php } ?> | |||
<?php } ?> | |||
<?php if ( !empty($pdf_download) ) { ?> | |||
<li class="download"><a href="<?php echo wp_get_attachment_url($pdf_download); ?>" target="_blank"><?php echo __('Infos im PDF herunterladen', 'sandbox'); ?></a></li> | |||
<?php } ?> | |||
</ul> | |||
</section> | |||
<?php } ?> | |||
<?php } ?> | |||
</div> | |||
<?php | |||
/* | |||
@@ -102,5 +229,89 @@ | |||
<?php } ?> | |||
</article><!-- .post --> | |||
<?php } ?> | |||
<?php if ( $post_type === 'post' ) { ?> | |||
<h2 class="title author-title"><?php echo __('About the author', 'sandbox'); ?></h2> | |||
<div class="author-information"> | |||
<?php | |||
$author_name = get_the_author(); | |||
$author_position = get_the_author_meta('_position'); | |||
$author_description = get_the_author_meta('description'); | |||
$author_image = get_wp_user_avatar(get_the_author_ID(), 'thumbnail-semi-large'); | |||
$author_linkedin_name = get_the_author_meta('_linkedin'); | |||
$author_linkedin_url = 'https://www.linkedin.com/in/' . $author_linkedin_name; | |||
?> | |||
<?php if ( $author_image ) { ?> | |||
<span class="author-image"><?php echo $author_image; ?></span> | |||
<?php } ?> | |||
<div class="content"> | |||
<h3><?php echo $author_name; ?></h3> | |||
<?php if ( $author_position ) { ?> | |||
<p class="position"><?php echo $author_position; ?></p> | |||
<?php } ?> | |||
<?php if ( $author_description ) { ?> | |||
<p><?php echo $author_description; ?></p> | |||
<?php } ?> | |||
<ul class="contacts"> | |||
<li class="linkedin"><a href="<?php echo $author_linkedin_url; ?>" target="_blank" rel="noopener, noreferrer"><?php echo $author_name; ?></a></li> | |||
</ul> | |||
</div> | |||
</div> | |||
<?php } ?> | |||
<div class="blog-navigation"> | |||
<?php if ( $post_type === 'post' ) { ?> | |||
<?php | |||
$blog_posts_page_id = intval(get_option('page_for_posts')); | |||
?> | |||
<a class="button back-to-blog" href="<?php echo get_permalink($blog_posts_page_id); ?>"><?php echo __('Back to blog', 'sandbox'); ?></a> | |||
<?php } ?> | |||
<nav class="navigation post-navigation" aria-label="<?php echo __('Posts', 'sandbox'); ?>"> | |||
<h2 class="screen-reader-text"><?php echo __('Post navigation', 'sandbox'); ?></h2> | |||
<div class="nav-links"> | |||
<div class="nav-previous"> | |||
<?php previous_post_link('%link', '<span class="meta-nav" aria-hidden="true">' . __('Vorige ' . $post_type_object->labels->singular_name, 'sandbox') . '</span> ' . '<span class="screen-reader-text">' . __('Previous post:', 'sandbox') . '</span> ' . '<span class="post-title">%title</span>'); ?> | |||
</div> | |||
<div class="nav-next"> | |||
<?php next_post_link('%link', '<span class="meta-nav" aria-hidden="true">' . __('Nächste ' . $post_type_object->labels->singular_name, 'sandbox') . '</span> ' . '<span class="screen-reader-text">' . __('Next post:', 'sandbox') . '</span> ' . '<span class="post-title">%title</span>'); ?> | |||
</div> | |||
</div> | |||
</nav> | |||
</div> | |||
<?php | |||
if ( $has_related ) { | |||
$related = new WP_Query($related_options); | |||
} | |||
?> | |||
<?php if ( $has_related && $related->have_posts() ) { ?> | |||
<h2 class="title related-title"><?php echo __('Related posts', 'sandbox'); ?></h2> | |||
<div class="related-posts"> | |||
<div class="inner"> | |||
<?php while ( $related->have_posts() ) { | |||
$related->the_post(); ?> | |||
<?php | |||
$post_type = get_post_type(); | |||
$post_meta = get_post_custom(); | |||
$more_text = sandbox_get_more_text($post_type, $post_meta); | |||
$excerpt = has_excerpt() ? get_the_excerpt() : wp_trim_words(get_the_content(), 40); | |||
$excerpt .= ' <span class="more">' . $more_text . '</span>'; | |||
?> | |||
<a <?php post_class('related-post') ?> href="<?php the_permalink(); ?>"> | |||
<figure class="related-thumbnail"><?php the_post_thumbnail('sandbox-default'); ?></figure> | |||
<div class="inner content"> | |||
<h3><?php the_title(); ?></h3> | |||
<?php echo apply_filters('the_content', $excerpt); ?> | |||
<?php if ( $meta = sandbox_get_meta_data(array('rtime', 'author', 'date')) ) { ?> | |||
<ul class="meta"> | |||
<?php echo $meta; ?> | |||
</ul> | |||
<?php } ?> | |||
</div> | |||
</a> | |||
<?php } ?> | |||
</div> | |||
</div> | |||
<?php } ?> | |||
<?php wp_reset_postdata(); ?> | |||
<?php get_footer() ?> |