Wordpress plugin to post a full post on the main page

15 replies
  • WEB DESIGN
  • |
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.
#full #main #page #plugin #post #wordpress
  • Profile picture of the author Istvan Horvath
    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.
    Signature

    {{ DiscussionBoard.errors[5093172].message }}
    • Profile picture of the author david5000
      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.
      {{ DiscussionBoard.errors[5093962].message }}
      • Profile picture of the author Istvan Horvath
        Originally Posted by david5000 View Post

        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.
        No, you do NOT copy the content of the showcase template file into your index. EVER!

        You create a similar Page template (mandatory reading here) in your own theme and make a new Page and assign the new template to it.

        Note: copying the whole thing might mess up your theme because every theme is using different div ID and classes, which are defined in the style.css.
        Try to copy selectively the PHP code that displays a) the Page content; b) the dynamic content, aka posts...
        Signature

        {{ DiscussionBoard.errors[5095206].message }}
        • Profile picture of the author david5000
          Originally Posted by Istvan Horvath View Post

          No, you do NOT copy the content of the showcase template file into your index. EVER!

          You create a similar Page template (mandatory reading here) in your own theme and make a new Page and assign the new template to it.

          Note: copying the whole thing might mess up your theme because every theme is using different div ID and classes, which are defined in the style.css.
          Try to copy selectively the PHP code that displays a) the Page content; b) the dynamic content, aka posts...

          thanks i'll go through the code when i get home.
          {{ DiscussionBoard.errors[5095398].message }}
  • Profile picture of the author david5000
    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.
    {{ DiscussionBoard.errors[5094003].message }}
  • Profile picture of the author BudgetSEO
    This vid should help
    Signature
    Let me Secure your wordpress website for the price of a small Pizza
    Weather Balloons Election Supplies
    If you need the ''cheapest'' quote, don't waste your time contacting me.
    {{ DiscussionBoard.errors[5094262].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by BudgetSEO View Post

      This vid should help
      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!
      Signature

      {{ DiscussionBoard.errors[5095215].message }}
  • Profile picture of the author david5000
    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.
    {{ DiscussionBoard.errors[5101032].message }}
  • Profile picture of the author Istvan Horvath
    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.
    Signature

    {{ DiscussionBoard.errors[5101445].message }}
  • Profile picture of the author david5000
    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 ?
    {{ DiscussionBoard.errors[5101550].message }}
  • Profile picture of the author david5000
    Also when i create a new page i can't see how i can pick a template for it.
    {{ DiscussionBoard.errors[5101598].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by david5000 View Post

      Also when i create a new page i can't see how i can pick a template for it.
      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...?
      Signature

      {{ DiscussionBoard.errors[5101710].message }}
  • Profile picture of the author david5000
    ah i see... But i can't even find page.php I looked in the editor and in the FTP files.
    {{ DiscussionBoard.errors[5101731].message }}

Trending Topics