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

    //die;


    $post = get_post();
    $content = $post->post_content;

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

    $links = explode("\n", $content);

    wp_redirect($links[rand(0, count($links)-1)], 301);
    exit;

?>