How to display non-page / post content

You can do this by creating a “fake page” so to speak, where instead of creating the page in your dashboard area under Pages -> Add New then selecting a template from Page Attributes or by creating a template that matched the slug or id such as page-{slug}.php or page-{id}.php you instead use a combination of rewrite rules combined with hooking onto an action template_redirect to achieve the desired result.

You can see an exact example of this in my answer to this question.

I’ll copy in my snippets below but the full explanation should be read in my answer above.

Step 1:

add_action('init', 'fake_page_rewrite');

function fake_page_rewrite(){

    global $wp_rewrite;

    //set up our query variable %fake_page% which equates to index.php?fake_page= 
    add_rewrite_tag( '%fake_page%', '([^&]+)'); 

    //add rewrite rule that matches /blog/page/2, /blog/page/3, /blog/page/4, etc..
    add_rewrite_rule('^blog/page/?([0-9])?','index.php?fake_page=blog&paged=$matches[1]','top');  

    //add rewrite rule that matches /blog
    add_rewrite_rule('^blog/?','index.php?fake_page=blog','top');

    //add endpoint, in this case 'blog' to satisfy our rewrite rule /blog, /blog/page/ etc..
    add_rewrite_endpoint( 'blog', EP_PERMALINK | EP_PAGES );

    //flush rules to get this to work properly
    $wp_rewrite->flush_rules();

}

Step 2:

add_action('template_redirect', 'fake_page_redirect');

    function fake_page_redirect(){

        global $wp;

        //retrieve the query vars and store as variable $template 
        $template = $wp->query_vars;

        //pass the $template variable into the conditional statement and
        //check if the key 'fake_page' is one of the query_vars held in the $template array
        //and that 'blog' is equal to the value of the key which is set
        if ( array_key_exists( 'fake_page', $template ) && 'blog' == $template['fake_page'] ) {

            //if the key 'fake_page' exists and 'blog' matches the value of that key
            //then return the template specified below to handle presentation
            include( get_template_directory().'/your-template-name-here.php' );

            exit;

        }
    }

Note: Some tweaking might be necessary to associate individual tweet IDs but we’d need to see your code that relates to the tweets.

These snippets go into your functions.php file. Naturally you should change any of the parameters that should otherwise meet your desired end point. So where you see blog becomes whatever-you-want etc. The template name in the second snippet should correspond to your desired template.