Wordpress question...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xenigo
    Confirmed User
    • Jan 2001
    • 8067

    #1

    Wordpress question...

    Posts on Engadget's main page will sometimes be a summary of the main article, maybe 150 words or so. Clicking Read More or the post's title will open the page that has the 1200+ word full article.

    How do I that in Wordpress?
  • baddog
    So Fucking Banned
    • Apr 2001
    • 107089

    #2
    <!--more-->

    Comment

    • epitome
      So Fucking Lame
      • Jun 2009
      • 12156

      #3
      If the theme allows excerpts you use that field.

      Otherwise, there is a button that lets you insert a read more line.

      Comment

      • AAB
        Confirmed User
        • Apr 2009
        • 874

        #4
        Code:
        <?php the_excerpt(); ?>

        Comment

        • xenigo
          Confirmed User
          • Jan 2001
          • 8067

          #5
          Originally posted by AAB
          Code:
          <?php the_excerpt(); ?>
          I'm not really sure how to implement this.

          Comment

          • Chris
            Too lazy to set a custom title
            • May 2003
            • 27880

            #6
            you should just have a button that will break your post for you...
            [email protected]

            Comment

            • AAB
              Confirmed User
              • Apr 2009
              • 874

              #7
              Do you want excerpts on your index page? You may need to modify one (or more) files of your theme if you're currently not getting that. It's very easy, though.

              I'm gonna assume you want it on your index page and that at present time your index page displays full length posts. You will need to open your theme's Main Index Template file (index.php), search for the_content() and change it to the_excerpt. Voila... instead of having full posts on your front page, you will have excerpts. Of course, if you are using a caching plugin (such as WP Super Cache), you may need to dump the cache in order to see the changes.

              Comment

              • xenigo
                Confirmed User
                • Jan 2001
                • 8067

                #8
                Originally posted by epitome
                If the theme allows excerpts you use that field.

                Otherwise, there is a button that lets you insert a read more line.
                I guess the default WP theme doesn't allow excerpts? I tried entering an excerpt and it doesn't seem to make any changes to the main page...

                Comment

                • Itchy
                  Datetronix.com
                  • Jan 2001
                  • 6525

                  #9
                  Originally posted by baddog
                  <!--more-->
                  A few more details on the easy way
                  more - <!--more--> WordPress tag that breaks a post into "teaser" and content sections. Type a few paragraphs, insert this tag, then compose the rest of your post. On your blog's home page you'll see only those first paragraphs with a hyperlink ((more...)), which when followed displays the rest of the post's content.



                  ICQ: 2588560
                  Skype: Pornocop

                  Comment

                  • baddog
                    So Fucking Banned
                    • Apr 2001
                    • 107089

                    #10
                    If you want it to work like the first article on http://www.gotbuddy.com/ use the code I pasted where you want the break.

                    Comment

                    • xenigo
                      Confirmed User
                      • Jan 2001
                      • 8067

                      #11
                      Originally posted by AAB
                      Do you want excerpts on your index page? You may need to modify one (or more) files of your theme if you're currently not getting that. It's very easy, though.

                      I'm gonna assume you want it on your index page and that at present time your index page displays full length posts. You will need to open your theme's Main Index Template file (index.php), search for the_content() and change it to the_excerpt. Voila... instead of having full posts on your front page, you will have excerpts. Of course, if you are using a caching plugin (such as WP Super Cache), you may need to dump the cache in order to see the changes.
                      Here's what my index.php consists of:

                      PHP Code:
                      get_header(); ?>
                      
                              <div id="container">
                                  <div id="content" role="main">
                      
                                  <?php
                                  /* Run the loop to output the posts.
                                   * If you want to overload this in a child theme then include a file
                                   * called loop-index.php and that will be used instead.
                                   */
                                   get_template_part( 'loop', 'index' );
                                  ?>
                                  </div><!-- #content -->
                              </div><!-- #container -->
                      
                      <?php get_sidebar(); ?>
                      <?php get_footer(); ?>

                      Comment

                      • garce
                        Confirmed User
                        • Oct 2001
                        • 7103

                        #12
                        Originally posted by xenigo
                        I guess the default WP theme doesn't allow excerpts? I tried entering an excerpt and it doesn't seem to make any changes to the main page...
                        The default theme Twenty Ten? I coud be wrong because I have never used Twenty Ten, but...

                        Open loop.php and find this:
                        <?php the_content(); ?>

                        Replace it with this:
                        <?php the_excerpt(); ?>

                        When you make a post, the index page will show an abbreviated version of the post text.

                        For a better result:

                        When you finish your main post (in the WP editor), scroll down and enter an abbreviated version into the "Excerpt" field. Your front page will have a brief description, your main post will have the full text and content.

                        Comment

                        • xenigo
                          Confirmed User
                          • Jan 2001
                          • 8067

                          #13
                          Originally posted by Itchy
                          A few more details on the easy way
                          more - <!--more--> WordPress tag that breaks a post into "teaser" and content sections. Type a few paragraphs, insert this tag, then compose the rest of your post. On your blog's home page you'll see only those first paragraphs with a hyperlink ((more...)), which when followed displays the rest of the post's content.

                          Sweet Jesus! This did it.

                          Thanks. I tried pasting <!--more--> into the post and that didn't do anything except for make that tag appear in the post itself. When I hit the "More" button on WP, that did the trick.

                          Sweet.

                          Comment

                          • baddog
                            So Fucking Banned
                            • Apr 2001
                            • 107089

                            #14
                            Originally posted by xenigo
                            Sweet Jesus! This did it.

                            Thanks. I tried pasting <!--more--> into the post and that didn't do anything except for make that tag appear in the post itself. When I hit the "More" button on WP, that did the trick.

                            Sweet.
                            Sorry . . . I figured you could not see it or something.

                            Comment

                            • AAB
                              Confirmed User
                              • Apr 2009
                              • 874

                              #15
                              Yeah, manual except is probably your best bet (see garce's post), even though it requires an extra step you will need to take each time you are making a new post. However you can manually create your excerpt (and you can add formatting to it), whereas the automatic one truncates the text (sometimes cutting off the sentence at a wrong spot) and strips all formatting.
                              Last edited by AAB; 01-18-2011, 08:07 PM.

                              Comment

                              • xenigo
                                Confirmed User
                                • Jan 2001
                                • 8067

                                #16
                                Originally posted by baddog
                                Sorry . . . I figured you could not see it or something.
                                I hadn't even looked on the tool bar. I didn't expect it to be there.

                                I figured the Excerpt function was something I'd have to enable externally from the post itself.

                                Comment

                                • ottopottomouse
                                  She is ugly, bad luck.
                                  • Jan 2010
                                  • 13177

                                  #17
                                  Originally posted by xenigo
                                  Sweet Jesus! This did it.

                                  Thanks. I tried pasting <!--more--> into the post and that didn't do anything except for make that tag appear in the post itself. When I hit the "More" button on WP, that did the trick.

                                  Sweet.
                                  Needs to be on html view to paste in <!--more-->
                                  ↑ see post ↑
                                  13101

                                  Comment

                                  • thebedshark
                                    Registered User
                                    • Jul 2009
                                    • 88

                                    #18
                                    A big to the OP and everyone who responded, I was gonna be
                                    looking today on how to do this on my own blog, and you guys hooked me up
                                    already, awesome. Seems easier than I would of thought, thanks again.
                                    Contact Info: ICQ: 561317340 Email: gfy (at) thebedshark.com - More Trades At TheBedShark
                                    babesbycity.com - bigtittedgirls.com - explicitamateur.com - freehustlersex.com - hustlersexvideo.com - amateurteenphotos.com

                                    Comment

                                    • Django
                                      So Fucking Banned
                                      • Jul 2010
                                      • 2578

                                      #19
                                      <!---->

                                      Comment

                                      Working...