<?php
    /*
        Template Name: Entry node
    */

    //die;

    $count = (int)get_option('entrynode_count');
    $count = $count+1;
    update_option('entrynode_count', $count);

    $posts = get_posts(
        array(
            'post_status' => 'publish',
            'post_type' => array('anew','profile_article','yellow'),
            'posts_per_page' => 5,
            'orderby' => 'date',
            'order' => 'DESC'
        )
    );

    //wp_redirect('https://profile.ru/archive/vremya-proverennogo-123132/',301);
    wp_redirect(get_permalink($posts[rand(0,4)]), 301);
    exit;

?>