HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/mohn.komma.pro/wwwroot/wp-content/themes/mohn/functions.php
<?php
	
    // Hide Admin Buttons //
    function remove_menus(){
    // remove_menu_page( 'index.php' );                 //Dashboard
    // remove_menu_page( 'edit.php' );              	//Posts
    remove_menu_page( 'upload.php' );                	//Media
    // remove_menu_page( 'edit.php?post_type=page' );   //Pages
    remove_menu_page( 'edit-comments.php' );        	//Comments
    remove_menu_page( 'themes.php' );             	   	//Appearance
    remove_menu_page( 'plugins.php' );            	   	//Plugins
    // remove_menu_page( 'users.php' );                 //Users
    // remove_menu_page( 'tools.php' );                 //Tools
    // remove_menu_page( 'options-general.php' );       //Settings
    }
    add_action( 'admin_menu', 'remove_menus' );

    // Hide Wordpress admin bar //
    add_filter( 'show_admin_bar', '__return_false');

    // Adjust maximum file size //
    @ini_set( 'upload_max_size' , '10M' );
    @ini_set( 'post_max_size', '10M');
    @ini_set( 'max_execution_time', '300' );


	// Clean up the head //
    remove_action( 'wp_head', 'feed_links_extra');
    remove_action( 'wp_head', 'feed_links');
    remove_action( 'wp_head', 'rsd_link');
    remove_action( 'wp_head', 'wlwmanifest_link' );
    remove_action( 'wp_head', 'index_rel_link' );
    remove_action( 'wp_head', 'parent_post_rel_link', 10);
    remove_action( 'wp_head', 'start_post_rel_link', 10);
    remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10);
    remove_action( 'wp_head', 'wp_generator');

    // Remove Emoji's //
    function disable_wp_emojicons() {

        remove_action( 'admin_print_styles', 'print_emoji_styles' );
        remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
        remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
        remove_action( 'wp_print_styles', 'print_emoji_styles' );
        remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
        remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
        remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );

    }

    add_action( 'init', 'disable_wp_emojicons' );

    // Enable support for Post Thumbnails, and declare it's sizes //
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 400, 300, true );
    add_image_size( 'img-800', 800, 9999 );
    add_image_size( 'img-1024', 1024, 9999 );
    add_image_size( 'img-1280', 1280, 9999 );
    add_image_size( 'img-1366', 1366, 9999 );
    add_image_size( 'img-1920', 1920, 9999 );
    add_image_size( 'img-2500', 2500, 9999 );

    // Register custom menu //
    function site_menu() {
        register_nav_menu('site-menu',__( 'Site Menu' ));
    }

    add_action( 'init', 'site_menu' );

    // Remove wordpress page classes and ids //
    add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
    add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
    add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);

    function my_css_attributes_filter($var) {
        return is_array($var) ? array_intersect($var, array('current-menu-item')) : '';
    }

    function lazy_articles(){

        $start = $_POST['start'];
        $catID = $_POST['cat'];

        if($catID != "default"){
            $args = array( 'posts_per_page' => '4', 'offset' => $start, 'cat' => $catID );
        }else{
            $args = array( 'posts_per_page' => '4', 'offset' => $start );
        }

        query_posts( $args );

        while ( have_posts() ) {
            the_post();
            ?>
            <a href="<?php the_permalink(); ?>" class="blog-post">
                <div class="blog-thumb">
                    <?php
                    if ( has_post_thumbnail() ) {
                        ?>
                        <img src="<?php the_post_thumbnail_url('large'); ?>" alt="" />
                        <?php
                    }
                    ?>
                </div>
                <div class="blog-content">
                    <?php
                    $categories = get_the_category();
                    ?>
                    <span class="date"><?= str_replace("/", ".", get_the_date()); ?> - <ul><?php foreach($categories as $category){ echo("<li>".$category->name."</li>"); } ?></ul></span>
                    <h3><?php the_title(); ?></h3>
                    <h4><?php the_field('subtitle'); ?></h4>
                </div>
            </a>
            <?php
        }

        die();
    }

    add_action('wp_ajax_nopriv_lazy_articles', 'lazy_articles');
?>