array( 'name' => __( 'Slider' ), 'singular_name' => __( 'Slide' ), 'add_new' => __( 'Add slide' ), 'add_new_item' => __( 'Add slide' ), 'edit_item' => __( 'Edit slide' ), 'new_item' => __( 'New slide' ), 'view_item' => __( 'View slide' ), 'search_items' => __( 'Search slides' ), 'not_found' => __( 'No slides found' ), 'not_found_in_trash' => __( 'No slides found in trash' ) ), 'public' => true, 'publicly_queryable' => false, 'query_var' => true, 'exclude_from_search' => true, 'hierarchical' => true, 'taxonomies' => array( 'slider_categorien'), 'supports' => array( 'title', 'thumbnail', 'page-attributes' ), 'rewrite' => false, 'register_meta_box_cb' => 'add_klik_pagelinkID_metaboxes', 'menu_position' => 21 ) ); } add_action( 'init', 'add_klikslider_custom_post' ); add_action( 'init', 'register_taxonomy_slider_categorien' ); function register_taxonomy_slider_categorien() { $labels = array( 'name' => __( 'Categorien'), 'singular_name' => __( 'categorie' ), 'search_items' => __( 'Search Categorien' ), 'popular_items' => __( 'Popular Categorien' ), 'all_items' => __( 'All Categorien' ), 'parent_item' => __( 'hoofd' ), 'parent_item_colon' => __( 'hoofd' ), 'edit_item' => __( 'Edit categorie' ), 'update_item' => __( 'Update categorie' ), 'add_new_item' => __( 'Add New categorie' ), 'new_item_name' => __( 'New categorie' ), 'separate_items_with_commas' => __( 'Separate categorien with commas' ), 'add_or_remove_items' => __( 'Add or remove categorien' ), 'choose_from_most_used' => __( 'Choose from the most used categorien' ), 'menu_name' => __( 'Categorie' ), ); $args = array( 'labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => false, 'show_admin_column' => false, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true ); register_taxonomy( 'slider_categorien', array('klikslider'), $args ); } //==================================================== //==================================================== // Metaboxes //==================================================== // Add the Meta Boxes function add_klik_pagelinkID_metaboxes() { add_meta_box('klik_pagelinkID', 'Page Link', 'klik_pagelinkID', 'klikslider', 'normal', 'default'); } // Page Link input function klik_pagelinkID() { global $post; // Noncename needed to verify where the data originated echo ''; $checked = get_post_meta($post->ID, '_linked', true); ?>

Een link toevoegen aan deze slide?

       

       

'page', 'post_status' => 'publish', 'order'=> 'ASC', 'hierarchical' => 1 ); $selected = get_post_meta($post->ID, '_pagelink', true); ?>

Naar welke pagina moet deze slide doorlinken?

ID; } // Is the user allowed to edit the post or page? if ( !current_user_can( 'edit_post', $post->ID )) return $post->ID; // OK, we're authenticated: we need to find and save the data // We'll put it into an array to make it easier to loop though. $slider_meta['_pagelink'] = $_POST['_pagelink']; $slider_meta['_linked'] = $_POST['_linked']; // Add values of $events_meta as custom fields foreach ($slider_meta as $key => $value) { // Cycle through the $events_meta array! if( $post->post_type == 'revision' ) return; // Don't store custom data twice $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely) if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value update_post_meta($post->ID, $key, $value); } else { // If the custom field doesn't have a value add_post_meta($post->ID, $key, $value); } if(!$value) delete_post_meta($post->ID, $key); // Delete if blank } } add_action('save_post', 'save_klik_pagelinkID', 1, 2); // save the custom fields //==================================================== //==================================================== //Shortcodes //==================================================== // atts: cat, #cssID, class, pager, mode, pause function show_slider($atts) { extract(shortcode_atts(array( 'cat' => 1, 'cssID' => 'slider', 'class' => 'bxslider', 'pager' => true, 'mode' => 'horizontal', 'pause' => 13000 ), $atts)); global $add_BXslider_script; $add_BXslider_script = true; $slider__args=array( 'post_type' => 'klikslider', 'post_status' => 'publish', 'orderby' => 'menu_order', 'slider_categorien' => $cat, 'order'=> 'ASC' ); $home_query = null; $home_query = new WP_Query($slider__args); if( $home_query->have_posts() ) : $return_string = ""; $return_string .= '
'; $return_string .= '
'; endif; wp_reset_query(); return $return_string; } function register_slider_shortcodes(){ add_shortcode('klikslider', 'show_slider'); } add_action( 'init', 'register_slider_shortcodes'); //==================================================== //==================================================== // javascripts //==================================================== function addJava ($ID, $class, $pager, $mode, $pause) { $script = '"; return $script; } add_action('init', 'register_sliderScripts'); add_action('wp_footer', 'print_script'); function register_sliderScripts() { wp_register_script('BXslider', plugins_url('bxslider/jquery.bxslider.min.js', __FILE__), array('jquery'), '4.1', false); } function print_script() { global $add_BXslider_script; if ( ! $add_BXslider_script ) return; wp_print_scripts('BXslider'); } ?> 'Verkoop', 'singular_name' => 'Product', 'menu_name' => 'Producten', 'name_admin_bar' => 'Producten', 'archives' => 'Productarchieven', 'parent_item_colon' => 'Parent Product:', 'all_items' => 'Alle producten', 'add_new_item' => 'Voeg nieuw product toe', 'add_new' => 'Nieuw', 'new_item' => 'Nieuw product', 'edit_item' => 'Wijzig product', 'update_item' => 'Update product', 'view_item' => 'Bekijk product', 'search_items' => 'Zoek product', 'not_found' => 'Niet gevonden', 'not_found_in_trash' => 'Niet gevonden in prullenbak', 'featured_image' => 'Featured Image', 'set_featured_image' => 'Set featured image', 'remove_featured_image' => 'Remove featured image', 'use_featured_image' => 'Use as featured image', 'insert_into_item' => 'Voeg toe in product', 'uploaded_to_this_item' => 'Uploaded naar dit product', 'items_list' => 'Productlijst', 'items_list_navigation' => 'Productlijst navigation', 'filter_items_list' => 'Filter productlijst', ); $rewrite = array( 'slug' => 'verkoop', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => 'Product', 'description' => 'Product omschrijving', 'labels' => $labels, 'supports' => array( 'title', 'editor', 'author', 'page-attributes', ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 20, 'menu_icon' => 'dashicons-hammer', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'Product', $args ); } add_action( 'init', 'custom_post_type_product', 0 ); // ################################# // image size // ################################# // ################################# // declare Shortcodes // ################################# // homepage overzicht function homepage_producten_Shortcode() { $args = array( 'posts_per_page' => 2, 'orderby' => 'date', 'order' => 'DESC', 'meta_key' => 'verkocht', 'meta_value' => '0', 'post_type' => 'product', 'post_status' => 'publish' ); $myposts = get_posts( $args ); $aantal = count($myposts); ob_start(); if ($aantal > 0) { foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
ID); ?>

post_title; ?>

ID); ?>

Bekijk product

Zoekt u een machine of onderdeel en vindt u deze niet op onze site? Neemt u dan contact met ons op. Wij kunnen namelijk voor u op zoek gaan."; } wp_reset_postdata(); return ob_get_clean(); } function register_VerkoopShortcodes(){ add_shortcode( 'verkoophome', 'homepage_producten_Shortcode' ); } add_action( 'init', 'register_VerkoopShortcodes'); ?> 'Main menu', ) ); } add_action('init', 'add_wp3menu_support'); //==================================================== //==================================================== //============= remove ongebruikte zooi ============== //==================================================== remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); add_filter('the_generator', create_function('', 'return "";')); //==================================================== //==================================================== //================ Custom image sizes= =============== //==================================================== function custom_images() { add_theme_support( 'post-thumbnails' ); // This feature enables post-thumbnail support for a theme add_image_size( 'slider-size', 710, 473, array( 'left', 'top' ) ); // Hard crop left top add_image_size( 'overzicht-size', 177, 118, array( 'left', 'top' ) ); // Hard crop left top } add_action( 'after_setup_theme', 'custom_images' ); //==================================================== // Sidebars //==================================================== ?>