GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wordpress question... (https://gfy.com/showthread.php?t=1006621)

xenigo 01-18-2011 09:19 PM

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 01-18-2011 09:23 PM

<!--more-->

epitome 01-18-2011 09:24 PM

If the theme allows excerpts you use that field.

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

AAB 01-18-2011 09:34 PM

Code:

<?php the_excerpt(); ?>

xenigo 01-18-2011 09:40 PM

Quote:

Originally Posted by AAB (Post 17854111)
Code:

<?php the_excerpt(); ?>

I'm not really sure how to implement this.

Chris 01-18-2011 09:45 PM

you should just have a button that will break your post for you...

AAB 01-18-2011 09:50 PM

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.

xenigo 01-18-2011 09:51 PM

Quote:

Originally Posted by epitome (Post 17854101)
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...

Itchy 01-18-2011 09:54 PM

Quote:

Originally Posted by baddog (Post 17854100)
<!--more-->

:helpme A few more details on the easy way :helpme
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.

:pimp

baddog 01-18-2011 09:54 PM

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.

xenigo 01-18-2011 09:58 PM

Quote:

Originally Posted by AAB (Post 17854136)
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
(); ?>


garce 01-18-2011 10:00 PM

Quote:

Originally Posted by xenigo (Post 17854139)
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.

xenigo 01-18-2011 10:04 PM

Quote:

Originally Posted by Itchy (Post 17854146)
:helpme A few more details on the easy way :helpme
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.

:pimp

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.

baddog 01-18-2011 10:05 PM

Quote:

Originally Posted by xenigo (Post 17854157)
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.

AAB 01-18-2011 10:05 PM

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.

xenigo 01-18-2011 10:09 PM

Quote:

Originally Posted by baddog (Post 17854163)
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.

ottopottomouse 01-19-2011 04:29 AM

Quote:

Originally Posted by xenigo (Post 17854157)
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-->

thebedshark 01-19-2011 06:48 AM

A big :thumbsup 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.

Django 01-19-2011 09:35 AM

<!--:1orglaugh-->


All times are GMT -7. The time now is 12:55 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123