WordPress.org

Ready to get started?Download WordPress

Forums

Excerpt doesnt work (13 posts)

  1. cynthiamiur
    Member
    Posted 6 years ago #

    Hey folks, I'd appreciate a little help:
    Im trying to use the excerpt and I've read the tutorials and the FAQ's but it's not working for me. What am I doing wrong?

    I wrote this line on the index, into the loop:
    <?php the_content('View project details...'); ?>

    I've read that when I create a New Post, I need to use the "more" quicktag to add the <!--more--> and create the excerpt. I've done it all but it's not working. The post is showed fully.

    I'm using WordPress 2.1
    Any help? Thanks in advance!

  2. moshu
    Member
    Posted 6 years ago #

    You are mixing two techniques used to not display the whole post.
    1. Replace the_content with the_excerpt and it works automatically.
    2. For the code you have above - you MUST insret the "more" tag into your post while writing it... where you want to break the text.
    p.s. the two methods do NOT work together.

  3. cynthiamiur
    Member
    Posted 6 years ago #

    yeah I know, I used the second method and I inserted the "more" tag. I've experimenting a little more and 'more' tag works perfectly in the main index but it doesnt work in a section I created used a template.php page. Should I use a plugin for that section? The 'more' tag only works in the main index?

  4. moshu
    Member
    Posted 6 years ago #

    I don't know what your 'template.php' thing is. Is it a Page template - as in Pages? Obviously, the "more" does NOT work on Pages, since Pages are never listed as the posts in a "multi-Page" view, so no need for it.

    Perhaps, you should describe in details what is your goal, what do you want to do and someone will tell you HOW to do it.

  5. alyas2022
    Member
    Posted 6 years ago #

    see this plugin The_excert reloaded ;)

    it allows you to add many feature to your sumary like photos ! see my blog for an exemple http://mangaaz.fr.nf

  6. cynthiamiur
    Member
    Posted 6 years ago #

    Moshu,
    I created a php file called Portfolio.php and I added this code at the beginning: <title>Portfolio</title><?php
    /*
    Template Name: Portfolio
    */
    ?>

    Then I copied the loop from the main index and now Im using this template with a Page called Portfolio. That's where the 'more' tag doesnt work.

    Is there a way to make it work?

  7. moshu
    Member
    Posted 6 years ago #

    1. You do NOT need the title tags!
    2. Read again what I said above:

    Obviously, the "more" does NOT work on Pages, since Pages are never listed as the posts in a "multi-Page" view, so no need for it.

  8. cynthiamiur
    Member
    Posted 6 years ago #

    ok, so I wont be able to use excerpts in a page?

  9. moshu
    Member
    Posted 6 years ago #

    Nor excerpts neither more. Not without hacking...
    Try to search: http://wordpress.org/search/excerpt+pages?forums=1
    (and similar keywords)

  10. cynthiamiur
    Member
    Posted 6 years ago #

    Sorry to bother you one more time, but I still have a question:

    I read u said in a thread: "Normally there is no 'multi-Page' display as in the case of 'multi-post' display (like category or monthly archives)" which I understand. But I have, as I explained, a page with a template file, and Im using the Loop on that page and Im calling multiple posts there. I mean, you will see ONE page, but a LOT of posts in there. Why the excerpt or the 'more' doesnt work there, like they do on the main index? I cannot understand that, its the same loop code :(

  11. moshu
    Member
    Posted 6 years ago #

    Because WP "knows" that's a Page and not a multi-post view.

  12. Vincent Mimoun-Prat
    Member
    Posted 6 years ago #

    I wanted to do the same thing: list posts in a special page template.

    Solution found: add before the loop displaying your posts the following code to ask not to display what is after the more tag

    <?php
    		global $more;
    		$more = false;
    	?>
  13. zk0
    Member
    Posted 6 years ago #

    vprat: THANK YOU so much! I love you! ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags