Wordpress plugin to post a full post on the main page

by 15 replies
18
Hi,

I've a static front page with some writing and i've a blog that is updated about 4 times a day.

Is there a plugin that will post the last ( or a random ) post from the day ?

each post has a video in it and the random post would need to have it and all the text.

It only needs to appear on the front page

Thanks.
#website design #full #main #page #plugin #post #wordpress
  • You don't need any plugin for that.

    In the default theme (2011) there is already a Page template that does just that - it's called "showcase".

    In other themes you will need to create a new Page template (and then use it to display your static frontpage); basically, a static frontpage with dynamic content.
    • [1] reply
    • Oh thats great news.

      I changed back to 2011 theme I found the showcase file in the editor. I copied the content.

      What do i do next ? Just paste the code into the index file ?

      I'm using a YooTheme theme called Neo.
      • [1] reply
  • I'll a bit more info. here is my site psdtutorials.org

    As you can see on the main page there is a youtube video. I just hard coded the link into the page.

    I'd like to have this video change with the latest post from my other pages.
  • This vid should help
    YouTube - Broadcast Yourself.
    • [1] reply
    • Reading the OP should also help... the OP is past that step. He already has a static page as frontpage - just wants to add to it dynamic content: latest posts!
      • [ 1 ] Thanks
  • I've being trying to do this but can't get it working.

    I'm a little lost on where to start.


    If i make a new page how do i select that as my home/static page ?

    How can I make sure all the widgets will be on the page ?

    I think i've found the code -- i think it's

    Code:
    <?php
    
                        // Display our recent posts, showing full content for the very latest, ignoring Aside posts.
                         = array(
                            'order' => 'DESC',
                            'post__not_in' => get_option( 'sticky_posts' ),
                            'tax_query' => array(
                                array(
                                    'taxonomy' => 'post_format',
                                    'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
                                    'field' => 'slug',
                                    'operator' => 'NOT IN',
                                ),
                            ),
                            'no_found_rows' => true,
                        );
    
                        // Our new query for the Recent Posts section.
                         = new WP_Query(  );
    
                        // The first Recent post is displayed normally
                        if ( () ) : ();
    
                            // Set  to 0 in order to only get the first part of the post.
                            global ;
                             = 0;
    
                            get_template_part( 'content', get_post_format() );
    
                            echo '<ol class="other-recent-posts">';
    
                        endif;
    
                        // For all other recent posts, just display the title and comment status.
                        while ( () ) : (); ?>
    but not 100% on that.

    I tried adding this to the theme's template file where i think/thought was the right spot and i got errors and the site would'nt load.. so i removed it.
  • OK, let's try it step by step.

    Yes, that's the code in the showcase Page template. However, I have to apologize for not warning you about some of the uncommon coding in this theme... Sorry, for not clarifying it from the beginning!

    Here is the explanation why copying will not work in other themes:
    - the main part of a template displaying post(s) is the so-called Loop: it's a PHP code that goes through your posts in the database and selects&retrieve for displaying those that match the criteria in the Loop.

    - in previous versions of themes the Loop used to be right in the template files (like index.php, single.php, page.php etc.)

    - the new default theme has the different loop codes in template files named "content-something.php", which are called into the traditional template files; i.e. page.php will call for content-page.php... and so on.

    [in the code you posted above this the line calling the loop:
    get_template_part( 'content', get_post_format() );]

    - the problem is: other themes are NOT using this kind of "dissection" of the template files and loop, which means the get_template_part code will NOT WORK in them...

    Workaround: I'd suggest you take a look at this tutorial
    Static frontpage - combined with dynamic content - in WordPress Tutorials @ MoshuBlog - it is a general guide how to create a 'showcase-type' Page template for your own theme.

    Once you have the template file, upload it to your theme folder.
    Login to wp-admin and create a new Page (write a welcome message for the top portion); on the right select your template for it and publish.
    Create another empty Page and publish.

    Go to Settings > Reading and select as frontpage a 'static page'.
    In the dropdown select your welcome page as the frontpage. In the same time select your empty Page as your blog/posts page.
  • I can't find a page.php I gdo have a template.php but i can't find anything like the code suggested in that link.

    Can I pay you to do it ?
    • [1] reply
    • Tricky question, LOL
      I decided long time ago not to do any WP related job around the WF because the price expectations are too low and I don't sell myself cheap.

      If it was a free theme I would have done that template for you long time ago but with paid themes that's not an option, unfortunately.

      When you go to Appearance > Editor you must see a list of template files in your theme. Could you post here that list?
      • [1] reply
  • Also when i create a new page i can't see how i can pick a template for it.
    • [1] reply
    • Unless you have at least 2 Page templates (page.php, the default AND another one made with the exact code that is in the Codex link I gave you earlier) - you will NOT see that option. Why would you, if the theme has only one option...?
  • ah i see... But i can't even find page.php I looked in the editor and in the FTP files.

Next Topics on Trending Feed