Display full page content as sticky post

I'm using a few plugins that displays dynamic output in pages but I would rather have it displayed in a post.
How can I get a page's full content to display on a theme's home as a post? Or can I create a quick code for all plugins? (Want to avoid frames)

  • stacy
    • Design Lord, Child of Thor

    a) Of course, but that is not what I mean. As I stated, It is dynamic output supplied by the plugins, the text and data will be ever changing. It only supplies to pages currently and I can't just copy and paste to a post.
    b) Changing my template to show a page on home would still be a page template , not the home's template displaying a page and posts underneath main headers. I tried copying page template file to main index template but it just posts each posts twice since wp page templates use the same code as posts. ...<?php if (have_posts()) ...ect.

    Resume extended is one for example but there's other content only for pages sometimes that should be allowed to go elsewhere.

    How to get a page to show up like a post?

  • Jonathan
    • The Incredible Code Injector

    @stacy,

    How to get a page to show up like a post?

    Don't worry I got your back :wink:

    Add this to your themes functions.php or write it up in a plugin.

    add_filter( 'pre_get_posts', 'my_custom_get_posts' );
    
    function my_custom_get_posts( $query ) {
    	if ( is_home() )
    		$query->set( 'post_type', array( 'post', 'page' ) );
    
    	return $query;
    }

    As you can see in the code, the
    $query->set( 'post_type', array( 'post', 'page' ) );
    adds the post, page to the query and what is great is you could add any post type ( 'post', 'page', 'products', 'clients' ) and all those post types will be displayed on the home page.
    if ( is_home() ) ^ tells it to show only on home page :wink:

    Props goes to Justin Tadlock for the above code
    http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    What exactly is the output that you want on the home page and how is that generated?

    Does the plugin create an actual page that you can see in your dashboard? If so you can just set that to be your home page.

    Otherwise, if the plugin is using WP_Rewrite to create a slug you will need to either edit the plugin to use the home page instead of creating a slug or create your own plugin which mirrors the functionality.

    Phil

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.