|
|
@@ -11,7 +11,7 @@ register_nav_menu("primary", "Top Menu");
|
|
|
/** STYLES **/
|
|
|
|
|
|
function ams_enqueue_styles() {
|
|
|
- wp_enqueue_style('bootstrap', get_template_directory_uri() . '/dist/bootstrap/bootstrap.css', array(), '4.0.0-3', true);
|
|
|
+ wp_enqueue_style('bootstrap', get_template_directory_uri() . '/dist/bootstrap/bootstrap.min.css', array(), '4.0.0-3', true);
|
|
|
wp_enqueue_style('slick', get_template_directory_uri() . '/dist/slick/slick.css', array(), '1.6.0', true);
|
|
|
wp_enqueue_style('slick-theme', get_template_directory_uri() . '/dist/slick/slick-theme.css', array("slick"), '1.6.0', true);
|
|
|
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/dist/font-awesome-4.7.0/css/font-awesome.min.css', array(), '4.7.0', true);
|
|
|
@@ -104,12 +104,21 @@ function ams_post_box_setup() {
|
|
|
function ams_post_box_add() {
|
|
|
add_meta_box(
|
|
|
'ams_post_box', // Unique ID
|
|
|
- esc_html__( 'Post type'), // Title
|
|
|
+ esc_html__('Post type'), // Title
|
|
|
'ams_post_box', // Callback function
|
|
|
'post', // Admin page (or post type)
|
|
|
'side', // Context
|
|
|
'default' // Priority
|
|
|
);
|
|
|
+
|
|
|
+ add_meta_box(
|
|
|
+ 'ams_tda_box', // Unique ID
|
|
|
+ esc_html__('Aktuell'), // Title
|
|
|
+ 'ams_tda_box', // Callback function
|
|
|
+ 'tdas', // Admin page (or post type)
|
|
|
+ 'side', // Context
|
|
|
+ 'default' // Priority
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
function ams_post_box( $object, $box ) { ?>
|
|
|
@@ -129,12 +138,22 @@ function ams_post_box( $object, $box ) { ?>
|
|
|
</p><?php
|
|
|
}
|
|
|
|
|
|
+function ams_tda_box( $object, $box ) { ?>
|
|
|
+ <?php wp_nonce_field( basename( __FILE__ ), 'ams_post_box_nonce' ); ?>
|
|
|
+ <p>
|
|
|
+ <label for="ams_show_on_homepage">Auf Startseite anzeigen</label>
|
|
|
+ <input type="checkbox" name="ams_show_on_homepage" id="ams_show_on_homepage" style="float: right;" <?php if(get_post_meta($object->ID, 'ams_show_on_homepage', true)) { echo "checked"; } ?> />
|
|
|
+ </p><?php
|
|
|
+}
|
|
|
+
|
|
|
function ams_post_box_save( $post_id, $post ) {
|
|
|
+
|
|
|
$inputs = array(
|
|
|
"ams_dual_columns_post",
|
|
|
"ams_tda_gallery",
|
|
|
"ams_partners",
|
|
|
- "ams_projects"
|
|
|
+ "ams_projects",
|
|
|
+ "ams_show_on_homepage"
|
|
|
);
|
|
|
|
|
|
if(!isset( $_POST['ams_post_box_nonce']) || !wp_verify_nonce($_POST['ams_post_box_nonce'], basename(__FILE__))) {
|
|
|
@@ -682,7 +701,7 @@ function hoverboxes_shortcode_func($atts) {
|
|
|
$output = "";
|
|
|
|
|
|
// images (gallery)
|
|
|
- $tdaQuery = new WP_Query(array('post_type' => $a['type']));
|
|
|
+ $tdaQuery = new WP_Query(array('post_type' => $a['type'], 'meta_query' => array(array('key' => 'ams_show_on_homepage','compare' => 'NOT EXISTS'))));
|
|
|
if($tdaQuery->have_posts()) {
|
|
|
$output .= "<div class=\"col-md-12 tda-gallery clearfix\">" . PHP_EOL;
|
|
|
$output .= "<div class=\"row\">" . PHP_EOL;
|